up to upstream-merge-27868
This commit is contained in:
@@ -93,6 +93,10 @@
|
||||
var/update_overlay = -1
|
||||
var/icon_update_needed = FALSE
|
||||
|
||||
/obj/machinery/power/apc/get_cell()
|
||||
return cell
|
||||
|
||||
|
||||
/obj/machinery/power/apc/connect_to_network()
|
||||
//Override because the APC does not directly connect to the network; it goes through a terminal.
|
||||
//The terminal is what the power computer looks for anyway.
|
||||
@@ -622,14 +626,10 @@
|
||||
return
|
||||
if(usr == user && opened && (!issilicon(user)))
|
||||
if(cell)
|
||||
user.visible_message("[user] removes \the [cell] from [src]!","<span class='notice'>You remove \the [cell].</span>")
|
||||
user.put_in_hands(cell)
|
||||
cell.add_fingerprint(user)
|
||||
cell.updateicon()
|
||||
|
||||
cell.update_icon()
|
||||
src.cell = null
|
||||
user.visible_message("[user.name] removes the power cell from [src.name]!",\
|
||||
"<span class='notice'>You remove the power cell.</span>")
|
||||
//to_chat(user, "You remove the power cell.")
|
||||
charging = 0
|
||||
src.update_icon()
|
||||
return
|
||||
|
||||
@@ -19,13 +19,16 @@
|
||||
var/ratingdesc = TRUE
|
||||
var/grown_battery = FALSE // If it's a grown that acts as a battery, add a wire overlay to it.
|
||||
|
||||
/obj/item/weapon/stock_parts/cell/get_cell()
|
||||
return src
|
||||
|
||||
/obj/item/weapon/stock_parts/cell/New()
|
||||
..()
|
||||
START_PROCESSING(SSobj, src)
|
||||
charge = maxcharge
|
||||
if(ratingdesc)
|
||||
desc += " This one has a power rating of [maxcharge], and you should not swallow it."
|
||||
updateicon()
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/stock_parts/cell/Destroy()
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
@@ -46,16 +49,16 @@
|
||||
else
|
||||
return PROCESS_KILL
|
||||
|
||||
/obj/item/weapon/stock_parts/cell/proc/updateicon()
|
||||
/obj/item/weapon/stock_parts/cell/update_icon()
|
||||
cut_overlays()
|
||||
if(grown_battery)
|
||||
add_overlay("grown_wires")
|
||||
add_overlay("grown_wires")
|
||||
if(charge < 0.01)
|
||||
return
|
||||
else if(charge/maxcharge >=0.995)
|
||||
add_overlay("cell-o2")
|
||||
add_overlay("cell-o2")
|
||||
else
|
||||
add_overlay("cell-o1")
|
||||
add_overlay("cell-o1")
|
||||
|
||||
/obj/item/weapon/stock_parts/cell/proc/percent() // return % charge of cell
|
||||
return 100*charge/maxcharge
|
||||
@@ -69,7 +72,7 @@
|
||||
return 0
|
||||
charge = (charge - amount)
|
||||
if(!istype(loc, /obj/machinery/power/apc))
|
||||
SSblackbox.add_details("cell_used","[src.type]")
|
||||
SSblackbox.add_details("cell_used","[src.type]")
|
||||
return 1
|
||||
|
||||
// recharge the cell
|
||||
@@ -123,7 +126,7 @@
|
||||
corrupt()
|
||||
return
|
||||
//explosion(T, 0, 1, 2, 2)
|
||||
explosion(T, devastation_range, heavy_impact_range, light_impact_range, flash_range)
|
||||
explosion(T, devastation_range, heavy_impact_range, light_impact_range, flash_range)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/weapon/stock_parts/cell/proc/corrupt()
|
||||
|
||||
Reference in New Issue
Block a user