constructable rechargers (#16367)

This commit is contained in:
Segonist
2023-05-31 15:48:55 +02:00
committed by GitHub
parent a96dfcb68c
commit 863d8e8601
7 changed files with 169 additions and 5 deletions

View File

@@ -1 +1,2 @@
charger-examine = Charges [color={$color}]{$chargeRate}W[/color] per second.
charger-examine = Charges [color={$color}]{$chargeRate}W[/color] per second.
charger-component-charge-rate = Charge rate

View File

@@ -450,6 +450,38 @@
requirements:
Capacitor: 5
- type: entity
id: CellRechargerCircuitboard
parent: BaseMachineCircuitboard
name: cell recharger machine board
description: A machine printed circuit board for a cell recharger.
components:
- type: Sprite
sprite: Objects/Misc/module.rsi
state: charger_APC
- type: MachineBoard
prototype: PowerCellRecharger
requirements:
Capacitor: 2
materialRequirements:
Cable: 5
- type: entity
id: WeaponCapacitorRechargerCircuitboard
parent: BaseMachineCircuitboard
name: recharger machine board
description: A machine printed circuit board for a recharger.
components:
- type: Sprite
sprite: Objects/Misc/module.rsi
state: charger_APC
- type: MachineBoard
prototype: WeaponCapacitorRecharger
requirements:
Capacitor: 2
materialRequirements:
CableMV: 5
- type: entity
id: SubstationMachineCircuitboard
parent: BaseMachineCircuitboard

View File

@@ -109,6 +109,8 @@
- APCElectronics
- SMESMachineCircuitboard
- SubstationMachineCircuitboard
- CellRechargerCircuitboard
- WeaponCapacitorRechargerCircuitboard
- type: StaticPrice
price: 800

View File

@@ -1,13 +1,13 @@
- type: entity
name: cell recharger
id: PowerCellRecharger
parent: ConstructibleMachine
placement:
mode: SnapgridCenter
components:
- type: Transform
anchored: true
- type: Sprite
netsync: false
sprite: Structures/Power/cell_recharger.rsi
drawdepth: SmallObjects
snapCardinals: true
@@ -21,6 +21,8 @@
slotId: charger_slot
- type: ApcPowerReceiver
- type: ExtensionCableReceiver
- type: Machine
board: CellRechargerCircuitboard
- type: Appearance
- type: PowerChargerVisuals
- type: Anchorable
@@ -70,6 +72,8 @@
- type: ContainerContainer
containers:
charger_slot: !type:ContainerSlot
machine_board: !type:Container
machine_parts: !type:Container
- type: entity
name: recharger
@@ -78,6 +82,8 @@
components:
- type: Sprite
sprite: Structures/Power/recharger.rsi
- type: Machine
board: WeaponCapacitorRechargerCircuitboard
- type: Charger
slotId: charger_slot
- type: ItemSlots
@@ -93,10 +99,77 @@
- type: entity
name: wall recharger
id: WallWeaponCapacitorRecharger
parent: WeaponCapacitorRecharger
placement:
mode: SnapgridCenter
components:
- type: Sprite
sprite: Structures/Power/wall_recharger.rsi
drawdepth: SmallObjects
snapCardinals: true
layers:
- map: ["enum.PowerChargerVisualLayers.Base"]
state: "empty"
- map: ["enum.PowerChargerVisualLayers.Light"]
state: "light-off"
shader: "unshaded"
- 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:
ejectOnInteract: true
whitelist:
components:
- HitscanBatteryAmmoProvider
- ProjectileBatteryAmmoProvider
- Stunbaton
- type: ContainerContainer
containers:
charger_slot: !type:ContainerSlot
machine_board: !type:Container
machine_parts: !type:Container

View File

@@ -14,6 +14,22 @@
Steel: 50
Plastic: 300
- type: latheRecipe
id: CellRechargerCircuitboard
result: CellRechargerCircuitboard
completetime: 2
materials:
Steel: 50
Plastic: 50
- type: latheRecipe
id: WeaponCapacitorRechargerCircuitboard
result: WeaponCapacitorRechargerCircuitboard
completetime: 2
materials:
Steel: 50
Plastic: 50
- type: latheRecipe
id: DoorElectronics
result: DoorElectronics