mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 03:57:13 +01:00
@@ -90,7 +90,6 @@
|
||||
var/update_overlay = -1
|
||||
var/global/status_overlays = 0
|
||||
var/updating_icon = 0
|
||||
var/standard_max_charge
|
||||
var/datum/wires/apc/wires = null
|
||||
//var/debug = 0
|
||||
var/global/list/status_overlays_lock
|
||||
@@ -142,9 +141,6 @@
|
||||
apcs += src
|
||||
apcs = sortAtom(apcs)
|
||||
wires = new(src)
|
||||
var/tmp/obj/item/weapon/stock_parts/cell/tmp_cell = new
|
||||
standard_max_charge = tmp_cell.maxcharge
|
||||
qdel(tmp_cell)
|
||||
|
||||
// offset 24 pixels in direction of dir
|
||||
// this allows the APC to be embedded in a wall, yet still inside an area
|
||||
@@ -198,7 +194,7 @@
|
||||
if(cell_type)
|
||||
src.cell = new/obj/item/weapon/stock_parts/cell(src)
|
||||
cell.maxcharge = cell_type // cell_type is maximum charge (old default was 1000 or 2500 (values one and two respectively)
|
||||
cell.charge = start_charge * cell.maxcharge / 100.0 // (convert percentage to actual value)
|
||||
cell.charge = start_charge * cell.maxcharge / 100 // (convert percentage to actual value)
|
||||
|
||||
var/area/A = get_area(src)
|
||||
|
||||
|
||||
@@ -5,24 +5,25 @@
|
||||
return 100.0*charge/maxcharge
|
||||
|
||||
// use power from a cell
|
||||
/obj/item/weapon/stock_parts/cell/proc/use(var/amount)
|
||||
/obj/item/weapon/stock_parts/cell/proc/use(amount)
|
||||
if(rigged && amount > 0)
|
||||
explode()
|
||||
return 0
|
||||
|
||||
if(charge < amount) return 0
|
||||
if(charge < amount)
|
||||
return 0
|
||||
charge = (charge - amount)
|
||||
return 1
|
||||
|
||||
// recharge the cell
|
||||
/obj/item/weapon/stock_parts/cell/proc/give(var/amount)
|
||||
/obj/item/weapon/stock_parts/cell/proc/give(amount)
|
||||
if(rigged && amount > 0)
|
||||
explode()
|
||||
return 0
|
||||
|
||||
if(maxcharge < amount) return 0
|
||||
if(maxcharge < amount)
|
||||
return 0
|
||||
var/power_used = min(maxcharge-charge,amount)
|
||||
if(crit_fail) return 0
|
||||
if(crit_fail)
|
||||
return 0
|
||||
if(!prob(reliability))
|
||||
minor_fault++
|
||||
if(prob(minor_fault))
|
||||
@@ -31,7 +32,6 @@
|
||||
charge += power_used
|
||||
return power_used
|
||||
|
||||
|
||||
/obj/item/weapon/stock_parts/cell/examine(mob/user)
|
||||
if(..(user, 1))
|
||||
if(maxcharge <= 2500)
|
||||
|
||||
Reference in New Issue
Block a user