From 70306caf03f65f88021fe6440d57b3704ed1054a Mon Sep 17 00:00:00 2001 From: Rinary Date: Fri, 18 Oct 2024 13:11:44 +0300 Subject: [PATCH] full rework mechs on mobstates, coils fix mechs, diagnostic hud show health bar for mechs, mechs fastest repair, add mech analyzer --- Content.Server/Mech/Systems/MechSystem.cs | 5 +- .../Mech/EntitySystems/SharedMechSystem.cs | 15 +++- .../entities/objects/devices/handheld.ftl | 11 +++ .../Prototypes/Entities/Clothing/Eyes/hud.yml | 1 + .../Entities/Objects/Specific/Mech/mechs.yml | 24 +++++- .../Entities/Objects/Tools/cable_coils.yml | 3 +- .../Prototypes/_Sunrise/Damage/containers.yml | 9 +++ .../Entities/Objects/Devices/handheld.yml | 76 ++++++++++++++++++ .../mecha_equipment.rsi/mecha_analyzer.png | Bin 530 -> 482 bytes .../mecha_analyzer_anim.png | Bin 0 -> 725 bytes .../Mech/mecha_equipment.rsi/meta.json | 19 +++++ 11 files changed, 153 insertions(+), 10 deletions(-) create mode 100644 Resources/Textures/Objects/Specific/Mech/mecha_equipment.rsi/mecha_analyzer_anim.png diff --git a/Content.Server/Mech/Systems/MechSystem.cs b/Content.Server/Mech/Systems/MechSystem.cs index 2363c19751a..485f5297ec8 100644 --- a/Content.Server/Mech/Systems/MechSystem.cs +++ b/Content.Server/Mech/Systems/MechSystem.cs @@ -62,7 +62,7 @@ public override void Initialize() SubscribeLocalEvent(OnMechEntry); SubscribeLocalEvent(OnMechExit); - SubscribeLocalEvent(OnDamageChanged); + //SubscribeLocalEvent(OnDamageChanged); SubscribeLocalEvent(OnRemoveEquipmentMessage); SubscribeLocalEvent(OnMechCanMoveEvent); @@ -265,7 +265,7 @@ private void OnMechExit(EntityUid uid, MechComponent component, MechExitEvent ar args.Handled = true; } - private void OnDamageChanged(EntityUid uid, MechComponent component, DamageChangedEvent args) +/* private void OnDamageChanged(EntityUid uid, MechComponent component, DamageChangedEvent args) { var integrity = component.MaxIntegrity - args.Damageable.TotalDamage; SetIntegrity(uid, integrity, component); @@ -278,6 +278,7 @@ private void OnDamageChanged(EntityUid uid, MechComponent component, DamageChang _damageable.TryChangeDamage(component.PilotSlot.ContainedEntity, damage); } } +*/ private void ToggleMechUi(EntityUid uid, MechComponent? component = null, EntityUid? user = null) { diff --git a/Content.Shared/Mech/EntitySystems/SharedMechSystem.cs b/Content.Shared/Mech/EntitySystems/SharedMechSystem.cs index a83f825843e..bfda5cb70da 100644 --- a/Content.Shared/Mech/EntitySystems/SharedMechSystem.cs +++ b/Content.Shared/Mech/EntitySystems/SharedMechSystem.cs @@ -4,6 +4,7 @@ using Content.Shared.Actions; using Content.Shared.Destructible; using Content.Shared.DoAfter; +using Content.Shared.Mobs; using Content.Shared.DragDrop; using Content.Shared.Emag.Components; using Content.Shared.Emag.Systems; @@ -50,7 +51,7 @@ public override void Initialize() SubscribeLocalEvent(OnEjectPilotEvent); SubscribeLocalEvent(RelayInteractionEvent); SubscribeLocalEvent(OnStartup); - SubscribeLocalEvent(OnDestruction); + SubscribeLocalEvent(OnMobState); SubscribeLocalEvent(OnGetAdditionalAccess); SubscribeLocalEvent(OnDragDrop); SubscribeLocalEvent(OnCanDragDrop); @@ -101,9 +102,17 @@ private void OnStartup(EntityUid uid, MechComponent component, ComponentStartup UpdateAppearance(uid, component); } - private void OnDestruction(EntityUid uid, MechComponent component, DestructionEventArgs args) + private void OnMobState(EntityUid uid, MechComponent component, MobStateChangedEvent args) { - BreakMech(uid, component); + if (args.NewMobState == MobState.Critical) + { + BreakMech(uid, component); + } + if (args.NewMobState == MobState.Alive) + { + component.Broken = false; + UpdateAppearance(uid, component); + } } private void OnGetAdditionalAccess(EntityUid uid, MechComponent component, ref GetAdditionalAccessEvent args) diff --git a/Resources/Locale/ru-RU/_prototypes/_sunrise/entities/objects/devices/handheld.ftl b/Resources/Locale/ru-RU/_prototypes/_sunrise/entities/objects/devices/handheld.ftl index cb8b44ee552..19465b93f48 100644 --- a/Resources/Locale/ru-RU/_prototypes/_sunrise/entities/objects/devices/handheld.ftl +++ b/Resources/Locale/ru-RU/_prototypes/_sunrise/entities/objects/devices/handheld.ftl @@ -31,6 +31,17 @@ ent-HandheldRoboAnalyzerEmpty = { ent-HandheldRoboAnalyzer } ent-HandheldRoboAnalyzerUnpowered = { ent-BaseHandheldRoboAnalyzer } .desc = { ent-BaseHandheldRoboAnalyzer.desc } .suffix = Переносной, Не требует энергии +ent-BaseHandheldMechAnalyzer = анализатор механоидов + .desc = Портативный анализатор механоидов. +ent-HandheldMechAnalyzer = { ent-BaseHandheldMechAnalyzer } + .desc = { ent-BaseHandheldMechAnalyzer.desc } + .suffix = Переносной, Требует энергию +ent-HandheldMechAnalyzerEmpty = { ent-HandheldMechAnalyzer } + .desc = { ent-HandheldMechAnalyzer.desc } + .suffix = Переносной, Пустой +ent-HandheldMechAnalyzerUnpowered = { ent-BaseHandheldMechAnalyzer } + .desc = { ent-BaseHandheldMechAnalyzer.desc } + .suffix = Переносной, Не требует энергии ent-BaseHandheldCamera = бодикамера .desc = Оно наблюдает за вами... И пикает.. ent-HandheldCamera = { ent-BaseHandheldCamera } diff --git a/Resources/Prototypes/Entities/Clothing/Eyes/hud.yml b/Resources/Prototypes/Entities/Clothing/Eyes/hud.yml index 1ab35472843..19cbf94d297 100644 --- a/Resources/Prototypes/Entities/Clothing/Eyes/hud.yml +++ b/Resources/Prototypes/Entities/Clothing/Eyes/hud.yml @@ -33,6 +33,7 @@ damageContainers: - Inorganic - Silicon + - Mech # Sunrise-edit - type: entity parent: [ClothingEyesBase, ShowMedicalIcons] diff --git a/Resources/Prototypes/Entities/Objects/Specific/Mech/mechs.yml b/Resources/Prototypes/Entities/Objects/Specific/Mech/mechs.yml index 844534af7d0..bd8778c4e4b 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/Mech/mechs.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/Mech/mechs.yml @@ -77,7 +77,12 @@ - type: DoAfter - type: Repairable fuelCost: 25 - doAfterDelay: 10 + doAfterDelay: 3 + damage: + types: + Blunt: -15 + Slash: -15 + Piercing: -15 - type: UserInterface interfaces: enum.MechUiKey.Key: @@ -123,9 +128,20 @@ - Alive - Critical - type: MobThresholds + currentThresholdState : Alive thresholds: 0: Alive - 1000: Critical + 500: Critical + showOverlays: false + allowRevives: true + - type: HealthExaminable + examinableTypes: + - Blunt + - Slash + - Piercing + - Heat + - Shock + locPrefix: mech - type: Appearance - type: ContainerContainer containers: @@ -133,7 +149,7 @@ mech-equipment-container: !type:Container mech-battery-slot: !type:ContainerSlot - type: Damageable - damageContainer: Inorganic + damageContainer: Mech damageModifierSet: LightArmor - type: FootstepModifier footstepSoundCollection: @@ -145,7 +161,7 @@ thresholds: - trigger: !type:DamageTrigger - damage: 1000 + damage: 700 behaviors: - !type:PlaySoundBehavior sound: diff --git a/Resources/Prototypes/Entities/Objects/Tools/cable_coils.yml b/Resources/Prototypes/Entities/Objects/Tools/cable_coils.yml index 73eb2836713..160a78dc2be 100644 --- a/Resources/Prototypes/Entities/Objects/Tools/cable_coils.yml +++ b/Resources/Prototypes/Entities/Objects/Tools/cable_coils.yml @@ -199,8 +199,9 @@ - type: Healing delay: 1 damageContainers: - - Synth + - Synth #Sunrise-edit - Silicon + - Mech #Sunrise-edit damage: types: Heat: -5 diff --git a/Resources/Prototypes/_Sunrise/Damage/containers.yml b/Resources/Prototypes/_Sunrise/Damage/containers.yml index fa1e7988283..ec3ca0e8a61 100644 --- a/Resources/Prototypes/_Sunrise/Damage/containers.yml +++ b/Resources/Prototypes/_Sunrise/Damage/containers.yml @@ -6,3 +6,12 @@ - Heat - Shock - Caustic + +- type: damageContainer + id: Mech + supportedGroups: + - Brute + supportedTypes: + - Heat + - Shock + - Caustic diff --git a/Resources/Prototypes/_Sunrise/Entities/Objects/Devices/handheld.yml b/Resources/Prototypes/_Sunrise/Entities/Objects/Devices/handheld.yml index 280aa793346..e7cba2b381c 100644 --- a/Resources/Prototypes/_Sunrise/Entities/Objects/Devices/handheld.yml +++ b/Resources/Prototypes/_Sunrise/Entities/Objects/Devices/handheld.yml @@ -226,6 +226,82 @@ id: HandheldRoboAnalyzerUnpowered parent: BaseHandheldRoboAnalyzer suffix: Handheld, Unpowered + +# Handheld Mech Analyzer + +- type: entity + id: BaseHandheldMechAnalyzer + parent: BaseItem + name: mech analyzer + description: A hand-held mech scaner. + abstract: true + components: + - type: Sprite + sprite: Objects/Specific/Mech/mecha_equipment.rsi + state: icon + layers: + - state: mecha_analyzer + - state: mecha_analyzer_anim + shader: unshaded + visible: true + map: [ "enum.PowerDeviceVisualLayers.Powered" ] + - type: Item + storedRotation: -90 + - type: ActivatableUI + key: enum.HealthAnalyzerUiKey.Key + - type: UserInterface + interfaces: + enum.HealthAnalyzerUiKey.Key: + type: HealthAnalyzerBoundUserInterface + - type: HealthAnalyzer + scanningEndSound: + path: "/Audio/Items/Medical/healthscanner.ogg" + damageContainers: + - Mech + - type: Tag + tags: + - DiscreteHealthAnalyzer + - type: Appearance + - type: GenericVisualizer + visuals: + enum.PowerCellSlotVisuals.Enabled: + enum.PowerDeviceVisualLayers.Powered: + True: { visible: true } + False: { visible: false } + - type: GuideHelp + guides: + - Robotics + +- type: entity + id: HandheldMechAnalyzer + parent: + - BaseHandheldMechAnalyzer + - BaseHandheldComputer + suffix: HandHeld, Powered + +- type: entity + id: HandheldMechAnalyzerEmpty + parent: HandheldMechAnalyzer + suffix: HandHeld, Empty + components: + - type: Sprite + sprite: _Sunrise/Objects/Devices/roboanalyzer.rsi + state: icon + layers: + - state: icon + - state: analyzer + shader: unshaded + visible: false + map: [ "enum.PowerDeviceVisualLayers.Powered" ] + - type: ItemSlots + slots: + cell_slot: + name: power-cell-slot-component-slot-name-default + +- type: entity + id: HandheldMechAnalyzerUnpowered + parent: BaseHandheldMechAnalyzer + suffix: Handheld, Unpowered # Handheld Camera diff --git a/Resources/Textures/Objects/Specific/Mech/mecha_equipment.rsi/mecha_analyzer.png b/Resources/Textures/Objects/Specific/Mech/mecha_equipment.rsi/mecha_analyzer.png index 5a6a2194a1b578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pv6`9AdSUyU*ot)_o|@z?&&x4!-E%|FG{bzhkOe~dM@022z%I{@Z74+mw z+Rts@xD94@zu7-W_!jrYO?N$R_Qo+x{`vX*OyQf>5qGXV`o8wbmA-wuYW^?(ZTaQh z+_Dd+s9`vteM{P- z{;S<*MkWLKhMx>Kzs=+qPc3KfBtue}BG}WSsRk^KLB5>Mx7M9YXc^)i+cysufR6>)-dyX-kfIP+9eP s_8FEF_cH(e`>XE0mtQWr>lBjf8Si(U*!=N$gFVQ_p00i_>zopr07F4iZ2$lO literal 0 HcmV?d00001 diff --git a/Resources/Textures/Objects/Specific/Mech/mecha_equipment.rsi/meta.json b/Resources/Textures/Objects/Specific/Mech/mecha_equipment.rsi/meta.json index b2cc28b2ae4..2b9dc1cacbf 100644 --- a/Resources/Textures/Objects/Specific/Mech/mecha_equipment.rsi/meta.json +++ b/Resources/Textures/Objects/Specific/Mech/mecha_equipment.rsi/meta.json @@ -130,6 +130,25 @@ { "name": "mecha_analyzer" }, + { + "name": "mecha_analyzer_anim", + "delays": [ + [ + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.1, + 0.5 + ] + ] + }, { "name": "mecha_medigun" },