From 201e39b42ea3ee8cf200f4487cbdf4c9e3929164 Mon Sep 17 00:00:00 2001 From: deltanedas <39013340+deltanedas@users.noreply.github.com> Date: Wed, 11 Oct 2023 10:22:09 +0100 Subject: [PATCH] show battery charge when recharger is examined (#20098) Co-authored-by: deltanedas <@deltanedas:kde.org> --- .../Entities/Structures/Power/chargers.yml | 197 ++++++------------ 1 file changed, 64 insertions(+), 133 deletions(-) diff --git a/Resources/Prototypes/Entities/Structures/Power/chargers.yml b/Resources/Prototypes/Entities/Structures/Power/chargers.yml index 520b293cb5..e5edc63df3 100644 --- a/Resources/Prototypes/Entities/Structures/Power/chargers.yml +++ b/Resources/Prototypes/Entities/Structures/Power/chargers.yml @@ -1,57 +1,54 @@ - type: entity - name: cell recharger - id: PowerCellRecharger - parent: ConstructibleMachine + abstract: true + parent: [BaseMachinePowered, ConstructibleMachine] + id: BaseRecharger placement: mode: SnapgridCenter components: - type: Transform anchored: true + noRot: false - type: Sprite - sprite: Structures/Power/cell_recharger.rsi - drawdepth: SmallObjects snapCardinals: true + - type: Appearance + - type: Charger + slotId: charger_slot + - type: Anchorable + delay: 1 + - type: Destructible + thresholds: + - trigger: + !type:DamageTrigger + damage: 80 + behaviors: + - !type:DoActsBehavior + acts: ["Destruction"] + - trigger: + !type:DamageTrigger + damage: 40 + behaviors: + - !type:EmptyAllContainersBehaviour + - !type:DoActsBehavior + acts: ["Destruction"] + - !type:PlaySoundBehavior + sound: + path: /Audio/Effects/metalbreak.ogg + - type: StaticPrice + price: 25 + +- type: entity + abstract: true + parent: BaseRecharger + id: BaseItemRecharger + components: + - type: Sprite + drawdepth: SmallObjects layers: - map: ["enum.PowerChargerVisualLayers.Base"] state: "empty" - map: ["enum.PowerChargerVisualLayers.Light"] state: "light-off" shader: "unshaded" - - type: Charger - slotId: charger_slot - - type: ApcPowerReceiver - - type: ExtensionCableReceiver - - type: Machine - board: CellRechargerCircuitboard - - type: Appearance - - type: PowerChargerVisuals - - type: Anchorable - - type: Pullable - - type: Clickable - - type: InteractionOutline - - type: Damageable - damageContainer: Inorganic - damageModifierSet: Metallic - - type: Destructible - thresholds: - - trigger: - !type:DamageTrigger - damage: 80 - behaviors: - - !type:DoActsBehavior - acts: [ "Destruction" ] - - trigger: - !type:DamageTrigger - damage: 40 - behaviors: - - !type:EmptyAllContainersBehaviour - - !type:DoActsBehavior - acts: [ "Destruction" ] - - !type:PlaySoundBehavior - sound: - path: /Audio/Effects/metalbreak.ogg - - type: Physics - bodyType: Static - type: Fixtures fixtures: fix1: @@ -60,7 +57,26 @@ bounds: "-0.10,-0.10,0.10,0.10" density: 500 mask: - - TabletopMachineMask + - TabletopMachineMask + - type: PowerChargerVisuals + - type: ContainerContainer + containers: + charger_slot: !type:ContainerSlot + machine_board: !type:Container + machine_parts: !type:Container + +- type: entity + parent: BaseItemRecharger + id: PowerCellRecharger + name: cell recharger + components: + - type: Sprite + sprite: Structures/Power/cell_recharger.rsi + - type: Machine + board: CellRechargerCircuitboard + - type: PowerCellSlot + cellSlotId: charger_slot + # fitsInCharger is true i dont think this will ever affect anything negatively but it lets it function - type: ItemSlots slots: charger_slot: @@ -68,26 +84,18 @@ name: Power cell whitelist: components: - - PowerCell - - type: ContainerContainer - containers: - charger_slot: !type:ContainerSlot - machine_board: !type:Container - machine_parts: !type:Container - - type: StaticPrice - price: 15 + - PowerCell - type: entity - name: recharger + parent: BaseItemRecharger id: WeaponCapacitorRecharger - parent: PowerCellRecharger + name: recharger components: - type: Sprite sprite: Structures/Power/recharger.rsi - type: Machine board: WeaponCapacitorRechargerCircuitboard - - type: Charger - slotId: charger_slot + # no powercellslot since stun baton etc arent powercells - type: ItemSlots slots: charger_slot: @@ -97,19 +105,14 @@ - HitscanBatteryAmmoProvider - ProjectileBatteryAmmoProvider - Stunbaton - - type: StaticPrice - price: 15 - type: entity - name: wall recharger + parent: BaseItemRecharger id: WallWeaponCapacitorRecharger - placement: - mode: SnapgridCenter + name: wall recharger components: - type: Sprite sprite: Structures/Power/wall_recharger.rsi - drawdepth: SmallObjects - snapCardinals: true layers: - map: ["enum.PowerChargerVisualLayers.Base"] state: "empty" @@ -119,49 +122,6 @@ - type: WallMount - type: Charger chargeRate: 25 - slotId: charger_slot - - type: Transform - anchored: true - - type: ApcPowerReceiver - - type: ExtensionCableReceiver - - type: Appearance - - type: PowerChargerVisuals - - type: Anchorable - - type: Pullable - - type: Clickable - - type: InteractionOutline - - type: Damageable - damageContainer: Inorganic - damageModifierSet: Metallic - - type: Destructible - thresholds: - - trigger: - !type:DamageTrigger - damage: 80 - behaviors: - - !type:DoActsBehavior - acts: [ "Destruction" ] - - trigger: - !type:DamageTrigger - damage: 40 - behaviors: - - !type:EmptyAllContainersBehaviour - - !type:DoActsBehavior - acts: [ "Destruction" ] - - !type:PlaySoundBehavior - sound: - path: /Audio/Effects/metalbreak.ogg - - type: Physics - bodyType: Static - - type: Fixtures - fixtures: - fix1: - shape: - !type:PhysShapeAabb - bounds: "-0.10,-0.10,0.10,0.10" - density: 500 - mask: - - TabletopMachineMask - type: ItemSlots slots: charger_slot: @@ -171,23 +131,15 @@ - HitscanBatteryAmmoProvider - ProjectileBatteryAmmoProvider - Stunbaton - - type: ContainerContainer - containers: - charger_slot: !type:ContainerSlot - machine_board: !type:Container - machine_parts: !type:Container - type: entity + parent: BaseRecharger id: BorgCharger - parent: [ BaseMachinePowered, ConstructibleMachine ] name: cyborg recharging station description: A stationary charger for various robotic and cyborg entities. Surprisingly spacious. - placement: - mode: SnapgridCenter components: - type: Sprite sprite: Structures/Power/borg_charger.rsi - snapCardinals: true layers: - state: borgcharger-u1 map: ["base"] @@ -218,7 +170,6 @@ - type: WiresVisuals - type: Machine board: BorgChargerCircuitboard - - type: Appearance - type: GenericVisualizer visuals: enum.StorageVisuals.Open: @@ -248,24 +199,6 @@ Charged: visible: true state: borgcharger1 - - type: Destructible - thresholds: - - trigger: - !type:DamageTrigger - damage: 80 - behaviors: - - !type:DoActsBehavior - acts: [ "Destruction" ] - - trigger: - !type:DamageTrigger - damage: 40 - behaviors: - - !type:EmptyAllContainersBehaviour - - !type:DoActsBehavior - acts: [ "Destruction" ] - - !type:PlaySoundBehavior - sound: - path: /Audio/Effects/metalbreak.ogg - type: EntityStorage capacity: 1 whitelist: @@ -276,5 +209,3 @@ entity_storage: !type:Container machine_board: !type:Container machine_parts: !type:Container - - type: StaticPrice - price: 15 -- 2.51.2