From 3ce0a2a00ffdc82f7940a38a5c2425f8f053c900 Mon Sep 17 00:00:00 2001 From: pheenty Date: Sun, 20 Oct 2024 07:15:22 +0700 Subject: [PATCH 01/10] thermalvisionclothingcomponent --- .../ServerThermalVisionSystem.cs | 31 +++++++++++++++++++ .../ThermalVisionClothingComponent.cs | 10 ++++++ .../Entities/Clothing/Eyes/glasses.yml | 15 +++++++++ 3 files changed, 56 insertions(+) create mode 100644 Content.Server/Stories/ThermalVision/ServerThermalVisionSystem.cs create mode 100644 Content.Shared/Stories/ThermalVision/ThermalVisionClothingComponent.cs diff --git a/Content.Server/Stories/ThermalVision/ServerThermalVisionSystem.cs b/Content.Server/Stories/ThermalVision/ServerThermalVisionSystem.cs new file mode 100644 index 0000000000..0d2edfb012 --- /dev/null +++ b/Content.Server/Stories/ThermalVision/ServerThermalVisionSystem.cs @@ -0,0 +1,31 @@ +using Content.Shared.GameTicking; +using Content.Shared.Inventory.Events; +using Robust.Shared.Player; +using Robust.Shared.Timing; +using Content.Shared.Stories.ThermalVision; + +namespace Content.Server.Stories.ThermalVision; + +public sealed class ServerThermalVisionSystem : EntitySystem +{ + [Dependency] private readonly IGameTiming _gameTiming = default!; + public override void Initialize() + { + base.Initialize(); + SubscribeLocalEvent(OnEquipped); + SubscribeLocalEvent(OnUnequipped); + } + private void OnUnequipped(EntityUid uid, ThermalVisionClothingComponent component, GotUnequippedEvent args) + { + if (args.Slot == "eyes") + RemCompDeferred(args.Equipee); + } + private void OnEquipped(EntityUid uid, ThermalVisionClothingComponent component, GotEquippedEvent args) + { + if (_gameTiming.ApplyingState) + return; + + if (component.Enabled && !HasComp(args.Equipee) && (args.Slot == "eyes")) + AddComp(args.Equipee); + } +} diff --git a/Content.Shared/Stories/ThermalVision/ThermalVisionClothingComponent.cs b/Content.Shared/Stories/ThermalVision/ThermalVisionClothingComponent.cs new file mode 100644 index 0000000000..b60e5cbcdf --- /dev/null +++ b/Content.Shared/Stories/ThermalVision/ThermalVisionClothingComponent.cs @@ -0,0 +1,10 @@ +using Robust.Shared.GameStates; + +namespace Content.Shared.Stories.ThermalVision; + +[RegisterComponent, NetworkedComponent, AutoGenerateComponentState(true)] +public sealed partial class ThermalVisionClothingComponent : Component +{ + [DataField, AutoNetworkedField] + public bool Enabled = true; +} diff --git a/Resources/Prototypes/Stories/Entities/Clothing/Eyes/glasses.yml b/Resources/Prototypes/Stories/Entities/Clothing/Eyes/glasses.yml index 8c94ce87eb..542606f564 100644 --- a/Resources/Prototypes/Stories/Entities/Clothing/Eyes/glasses.yml +++ b/Resources/Prototypes/Stories/Entities/Clothing/Eyes/glasses.yml @@ -1,3 +1,18 @@ +- type: entity + parent: ClothingEyesBase + id: BaseEyeThermal + abstract: true + components: + - type: ThermalVisionClothing + # Уязвимость к вспышкам? + +- type: entity + parent: [ ClothingEyesGlassesThermal, BaseEyeThermal ] + id: ClothingEyesTermalVisionDebug + name: очки термального зрения + suffix: ДЕБАГ + description: Позволяют видеть людей через стены. + - type: entity parent: ClothingEyesBase id: ClothingEyesNightvision From 59d6c14b5a5bf12006f173823b6de9fea662ec61 Mon Sep 17 00:00:00 2001 From: pheenty Date: Mon, 21 Oct 2024 23:10:11 +0700 Subject: [PATCH 02/10] toggling --- ...VisionSystem.cs => ThermalVisionSystem.cs} | 15 ++++++++++++- .../SharedThermalVisionSystem.cs | 21 ++++++++++++++++++- .../ThermalVision/ThermalVisionComponent.cs | 15 +++++++++++-- .../Stories/Actions/thermalvision.yml | 9 ++++++++ .../Entities/Mobs/Ghosts/ascendance.yml | 1 + .../Entities/Mobs/Ghosts/shadowling.yml | 1 + .../Entities/Mobs/Species/shadowling.yml | 1 + Resources/Prototypes/Stories/conversions.yml | 1 + 8 files changed, 60 insertions(+), 4 deletions(-) rename Content.Server/Stories/ThermalVision/{ServerThermalVisionSystem.cs => ThermalVisionSystem.cs} (62%) create mode 100644 Resources/Prototypes/Stories/Actions/thermalvision.yml diff --git a/Content.Server/Stories/ThermalVision/ServerThermalVisionSystem.cs b/Content.Server/Stories/ThermalVision/ThermalVisionSystem.cs similarity index 62% rename from Content.Server/Stories/ThermalVision/ServerThermalVisionSystem.cs rename to Content.Server/Stories/ThermalVision/ThermalVisionSystem.cs index 0d2edfb012..ff621c8d22 100644 --- a/Content.Server/Stories/ThermalVision/ServerThermalVisionSystem.cs +++ b/Content.Server/Stories/ThermalVision/ThermalVisionSystem.cs @@ -1,3 +1,4 @@ +using Content.Shared.Actions; using Content.Shared.GameTicking; using Content.Shared.Inventory.Events; using Robust.Shared.Player; @@ -6,14 +7,18 @@ namespace Content.Server.Stories.ThermalVision; -public sealed class ServerThermalVisionSystem : EntitySystem +public sealed class ThermalVisionSystem : EntitySystem { [Dependency] private readonly IGameTiming _gameTiming = default!; + [Dependency] private readonly SharedActionsSystem _actions = default!; + public override void Initialize() { base.Initialize(); SubscribeLocalEvent(OnEquipped); SubscribeLocalEvent(OnUnequipped); + SubscribeLocalEvent(OnStartUp); + SubscribeLocalEvent(OnShutdown); } private void OnUnequipped(EntityUid uid, ThermalVisionClothingComponent component, GotUnequippedEvent args) { @@ -28,4 +33,12 @@ private void OnEquipped(EntityUid uid, ThermalVisionClothingComponent component, if (component.Enabled && !HasComp(args.Equipee) && (args.Slot == "eyes")) AddComp(args.Equipee); } + private void OnStartUp(EntityUid uid, ThermalVisionComponent component, ComponentStartup args) + { + _actions.AddAction(uid, ref component.ToggleActionEntity, component.ToggleAction); + } + private void OnShutdown(EntityUid uid, ThermalVisionComponent component, ComponentShutdown args) + { + Del(component.ToggleActionEntity); + } } diff --git a/Content.Shared/Stories/ThermalVision/SharedThermalVisionSystem.cs b/Content.Shared/Stories/ThermalVision/SharedThermalVisionSystem.cs index dd3620af6d..b1a9596dc4 100644 --- a/Content.Shared/Stories/ThermalVision/SharedThermalVisionSystem.cs +++ b/Content.Shared/Stories/ThermalVision/SharedThermalVisionSystem.cs @@ -1,13 +1,22 @@ -namespace Content.Shared.Stories.ThermalVision; +using Robust.Shared.Audio.Systems; +using Robust.Shared.Timing; + +namespace Content.Shared.Stories.ThermalVision; public abstract class SharedThermalVisionSystem : EntitySystem { + [Dependency] private readonly IGameTiming _timing = default!; + [Dependency] private readonly SharedAudioSystem _audio = default!; public override void Initialize() { + base.Initialize(); + SubscribeLocalEvent(OnThermalVisionMapInit); SubscribeLocalEvent(OnThermalVisionRemove); SubscribeLocalEvent(OnThermalVisionAfterHandle); + + SubscribeLocalEvent(OnToggle); } private void OnThermalVisionAfterHandle(Entity ent, ref AfterAutoHandleStateEvent args) @@ -32,4 +41,14 @@ protected virtual void ThermalVisionChanged(Entity ent) protected virtual void ThermalVisionRemoved(Entity ent) { } + private void OnToggle(EntityUid uid, ThermalVisionComponent component, ToggleThermalVisionEvent args) + { + if (!_timing.IsFirstTimePredicted) + return; + component.Enabled = !component.Enabled; + var ent = new Entity(uid, component); + ThermalVisionChanged(ent); + if (component.Enabled && component.PlaySound) + _audio.PlayLocal(component.ToggleOnSound, uid, uid); + } } diff --git a/Content.Shared/Stories/ThermalVision/ThermalVisionComponent.cs b/Content.Shared/Stories/ThermalVision/ThermalVisionComponent.cs index c3c3972944..5952321a0c 100644 --- a/Content.Shared/Stories/ThermalVision/ThermalVisionComponent.cs +++ b/Content.Shared/Stories/ThermalVision/ThermalVisionComponent.cs @@ -1,10 +1,21 @@ -using Robust.Shared.GameStates; +using Content.Shared.Actions; +using Robust.Shared.Audio; +using Robust.Shared.GameStates; namespace Content.Shared.Stories.ThermalVision; [RegisterComponent, NetworkedComponent, AutoGenerateComponentState(true)] public sealed partial class ThermalVisionComponent : Component { + [ViewVariables(VVAccess.ReadWrite), DataField("enabled"), AutoNetworkedField] + public bool Enabled { get; set; } = false; + [DataField] + public string ToggleAction = "ToggleThermalVisionAction"; [DataField, AutoNetworkedField] - public bool Enabled = true; + public EntityUid? ToggleActionEntity; + [ViewVariables(VVAccess.ReadWrite), DataField("playSound"), AutoNetworkedField] + public bool PlaySound { get; set; } = true; // For shadowling + [DataField("toggleOnSound")] + public SoundSpecifier ToggleOnSound = new SoundPathSpecifier("/Audio/Misc/notice2.ogg"); // Плейсхолдер } +public sealed partial class ToggleThermalVisionEvent : InstantActionEvent { } diff --git a/Resources/Prototypes/Stories/Actions/thermalvision.yml b/Resources/Prototypes/Stories/Actions/thermalvision.yml new file mode 100644 index 0000000000..af48929c46 --- /dev/null +++ b/Resources/Prototypes/Stories/Actions/thermalvision.yml @@ -0,0 +1,9 @@ +- type: entity + id: ToggleThermalVisionAction + name: Термальное зрение + description: Переключить своё термальное зрение. + components: + - type: InstantAction + useDelay: 5 + icon: { sprite: Clothing/Eyes/Glasses/thermal.rsi, state: icon } # Плейсхолдер + event: !type:ToggleThermalVisionEvent diff --git a/Resources/Prototypes/Stories/Entities/Mobs/Ghosts/ascendance.yml b/Resources/Prototypes/Stories/Entities/Mobs/Ghosts/ascendance.yml index 79ac9977eb..3826cc0a7e 100644 --- a/Resources/Prototypes/Stories/Entities/Mobs/Ghosts/ascendance.yml +++ b/Resources/Prototypes/Stories/Entities/Mobs/Ghosts/ascendance.yml @@ -8,6 +8,7 @@ components: - type: ZombieImmune - type: ThermalVision + playSound: false - type: MobState allowedStates: - Alive diff --git a/Resources/Prototypes/Stories/Entities/Mobs/Ghosts/shadowling.yml b/Resources/Prototypes/Stories/Entities/Mobs/Ghosts/shadowling.yml index 0a3f45e168..abe43deb89 100644 --- a/Resources/Prototypes/Stories/Entities/Mobs/Ghosts/shadowling.yml +++ b/Resources/Prototypes/Stories/Entities/Mobs/Ghosts/shadowling.yml @@ -8,6 +8,7 @@ components: - type: ZombieImmune - type: ThermalVision + playSound: false - type: MobState allowedStates: - Alive diff --git a/Resources/Prototypes/Stories/Entities/Mobs/Species/shadowling.yml b/Resources/Prototypes/Stories/Entities/Mobs/Species/shadowling.yml index 4940e68f4d..396c9b3439 100644 --- a/Resources/Prototypes/Stories/Entities/Mobs/Species/shadowling.yml +++ b/Resources/Prototypes/Stories/Entities/Mobs/Species/shadowling.yml @@ -11,6 +11,7 @@ components: - type: ZombieImmune - type: ThermalVision + playSound: false - type: ComplexInteraction - type: Destructible thresholds: diff --git a/Resources/Prototypes/Stories/conversions.yml b/Resources/Prototypes/Stories/conversions.yml index 6df5c04773..81daf37d18 100644 --- a/Resources/Prototypes/Stories/conversions.yml +++ b/Resources/Prototypes/Stories/conversions.yml @@ -12,6 +12,7 @@ color: Red components: - type: ThermalVision + playSound: false - type: ShadowlingThrall mindRoles: - MindRoleShadowlingThrall From 262520a3387e3b4cb28befedc173640d7aa07ac4 Mon Sep 17 00:00:00 2001 From: pheenty Date: Tue, 22 Oct 2024 03:00:43 +0700 Subject: [PATCH 03/10] sprites, uplink listings, shadowling interaction --- .../ThermalVision/ThermalVisionSystem.cs | 11 +++-- .../SharedThermalVisionSystem.cs | 2 - .../ThermalVision/ThermalVisionComponent.cs | 5 --- .../Stories/Catalog/uplink_catalog.yml | 38 +++++++++++++++++- .../Entities/Clothing/Eyes/glasses.yml | 28 +++++++++---- .../Glasses/termalhud.rsi/equipped-EYES.png | Bin 0 -> 294 bytes .../Eyes/Glasses/termalhud.rsi/icon.png | Bin 0 -> 667 bytes .../Glasses/termalhud.rsi/inhand-left.png | Bin 0 -> 248 bytes .../Glasses/termalhud.rsi/inhand-right.png | Bin 0 -> 251 bytes .../Eyes/Glasses/termalhud.rsi/meta.json | 26 ++++++++++++ .../termalhud_oneglass.rsi/equipped-EYES.png | Bin 0 -> 230 bytes .../Glasses/termalhud_oneglass.rsi/icon.png | Bin 0 -> 631 bytes .../termalhud_oneglass.rsi/inhand-left.png | Bin 0 -> 233 bytes .../termalhud_oneglass.rsi/inhand-right.png | Bin 0 -> 243 bytes .../Glasses/termalhud_oneglass.rsi/meta.json | 26 ++++++++++++ 15 files changed, 118 insertions(+), 18 deletions(-) create mode 100644 Resources/Textures/Stories/Clothing/Eyes/Glasses/termalhud.rsi/equipped-EYES.png create mode 100644 Resources/Textures/Stories/Clothing/Eyes/Glasses/termalhud.rsi/icon.png create mode 100644 Resources/Textures/Stories/Clothing/Eyes/Glasses/termalhud.rsi/inhand-left.png create mode 100644 Resources/Textures/Stories/Clothing/Eyes/Glasses/termalhud.rsi/inhand-right.png create mode 100644 Resources/Textures/Stories/Clothing/Eyes/Glasses/termalhud.rsi/meta.json create mode 100644 Resources/Textures/Stories/Clothing/Eyes/Glasses/termalhud_oneglass.rsi/equipped-EYES.png create mode 100644 Resources/Textures/Stories/Clothing/Eyes/Glasses/termalhud_oneglass.rsi/icon.png create mode 100644 Resources/Textures/Stories/Clothing/Eyes/Glasses/termalhud_oneglass.rsi/inhand-left.png create mode 100644 Resources/Textures/Stories/Clothing/Eyes/Glasses/termalhud_oneglass.rsi/inhand-right.png create mode 100644 Resources/Textures/Stories/Clothing/Eyes/Glasses/termalhud_oneglass.rsi/meta.json diff --git a/Content.Server/Stories/ThermalVision/ThermalVisionSystem.cs b/Content.Server/Stories/ThermalVision/ThermalVisionSystem.cs index ff621c8d22..9a8e912ed3 100644 --- a/Content.Server/Stories/ThermalVision/ThermalVisionSystem.cs +++ b/Content.Server/Stories/ThermalVision/ThermalVisionSystem.cs @@ -1,16 +1,21 @@ +using Content.Server.Mind; +using Content.Server.Stories.Shadowling; using Content.Shared.Actions; using Content.Shared.GameTicking; using Content.Shared.Inventory.Events; +using Content.Shared.Roles; +using Content.Shared.Stories.ThermalVision; using Robust.Shared.Player; using Robust.Shared.Timing; -using Content.Shared.Stories.ThermalVision; namespace Content.Server.Stories.ThermalVision; public sealed class ThermalVisionSystem : EntitySystem { [Dependency] private readonly IGameTiming _gameTiming = default!; + [Dependency] private readonly MindSystem _mind = default!; [Dependency] private readonly SharedActionsSystem _actions = default!; + [Dependency] private readonly SharedRoleSystem _roles = default!; public override void Initialize() { @@ -22,8 +27,8 @@ public override void Initialize() } private void OnUnequipped(EntityUid uid, ThermalVisionClothingComponent component, GotUnequippedEvent args) { - if (args.Slot == "eyes") - RemCompDeferred(args.Equipee); + if (args.Slot == "eyes" && _mind.GetMind(args.Equipee) is { } mind && !_roles.MindHasRole(mind)) // Hardcode + RemCompDeferred(args.Equipee); } private void OnEquipped(EntityUid uid, ThermalVisionClothingComponent component, GotEquippedEvent args) { diff --git a/Content.Shared/Stories/ThermalVision/SharedThermalVisionSystem.cs b/Content.Shared/Stories/ThermalVision/SharedThermalVisionSystem.cs index b1a9596dc4..bf6d1b8763 100644 --- a/Content.Shared/Stories/ThermalVision/SharedThermalVisionSystem.cs +++ b/Content.Shared/Stories/ThermalVision/SharedThermalVisionSystem.cs @@ -48,7 +48,5 @@ private void OnToggle(EntityUid uid, ThermalVisionComponent component, ToggleThe component.Enabled = !component.Enabled; var ent = new Entity(uid, component); ThermalVisionChanged(ent); - if (component.Enabled && component.PlaySound) - _audio.PlayLocal(component.ToggleOnSound, uid, uid); } } diff --git a/Content.Shared/Stories/ThermalVision/ThermalVisionComponent.cs b/Content.Shared/Stories/ThermalVision/ThermalVisionComponent.cs index 5952321a0c..300e005826 100644 --- a/Content.Shared/Stories/ThermalVision/ThermalVisionComponent.cs +++ b/Content.Shared/Stories/ThermalVision/ThermalVisionComponent.cs @@ -1,5 +1,4 @@ using Content.Shared.Actions; -using Robust.Shared.Audio; using Robust.Shared.GameStates; namespace Content.Shared.Stories.ThermalVision; @@ -13,9 +12,5 @@ public sealed partial class ThermalVisionComponent : Component public string ToggleAction = "ToggleThermalVisionAction"; [DataField, AutoNetworkedField] public EntityUid? ToggleActionEntity; - [ViewVariables(VVAccess.ReadWrite), DataField("playSound"), AutoNetworkedField] - public bool PlaySound { get; set; } = true; // For shadowling - [DataField("toggleOnSound")] - public SoundSpecifier ToggleOnSound = new SoundPathSpecifier("/Audio/Misc/notice2.ogg"); // Плейсхолдер } public sealed partial class ToggleThermalVisionEvent : InstantActionEvent { } diff --git a/Resources/Prototypes/Stories/Catalog/uplink_catalog.yml b/Resources/Prototypes/Stories/Catalog/uplink_catalog.yml index cc98501135..a909af8c47 100644 --- a/Resources/Prototypes/Stories/Catalog/uplink_catalog.yml +++ b/Resources/Prototypes/Stories/Catalog/uplink_catalog.yml @@ -6,4 +6,40 @@ cost: Telecrystal: 6 categories: - - UplinkDisruption \ No newline at end of file + - UplinkDisruption + +- type: listing + id: UplinkClothingEyesThermalVisionMonocular + name: Монокль термального зрения + description: Новейшая разведочная технология, которую поместили внутрь монокля. Позволяет видеть органические цели в полной темноте и даже через стены. + productEntity: ClothingEyesThermalVisionMonocular + discountCategory: rareDiscounts + discountDownTo: + Telecrystal: 4 + cost: + Telecrystal: 6 + categories: + - UplinkWearables + conditions: + - !type:StoreWhitelistCondition + blacklist: + tags: + - NukeOpsUplink + +- type: listing + id: UplinkClothingEyesThermalVisionHud + name: Термальный визор оперативника + description: Новейшая разведочная технология, которую поместили внутрь визора. Позволяет видеть органические цели в полной темноте и даже через стены. Этот вариант специально для Ядерных Оперативников имеет встроенный визор Синдиката. + productEntity: ClothingEyesThermalVisionHud + discountCategory: rareDiscounts + discountDownTo: + Telecrystal: 6 + cost: + Telecrystal: 9 + categories: + - UplinkWearables + conditions: + - !type:StoreWhitelistCondition + whitelist: + tags: + - NukeOpsUplink diff --git a/Resources/Prototypes/Stories/Entities/Clothing/Eyes/glasses.yml b/Resources/Prototypes/Stories/Entities/Clothing/Eyes/glasses.yml index 542606f564..71c3484127 100644 --- a/Resources/Prototypes/Stories/Entities/Clothing/Eyes/glasses.yml +++ b/Resources/Prototypes/Stories/Entities/Clothing/Eyes/glasses.yml @@ -1,17 +1,31 @@ - type: entity parent: ClothingEyesBase - id: BaseEyeThermal + id: ClothingEyesThermalVisionBase abstract: true components: - type: ThermalVisionClothing - # Уязвимость к вспышкам? - type: entity - parent: [ ClothingEyesGlassesThermal, BaseEyeThermal ] - id: ClothingEyesTermalVisionDebug - name: очки термального зрения - suffix: ДЕБАГ - description: Позволяют видеть людей через стены. + parent: ClothingEyesThermalVisionBase + id: ClothingEyesThermalVisionMonocular + name: монокль термального зрения + description: Новейшая разведочная технология, которую поместили внутрь монокля. Позволяет видеть органические цели в полной темноте и даже через стены. + components: + - type: Sprite + sprite: Stories/Clothing/Eyes/Glasses/termalhud_oneglass.rsi + - type: Clothing + sprite: Stories/Clothing/Eyes/Glasses/termalhud_oneglass.rsi + +- type: entity + parent: [ ClothingEyesThermalVisionBase, ClothingEyesHudSyndicate ] + id: ClothingEyesThermalVisionHud + name: термальный визор оперативника + description: Новейшая разведочная технология, которую поместили внутрь визора. Позволяет видеть органические цели в полной темноте и даже через стены. Этот вариант специально для Ядерных Оперативников имеет встроенный визор Синдиката. + components: + - type: Sprite + sprite: Stories/Clothing/Eyes/Glasses/termalhud.rsi + - type: Clothing + sprite: Stories/Clothing/Eyes/Glasses/termalhud.rsi - type: entity parent: ClothingEyesBase diff --git a/Resources/Textures/Stories/Clothing/Eyes/Glasses/termalhud.rsi/equipped-EYES.png b/Resources/Textures/Stories/Clothing/Eyes/Glasses/termalhud.rsi/equipped-EYES.png new file mode 100644 index 0000000000000000000000000000000000000000..48c8c9d292fb7dbf78cd94a01e8c469a850a6b3f GIT binary patch literal 294 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=jKx9jP7LeL$-D$|9(cMqhE&XX zduwmuVFRAFhvzjz6Bzv(W<^)=>raT%Uh$0SAd}7&C0D7tH;WEgTvMI?UGpUK!To#_ z7#_%5_p(h1D#|~1=1P=w+~?JIY^&dQb*z?II%SXPznRl7G8kXBboy-bTGwg4pq2ZH zGgqqRWAi-T$EI!Dz5ei(sLOYQe^pG4di`!a&>1lBhl&5{r~I#6HOt-pXPi_16j%6N zXX%pN&s|Sli(2;Oi&3T5PLIloMZ4Rpd!@hsIkEO?RB`O}VLLewHIXO5f001bFV_;x1aCC8UWfEXu$jvJ$3UYT+h=`0*U_Z~m#=y(~28qeV z1&#p$J|K2peqJgA2KaW3fe}Ps)&-e`DUTO$B^MNx0O>zKY?P8(oXo($XaHnqmzNX( z#Tn-S*&<2VVD<(OyC@{c8OS~YWb>s%*jGU8BnbNnh+PEq1d#m&q&^+YX5s*w17XX6 z*d?hIAbS~{^9w4AGSf3k6bvmbEfpM7@{>{(f-8$lQge$HJoA$Ciwg3K5=&B3fNCM` z0|P;bLQsfl05w`@lIU-O02B`p*5^QQ_%e!}L5Lwha%oW+l*!0sOqh=_V~zv^ga1+n z29`evF_T^fh6Oqd4E$3OVrqsA3ElET{R9J=Wlc8?I zFc5~nOaoC+RZuVx4fYCWvS$d)Ym5yS7Vj|%2M3EwT=&v$1?Boc{4;y?2Q$7_4COM-}8JscB47_2L6*(=4P*6c+3xG`qnc`*T{)DfW8 z8i3juUZaa*YGbJDx=&<2pW~dPEK2~IreU#I(6%k!dqN0UYcqh`OXkm=@q;k{97MPu z?TfW_7u$&7oWq6+KHjjQLS{Pvy!RAEF{svL0%L=v2+NW7KA~;nN8IhvpJ(&7ZNIe% z;AYBLYn{C))f=4H0xJ<#U2LpvL#hnX zEjEu$;5^j79>O?@cpYCJ|CG4AWAj8Jkx2Y$z5o~-m1g+BRIdO4002ovPDHLkV1kgm B4xj)4 literal 0 HcmV?d00001 diff --git a/Resources/Textures/Stories/Clothing/Eyes/Glasses/termalhud.rsi/inhand-left.png b/Resources/Textures/Stories/Clothing/Eyes/Glasses/termalhud.rsi/inhand-left.png new file mode 100644 index 0000000000000000000000000000000000000000..62836e8410b7f26c437128d332954cd28628cb31 GIT binary patch literal 248 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=jKx9jP7LeL$-D$|HhH=@hE&XX zd&`jPumMkNVqg{b+y`f^iuG1-uWYTe)a zvC{pMLS|;ptSr|&{iV{Xa(OK~rFr!goAZ}n&nw+? z^PHuDugexb9f&y~vZ6=Z-aY+^U|g}c(djb}eGUk|`{z9&=QGE4HLp`^rY);Eu>YOS lAKi=w|9mUMM|mNa|mvUY1>@vU{) zs}9%M9Nh9V=lX>ZMu9N@Fni$qx&a!eR5~e?Ros; z#-lm4r#I+k{bF1?WnK6M<^KWF2JSxJJ9h9mr=&GcwL5(#Vp{5Tqs=#2zeK!?eP08# z3kV*RU;W1Vg?Zmz2X527jj!qs+VLLewHIXO5f001bFV_;x1aCC8UWfEXu$jvJ$3UYT+h=`0*U_Z~m#=y(~28qeV z1&#p$J|K2peqJgA2KaW3fe}Ps)&-e`DUTO$B^MNx0O>zKY?P8(oXo($XaHnqmzNX( z#Tn-S*&<2VVD<(OyC@{c8OS~YWb>s%*jGU8BnbNnh+PEq1d#m&q&^+YX5s*w17XX6 z*d?hIAbS~{^9w4AGSf3k6bvmbEfpM7@{>{(f-8$lQge$HJoA$Ciwg3K5=&B3fNCM` z0|P;bLQsfl05w`@lIU-O02B`p*5^QQ_%e!}L5Lwha%oW+l*!0sOqh=_V~zv^ga1+n z29`evF_T^fh6Oqd4E$3OVrqsA32}wjjR9J=Wls#(1 zFc5{m4Jm|hrNVX8MLEuv$$9n`X_Mn@t5mUT6|RJsPALMye<5JAW($4bVkG1D^gJ4< zR4NByt<7ue4@VoR2JX(l=?D?$Txme>{Y3NemcrKBtdv4)P17`l5Ek#;{1<4gNh$rg zzbkZx81TK)Dfbnzop6{+hDFuKr1`#PnU^$RBHQ@*3*HQiD zJpj+nm9-b=5D}D8v~5cW0j)K|Fwk{f(cRsIYvOZaj3tRVn+&|csfT=C5&r~wKtwRc zkWwn~i^$~kn+=S)I>&WX_xv`ZF{Z@roXbk7#SDO*gXq6oFh6ajQmIt#k{`fgX6waP RW=3#iqyjKZ;7uVAM+x_ndmDLGae5hVN_&o%PozasqW7us>s& zUw!_=n#=c?->lVbNR8zC{>w9&A#|#tTed)UQS9XGPrDj!Gu_zscJ->D(4Bwy?mnDT zqi)a04Acw+H9h5Wo+V$36fVXV^jwVnl(>HX{)E~h)BADW9mgXX b7~Z_)+n}Pc`{#w$y&#>Qu6{1-oD!MG%XMnurAxVt|cP%!U59;Wg+%WDVz@{{_jq_VR<5g6R3%SA)#&e z^^20<%4B5|wp?ZQ(46~9R7cLiYvrt&N{iCxoxR2C8#HgppUl6D7;Toy2zGHy4bqEt z{&q$0g`O>&J0sW#5K*A!K25D^j;mwR*+<|1mzA$i+m^pb()Qf0+T9yP1^aY-{)AW_ izWZ9zI~b_=hq(T)zZ#S6PUohA^m@AbxvX Date: Tue, 22 Oct 2024 04:19:55 +0700 Subject: [PATCH 04/10] action icon --- .../Prototypes/Stories/Actions/thermalvision.yml | 2 +- .../Eyes/Glasses/termalhud.rsi/action.png | Bin 0 -> 968 bytes .../Clothing/Eyes/Glasses/termalhud.rsi/meta.json | 5 ++++- 3 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 Resources/Textures/Stories/Clothing/Eyes/Glasses/termalhud.rsi/action.png diff --git a/Resources/Prototypes/Stories/Actions/thermalvision.yml b/Resources/Prototypes/Stories/Actions/thermalvision.yml index af48929c46..1c573b0ad8 100644 --- a/Resources/Prototypes/Stories/Actions/thermalvision.yml +++ b/Resources/Prototypes/Stories/Actions/thermalvision.yml @@ -5,5 +5,5 @@ components: - type: InstantAction useDelay: 5 - icon: { sprite: Clothing/Eyes/Glasses/thermal.rsi, state: icon } # Плейсхолдер + icon: { sprite: Stories/Clothing/Eyes/Glasses/termalhud.rsi, state: action } event: !type:ToggleThermalVisionEvent diff --git a/Resources/Textures/Stories/Clothing/Eyes/Glasses/termalhud.rsi/action.png b/Resources/Textures/Stories/Clothing/Eyes/Glasses/termalhud.rsi/action.png new file mode 100644 index 0000000000000000000000000000000000000000..f99b71a868a32925d0d658994ab398f236437cc7 GIT binary patch literal 968 zcmV;(12_DMP)Px#1ZP1_K>z@;j|==^1poj8SV=@dR9HvNmtROzaTLdoy4l(+HBB`4P$vE>qJI{) zm!uMegdi#?ik|jb^bqvcO9T>O*-L|>mja9M!9d8B6yK3zm z@9+A%*WcCM1=3obCRWP_SwLA6P~x0h?pBvRqmw!XtAD;9@CZpQ%Y8 zGbc~EEv9VaPgwgVK>m1n2^6>bp?6{uLc8)b`lag+$u}aeaIcy`qN2rw!(oG@gFEQr zG16nfR084f1oYf*h3Q9cA;qzhb}!P+U@8G*gFTt-Xn36Lm$3*)Z6D$D$Phg4{{;(AVwiVFa@*cb?iQvz&DJnp!B}wsO$5aBiQ`}`;@H?#sKYW9ko__M2otz-yohXMI1J5K zPms?TlBdZ=OR!URs=i%#{E7vz_pyGs_aCR<=laV{k0XDiAq zM!IABKC&3A#C@K8J;DS|9^M8u?LDf`NQhoIbU1vG$m~wB>>?eht*s@Cv6!!CUIG`+ zRDsj!gv!cFxGi;)j~WjfK2~-HKa}W%k*ce9oVhCGc zl|PYX$ksx#GlS0|@^ygvt}i>UKWptG-Q{wTWk`}lcEJ{$IC3LyWm%?YF$TuMm^W%_=pK)$Ga**M{$q%~^8>l*>WgPIdLrWWmUe9g z^~8N9bd?rCMRpb(bFQQHs@{;=hIlbOgpBe%n<)`Y=wFB{0X&TIhfh|S-I*Csb)ZyH zW5aX;cnC%CP|8ll2(O#LR04SZ&p%qGIsfAai}YCefBu>+2WkS!dKm!t3q!`Z$m8Sg qO8@`>4rN$LW=%~1DgXcg2mk;800000(o>TF0000 Date: Tue, 22 Oct 2024 04:43:10 +0700 Subject: [PATCH 05/10] its silent anyways --- Resources/Prototypes/Stories/Entities/Mobs/Ghosts/ascendance.yml | 1 - Resources/Prototypes/Stories/Entities/Mobs/Ghosts/shadowling.yml | 1 - .../Prototypes/Stories/Entities/Mobs/Species/shadowling.yml | 1 - Resources/Prototypes/Stories/conversions.yml | 1 - 4 files changed, 4 deletions(-) diff --git a/Resources/Prototypes/Stories/Entities/Mobs/Ghosts/ascendance.yml b/Resources/Prototypes/Stories/Entities/Mobs/Ghosts/ascendance.yml index 3826cc0a7e..79ac9977eb 100644 --- a/Resources/Prototypes/Stories/Entities/Mobs/Ghosts/ascendance.yml +++ b/Resources/Prototypes/Stories/Entities/Mobs/Ghosts/ascendance.yml @@ -8,7 +8,6 @@ components: - type: ZombieImmune - type: ThermalVision - playSound: false - type: MobState allowedStates: - Alive diff --git a/Resources/Prototypes/Stories/Entities/Mobs/Ghosts/shadowling.yml b/Resources/Prototypes/Stories/Entities/Mobs/Ghosts/shadowling.yml index abe43deb89..0a3f45e168 100644 --- a/Resources/Prototypes/Stories/Entities/Mobs/Ghosts/shadowling.yml +++ b/Resources/Prototypes/Stories/Entities/Mobs/Ghosts/shadowling.yml @@ -8,7 +8,6 @@ components: - type: ZombieImmune - type: ThermalVision - playSound: false - type: MobState allowedStates: - Alive diff --git a/Resources/Prototypes/Stories/Entities/Mobs/Species/shadowling.yml b/Resources/Prototypes/Stories/Entities/Mobs/Species/shadowling.yml index 396c9b3439..4940e68f4d 100644 --- a/Resources/Prototypes/Stories/Entities/Mobs/Species/shadowling.yml +++ b/Resources/Prototypes/Stories/Entities/Mobs/Species/shadowling.yml @@ -11,7 +11,6 @@ components: - type: ZombieImmune - type: ThermalVision - playSound: false - type: ComplexInteraction - type: Destructible thresholds: diff --git a/Resources/Prototypes/Stories/conversions.yml b/Resources/Prototypes/Stories/conversions.yml index 81daf37d18..6df5c04773 100644 --- a/Resources/Prototypes/Stories/conversions.yml +++ b/Resources/Prototypes/Stories/conversions.yml @@ -12,7 +12,6 @@ color: Red components: - type: ThermalVision - playSound: false - type: ShadowlingThrall mindRoles: - MindRoleShadowlingThrall From 629bf6de7afa14b280c7c0fa96d5548435607595 Mon Sep 17 00:00:00 2001 From: pheenty Date: Tue, 22 Oct 2024 19:54:54 +0700 Subject: [PATCH 06/10] unnecessary dependency --- .../Stories/ThermalVision/SharedThermalVisionSystem.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Content.Shared/Stories/ThermalVision/SharedThermalVisionSystem.cs b/Content.Shared/Stories/ThermalVision/SharedThermalVisionSystem.cs index bf6d1b8763..dc6de72ebd 100644 --- a/Content.Shared/Stories/ThermalVision/SharedThermalVisionSystem.cs +++ b/Content.Shared/Stories/ThermalVision/SharedThermalVisionSystem.cs @@ -1,12 +1,10 @@ -using Robust.Shared.Audio.Systems; -using Robust.Shared.Timing; +using Robust.Shared.Timing; namespace Content.Shared.Stories.ThermalVision; public abstract class SharedThermalVisionSystem : EntitySystem { [Dependency] private readonly IGameTiming _timing = default!; - [Dependency] private readonly SharedAudioSystem _audio = default!; public override void Initialize() { base.Initialize(); From a26838edd7db7fb6694cad89728de56e38500246 Mon Sep 17 00:00:00 2001 From: pheenty Date: Tue, 22 Oct 2024 21:17:02 +0700 Subject: [PATCH 07/10] less hardcode --- .../Stories/ThermalVision/ThermalVisionSystem.cs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Content.Server/Stories/ThermalVision/ThermalVisionSystem.cs b/Content.Server/Stories/ThermalVision/ThermalVisionSystem.cs index 9a8e912ed3..3d66a3e62f 100644 --- a/Content.Server/Stories/ThermalVision/ThermalVisionSystem.cs +++ b/Content.Server/Stories/ThermalVision/ThermalVisionSystem.cs @@ -1,9 +1,7 @@ -using Content.Server.Mind; -using Content.Server.Stories.Shadowling; using Content.Shared.Actions; using Content.Shared.GameTicking; using Content.Shared.Inventory.Events; -using Content.Shared.Roles; +using Content.Shared.Stories.Shadowling; using Content.Shared.Stories.ThermalVision; using Robust.Shared.Player; using Robust.Shared.Timing; @@ -13,9 +11,7 @@ namespace Content.Server.Stories.ThermalVision; public sealed class ThermalVisionSystem : EntitySystem { [Dependency] private readonly IGameTiming _gameTiming = default!; - [Dependency] private readonly MindSystem _mind = default!; [Dependency] private readonly SharedActionsSystem _actions = default!; - [Dependency] private readonly SharedRoleSystem _roles = default!; public override void Initialize() { @@ -27,7 +23,7 @@ public override void Initialize() } private void OnUnequipped(EntityUid uid, ThermalVisionClothingComponent component, GotUnequippedEvent args) { - if (args.Slot == "eyes" && _mind.GetMind(args.Equipee) is { } mind && !_roles.MindHasRole(mind)) // Hardcode + if (args.Slot == "eyes" && !HasComp(args.Equipee)) RemCompDeferred(args.Equipee); } private void OnEquipped(EntityUid uid, ThermalVisionClothingComponent component, GotEquippedEvent args) From dca379d86570c6ade0d874355821a45bb0eac424 Mon Sep 17 00:00:00 2001 From: pheenty Date: Sat, 2 Nov 2024 00:43:33 +0700 Subject: [PATCH 08/10] change meta --- .../Stories/Actions/thermalvision.yml | 2 +- .../Actions/thermalVision.rsi/meta.json | 14 +++++ .../thermalVision.rsi/toggle.png} | Bin .../Eyes/Glasses/termalhud.rsi/meta.json | 49 ++++++++---------- .../Glasses/termalhud_oneglass.rsi/meta.json | 48 ++++++++--------- 5 files changed, 62 insertions(+), 51 deletions(-) create mode 100644 Resources/Textures/Stories/Actions/thermalVision.rsi/meta.json rename Resources/Textures/Stories/{Clothing/Eyes/Glasses/termalhud.rsi/action.png => Actions/thermalVision.rsi/toggle.png} (100%) diff --git a/Resources/Prototypes/Stories/Actions/thermalvision.yml b/Resources/Prototypes/Stories/Actions/thermalvision.yml index 1c573b0ad8..53ef3cbc8d 100644 --- a/Resources/Prototypes/Stories/Actions/thermalvision.yml +++ b/Resources/Prototypes/Stories/Actions/thermalvision.yml @@ -5,5 +5,5 @@ components: - type: InstantAction useDelay: 5 - icon: { sprite: Stories/Clothing/Eyes/Glasses/termalhud.rsi, state: action } + icon: { sprite: Stories/Actions/thermalVision.rsi, state: toggle } event: !type:ToggleThermalVisionEvent diff --git a/Resources/Textures/Stories/Actions/thermalVision.rsi/meta.json b/Resources/Textures/Stories/Actions/thermalVision.rsi/meta.json new file mode 100644 index 0000000000..8fbd87679e --- /dev/null +++ b/Resources/Textures/Stories/Actions/thermalVision.rsi/meta.json @@ -0,0 +1,14 @@ +{ + "version": 1, + "license": "Any distribution, modification or use outside of SpaceStories without the SpaceStories owner's agreement is strictly prohibited.", + "copyright": "Created By RustedTim(discord:helloo4771) for SpaceStories(Server SS14).", + "size": { + "x": 32, + "y": 32 + }, + "states": [ + { + "name": "toggle" + } + ] +} diff --git a/Resources/Textures/Stories/Clothing/Eyes/Glasses/termalhud.rsi/action.png b/Resources/Textures/Stories/Actions/thermalVision.rsi/toggle.png similarity index 100% rename from Resources/Textures/Stories/Clothing/Eyes/Glasses/termalhud.rsi/action.png rename to Resources/Textures/Stories/Actions/thermalVision.rsi/toggle.png diff --git a/Resources/Textures/Stories/Clothing/Eyes/Glasses/termalhud.rsi/meta.json b/Resources/Textures/Stories/Clothing/Eyes/Glasses/termalhud.rsi/meta.json index b88146834d..de94ef13eb 100644 --- a/Resources/Textures/Stories/Clothing/Eyes/Glasses/termalhud.rsi/meta.json +++ b/Resources/Textures/Stories/Clothing/Eyes/Glasses/termalhud.rsi/meta.json @@ -1,29 +1,26 @@ { - "version": 1, - "license": "Собственная лицензия. Копирование, модификация и использование вне проекта Space Stories полностью запрещено без предварительного согласия текущего владельца проекта", - "copyright": "Created By RustedTim(discord:helloo4771) for SpaceStories(Server SS14).", - "size": { - "x": 32, - "y": 32 - }, - "states": [ - { - "name": "action" + "version": 1, + "license": "Any distribution, modification or use outside of SpaceStories without the agreement of SpaceStories owner is strictly prohibited.", + "copyright": "Created By RustedTim(discord:helloo4771) for SpaceStories(Server SS14).", + "size": { + "x": 32, + "y": 32 }, - { - "name": "equipped-EYES", - "directions": 4 - }, - { - "name": "icon" - }, - { - "name": "inhand-left", - "directions": 4 - }, - { - "name": "inhand-right", - "directions": 4 - } - ] + "states": [ + { + "name": "equipped-EYES", + "directions": 4 + }, + { + "name": "icon" + }, + { + "name": "inhand-left", + "directions": 4 + }, + { + "name": "inhand-right", + "directions": 4 + } + ] } diff --git a/Resources/Textures/Stories/Clothing/Eyes/Glasses/termalhud_oneglass.rsi/meta.json b/Resources/Textures/Stories/Clothing/Eyes/Glasses/termalhud_oneglass.rsi/meta.json index b05d97aa01..de94ef13eb 100644 --- a/Resources/Textures/Stories/Clothing/Eyes/Glasses/termalhud_oneglass.rsi/meta.json +++ b/Resources/Textures/Stories/Clothing/Eyes/Glasses/termalhud_oneglass.rsi/meta.json @@ -1,26 +1,26 @@ { - "version": 1, - "license": "Собственная лицензия. Копирование, модификация и использование вне проекта Space Stories полностью запрещено без предварительного согласия текущего владельца проекта", - "copyright": "Created By RustedTim(discord:helloo4771) for SpaceStories(Server SS14).", - "size": { - "x": 32, - "y": 32 - }, - "states": [ - { - "name": "equipped-EYES", - "directions": 4 + "version": 1, + "license": "Any distribution, modification or use outside of SpaceStories without the agreement of SpaceStories owner is strictly prohibited.", + "copyright": "Created By RustedTim(discord:helloo4771) for SpaceStories(Server SS14).", + "size": { + "x": 32, + "y": 32 }, - { - "name": "icon" - }, - { - "name": "inhand-left", - "directions": 4 - }, - { - "name": "inhand-right", - "directions": 4 - } - ] -} \ No newline at end of file + "states": [ + { + "name": "equipped-EYES", + "directions": 4 + }, + { + "name": "icon" + }, + { + "name": "inhand-left", + "directions": 4 + }, + { + "name": "inhand-right", + "directions": 4 + } + ] +} From e222c48b5d9f7691c3359d983c6132c5bea9d105 Mon Sep 17 00:00:00 2001 From: pheenty Date: Sat, 2 Nov 2024 01:58:53 +0700 Subject: [PATCH 09/10] change licensing --- Resources/Textures/Stories/Actions/thermalVision.rsi/meta.json | 2 +- .../Stories/Clothing/Eyes/Glasses/termalhud.rsi/meta.json | 2 +- .../Clothing/Eyes/Glasses/termalhud_oneglass.rsi/meta.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Resources/Textures/Stories/Actions/thermalVision.rsi/meta.json b/Resources/Textures/Stories/Actions/thermalVision.rsi/meta.json index 8fbd87679e..bfdc4d157d 100644 --- a/Resources/Textures/Stories/Actions/thermalVision.rsi/meta.json +++ b/Resources/Textures/Stories/Actions/thermalVision.rsi/meta.json @@ -1,6 +1,6 @@ { "version": 1, - "license": "Any distribution, modification or use outside of SpaceStories without the SpaceStories owner's agreement is strictly prohibited.", + "license": "CC-BY-NC-SA-3.0", "copyright": "Created By RustedTim(discord:helloo4771) for SpaceStories(Server SS14).", "size": { "x": 32, diff --git a/Resources/Textures/Stories/Clothing/Eyes/Glasses/termalhud.rsi/meta.json b/Resources/Textures/Stories/Clothing/Eyes/Glasses/termalhud.rsi/meta.json index de94ef13eb..6d79471170 100644 --- a/Resources/Textures/Stories/Clothing/Eyes/Glasses/termalhud.rsi/meta.json +++ b/Resources/Textures/Stories/Clothing/Eyes/Glasses/termalhud.rsi/meta.json @@ -1,6 +1,6 @@ { "version": 1, - "license": "Any distribution, modification or use outside of SpaceStories without the agreement of SpaceStories owner is strictly prohibited.", + "license": "CC-BY-NC-SA-3.0", "copyright": "Created By RustedTim(discord:helloo4771) for SpaceStories(Server SS14).", "size": { "x": 32, diff --git a/Resources/Textures/Stories/Clothing/Eyes/Glasses/termalhud_oneglass.rsi/meta.json b/Resources/Textures/Stories/Clothing/Eyes/Glasses/termalhud_oneglass.rsi/meta.json index de94ef13eb..6d79471170 100644 --- a/Resources/Textures/Stories/Clothing/Eyes/Glasses/termalhud_oneglass.rsi/meta.json +++ b/Resources/Textures/Stories/Clothing/Eyes/Glasses/termalhud_oneglass.rsi/meta.json @@ -1,6 +1,6 @@ { "version": 1, - "license": "Any distribution, modification or use outside of SpaceStories without the agreement of SpaceStories owner is strictly prohibited.", + "license": "CC-BY-NC-SA-3.0", "copyright": "Created By RustedTim(discord:helloo4771) for SpaceStories(Server SS14).", "size": { "x": 32, From fea974dbfdd8d146c1726c8bc6b2f4e7af17a1f9 Mon Sep 17 00:00:00 2001 From: pheenty Date: Sat, 2 Nov 2024 03:21:24 +0700 Subject: [PATCH 10/10] unhardcode --- Content.Server/Stories/ThermalVision/ThermalVisionSystem.cs | 5 ++--- .../Stories/ThermalVision/ThermalVisionComponent.cs | 2 ++ .../Prototypes/Stories/Entities/Mobs/Ghosts/ascendance.yml | 1 + .../Prototypes/Stories/Entities/Mobs/Ghosts/shadowling.yml | 1 + .../Prototypes/Stories/Entities/Mobs/Species/shadowling.yml | 1 + Resources/Prototypes/Stories/conversions.yml | 1 + 6 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Content.Server/Stories/ThermalVision/ThermalVisionSystem.cs b/Content.Server/Stories/ThermalVision/ThermalVisionSystem.cs index 3d66a3e62f..3c1227828a 100644 --- a/Content.Server/Stories/ThermalVision/ThermalVisionSystem.cs +++ b/Content.Server/Stories/ThermalVision/ThermalVisionSystem.cs @@ -1,7 +1,6 @@ using Content.Shared.Actions; using Content.Shared.GameTicking; using Content.Shared.Inventory.Events; -using Content.Shared.Stories.Shadowling; using Content.Shared.Stories.ThermalVision; using Robust.Shared.Player; using Robust.Shared.Timing; @@ -23,7 +22,7 @@ public override void Initialize() } private void OnUnequipped(EntityUid uid, ThermalVisionClothingComponent component, GotUnequippedEvent args) { - if (args.Slot == "eyes" && !HasComp(args.Equipee)) + if (args.Slot == "eyes" && !(TryComp(args.Equipee, out var comp) && comp.Innate)) RemCompDeferred(args.Equipee); } private void OnEquipped(EntityUid uid, ThermalVisionClothingComponent component, GotEquippedEvent args) @@ -31,7 +30,7 @@ private void OnEquipped(EntityUid uid, ThermalVisionClothingComponent component, if (_gameTiming.ApplyingState) return; - if (component.Enabled && !HasComp(args.Equipee) && (args.Slot == "eyes")) + if (args.Slot == "eyes" && component.Enabled && !HasComp(args.Equipee)) AddComp(args.Equipee); } private void OnStartUp(EntityUid uid, ThermalVisionComponent component, ComponentStartup args) diff --git a/Content.Shared/Stories/ThermalVision/ThermalVisionComponent.cs b/Content.Shared/Stories/ThermalVision/ThermalVisionComponent.cs index 300e005826..a9baf5800b 100644 --- a/Content.Shared/Stories/ThermalVision/ThermalVisionComponent.cs +++ b/Content.Shared/Stories/ThermalVision/ThermalVisionComponent.cs @@ -8,6 +8,8 @@ public sealed partial class ThermalVisionComponent : Component { [ViewVariables(VVAccess.ReadWrite), DataField("enabled"), AutoNetworkedField] public bool Enabled { get; set; } = false; + [ViewVariables(VVAccess.ReadWrite), DataField("innate"), AutoNetworkedField] + public bool Innate { get; set; } = false; [DataField] public string ToggleAction = "ToggleThermalVisionAction"; [DataField, AutoNetworkedField] diff --git a/Resources/Prototypes/Stories/Entities/Mobs/Ghosts/ascendance.yml b/Resources/Prototypes/Stories/Entities/Mobs/Ghosts/ascendance.yml index 79ac9977eb..27b8fe98a3 100644 --- a/Resources/Prototypes/Stories/Entities/Mobs/Ghosts/ascendance.yml +++ b/Resources/Prototypes/Stories/Entities/Mobs/Ghosts/ascendance.yml @@ -8,6 +8,7 @@ components: - type: ZombieImmune - type: ThermalVision + innate: true - type: MobState allowedStates: - Alive diff --git a/Resources/Prototypes/Stories/Entities/Mobs/Ghosts/shadowling.yml b/Resources/Prototypes/Stories/Entities/Mobs/Ghosts/shadowling.yml index 0a3f45e168..d952b9c7f0 100644 --- a/Resources/Prototypes/Stories/Entities/Mobs/Ghosts/shadowling.yml +++ b/Resources/Prototypes/Stories/Entities/Mobs/Ghosts/shadowling.yml @@ -8,6 +8,7 @@ components: - type: ZombieImmune - type: ThermalVision + innate: true - type: MobState allowedStates: - Alive diff --git a/Resources/Prototypes/Stories/Entities/Mobs/Species/shadowling.yml b/Resources/Prototypes/Stories/Entities/Mobs/Species/shadowling.yml index d1ba65428c..beec58ac78 100644 --- a/Resources/Prototypes/Stories/Entities/Mobs/Species/shadowling.yml +++ b/Resources/Prototypes/Stories/Entities/Mobs/Species/shadowling.yml @@ -11,6 +11,7 @@ components: - type: ZombieImmune - type: ThermalVision + innate: true - type: ComplexInteraction - type: Destructible thresholds: diff --git a/Resources/Prototypes/Stories/conversions.yml b/Resources/Prototypes/Stories/conversions.yml index 6df5c04773..df382a8d8f 100644 --- a/Resources/Prototypes/Stories/conversions.yml +++ b/Resources/Prototypes/Stories/conversions.yml @@ -12,6 +12,7 @@ color: Red components: - type: ThermalVision + innate: true - type: ShadowlingThrall mindRoles: - MindRoleShadowlingThrall