Add power cell and weapon chargers (#430)

* Add power cell and weapon chargers

Functionality's similar to SS13. The cell charger won't show the discrete charging levels because effort to not make it spam appearance updates over the network.
There's some stuff I wasn't sure on:
1. Updating power? Particularly around fixing rounding
2. Duplicating the full and empty sprites as I couldn't figure out a way to not have AppearanceVisualizer throw if the state isn't found
3. I made a BaseCharger abstract class under the assumption that when a mech / borg charger is added it would also inherit from it.
4. GetText currently isn't localized

* Address PJB's feedback

Updated the BaseCharger
* Change nullref exception to invalidoperation
* If the user doesn't have hands it will just return instead
This commit is contained in:
metalgearsloth
2019-11-22 09:48:56 +11:00
committed by Pieter-Jan Briers
parent 94c00dda95
commit 58709d2d26
31 changed files with 975 additions and 0 deletions

View File

@@ -94,3 +94,95 @@
visuals:
- type: PowerCellVisualizer2D
prefix: s_hy
- type: entity
name: Cell Recharger
id: PowerCellRecharger
components:
- type: Sprite
netsync: false
sprite: Objects/Power/PowerCells/cell_recharger.rsi
drawdepth: Items
- type: PowerCellCharger
transfer_ratio: 0.10
transfer_efficiency: 0.85
- type: PowerDevice
priority: Low
- type: Icon
sprite: Objects/Power/PowerCells/cell_recharger.rsi
state: empty
- type: Appearance
visuals:
- type: PowerChargerVisualizer2D
- type: Wrenchable
- type: Physics
mass: 5
- type: Clickable
- type: Collidable
shapes:
- !type:PhysShapeAabb
bounds: "-0.25,-0.25,0.25,0.25"
mask: 19
layer: 16
IsScrapingFloor: true
- type: entity
name: Recharger
id: WeaponCapacitorRecharger
components:
- type: Sprite
netsync: false
sprite: Objects/Power/PowerCells/recharger.rsi
drawdepth: Items
- type: WeaponCapacitorCharger
transfer_ratio: 0.10
transfer_efficiency: 0.85
- type: PowerDevice
priority: Low
- type: Icon
sprite: Objects/Power/PowerCells/recharger.rsi
state: empty
- type: Appearance
visuals:
- type: PowerChargerVisualizer2D
- type: Wrenchable
- type: Physics
mass: 5
- type: Clickable
- type: Collidable
shapes:
- !type:PhysShapeAabb
bounds: "-0.25,-0.25,0.25,0.25"
mask: 19
layer: 16
IsScrapingFloor: true
- type: entity
name: Wall recharger
id: WallWeaponCapacitorRecharger
components:
- type: Sprite
netsync: false
sprite: Objects/Power/PowerCells/wall_recharger.rsi
drawdepth: Items
- type: WeaponCapacitorCharger
transfer_ratio: 0.15
transfer_efficiency: 0.95
- type: PowerDevice
priority: Low
- type: Icon
sprite: Objects/Power/PowerCells/wall_recharger.rsi
state: empty
- type: Appearance
visuals:
- type: PowerChargerVisualizer2D
- type: Physics
mass: 5
- type: Clickable
- type: Collidable
shapes:
- !type:PhysShapeAabb
bounds: "-0.25,-0.25,0.25,0.25"
mask: 19
layer: 16
IsScrapingFloor: true