mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-20 20:45:28 +01:00
Use cell defined constants for various stuff (#82594)
## About The Pull Request This re writes most cell power usage cases with 2 defines `STANDARD_CELL_CHARGE`(Joules) & `STANDARD_CELL_RATE`(Watts) so changing cell capacity values in the future won't cause discrepancies. ## Changelog 🆑 code: most cell power usages are scaled with defined constants to help adapt to future changes /🆑
This commit is contained in:
@@ -82,6 +82,6 @@
|
||||
if(!parent?.cell)
|
||||
return
|
||||
var/obj/item/gun/energy/fired_gun = source
|
||||
var/totransfer = min(100 KILO JOULES, parent.cell.charge)
|
||||
var/transferred = fired_gun.cell.give(totransfer)
|
||||
parent.cell.use(transferred)
|
||||
var/transferred = fired_gun.cell.give(min(0.1 * STANDARD_CELL_CHARGE, parent.cell.charge))
|
||||
if(transferred)
|
||||
parent.cell.use(transferred, force = TRUE)
|
||||
|
||||
Reference in New Issue
Block a user