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 5a6a2194a1b..8a9a8791afa 100644 Binary files a/Resources/Textures/Objects/Specific/Mech/mecha_equipment.rsi/mecha_analyzer.png and b/Resources/Textures/Objects/Specific/Mech/mecha_equipment.rsi/mecha_analyzer.png differ diff --git a/Resources/Textures/Objects/Specific/Mech/mecha_equipment.rsi/mecha_analyzer_anim.png b/Resources/Textures/Objects/Specific/Mech/mecha_equipment.rsi/mecha_analyzer_anim.png new file mode 100644 index 00000000000..b5259d844c1 Binary files /dev/null and b/Resources/Textures/Objects/Specific/Mech/mecha_equipment.rsi/mecha_analyzer_anim.png differ 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" },