Merge pull request #11544 from Arkatos1/recharger

Rechargers now show their contents and charge status on examine
This commit is contained in:
variableundefined
2019-07-08 20:18:36 +08:00
committed by GitHub
24 changed files with 94 additions and 15 deletions
@@ -64,7 +64,6 @@
item_state = "lgloves"
flags = NODROP
/obj/item/clothing/gloves/color/yellow/stun
name = "stun gloves"
desc = "Horrendous and awful. It smells like cancer. The fact it has wires attached to it is incidental."
@@ -72,6 +71,9 @@
var/stun_strength = 5
var/stun_cost = 2000
/obj/item/clothing/gloves/color/yellow/stun/get_cell()
return cell
/obj/item/clothing/gloves/color/yellow/stun/New()
..()
update_icon()
@@ -97,6 +97,9 @@
to_chat(usr, "The maintenance panel is [open ? "open" : "closed"].")
to_chat(usr, "Hardsuit systems are [offline ? "<font color='red'>offline</font>" : "<font color='green'>online</font>"].")
/obj/item/rig/get_cell()
return cell
/obj/item/rig/New()
..()
@@ -103,6 +103,9 @@ var/list/robot_verbs_default = list(
var/datum/action/item_action/toggle_research_scanner/scanner = null
var/list/module_actions = list()
/mob/living/silicon/robot/get_cell()
return cell
/mob/living/silicon/robot/New(loc,var/syndie = 0,var/unfinished = 0, var/alien = 0)
spark_system = new /datum/effect_system/spark_spread()
spark_system.set_up(5, 0, src)
@@ -50,6 +50,9 @@
var/currentBloodColor = "#A10808"
var/currentDNA = null
/mob/living/simple_animal/bot/mulebot/get_cell()
return cell
/mob/living/simple_animal/bot/mulebot/New()
..()
wires = new /datum/wires/mulebot(src)
@@ -26,6 +26,10 @@
return battery_module.battery.give(amount)
return 0
/obj/item/modular_computer/get_cell()
var/obj/item/computer_hardware/battery/battery_module = all_components[MC_CELL]
if(battery_module && battery_module.battery)
return battery_module.battery
// Used in following function to reduce copypaste
/obj/item/modular_computer/proc/power_failure()
@@ -8,6 +8,9 @@
var/obj/item/stock_parts/cell/battery = null
device_type = MC_CELL
/obj/item/computer_hardware/battery/get_cell()
return battery
/obj/item/computer_hardware/battery/New(loc, battery_type = null)
if(battery_type)
battery = new battery_type(src)
+3
View File
@@ -27,6 +27,9 @@ Contents:
var/obj/item/clothing/mask/gas/space_ninja/suitMask
var/mob/living/carbon/human/suitOccupant
/obj/item/clothing/suit/space/space_ninja/get_cell()
return suitCell
/obj/item/clothing/suit/space/space_ninja/proc/toggle_suit_lock(mob/living/carbon/human/user)
if(!suitActive)
if(!istype(user.wear_suit, /obj/item/clothing/suit/space/space_ninja))
+1 -3
View File
@@ -1,5 +1,3 @@
/obj/item/clothing/suit/space/space_ninja/attackby(obj/item/I, mob/U, params)
if(U==suitOccupant)//Safety, in case you try doing this without wearing the suit/being the person with the suit.
if(istype(I, /obj/item/stock_parts/cell))
@@ -21,4 +19,4 @@
else
to_chat(U, "<span class='danger'>Procedure interrupted. Protocol terminated.</span>")
return
..()
..()
+3
View File
@@ -135,6 +135,9 @@
usesound = 'sound/items/deconstruct.ogg'
toolspeed = 1
/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.
+3
View File
@@ -19,6 +19,9 @@
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/stock_parts/cell/get_cell()
return src
/obj/item/stock_parts/cell/New()
..()
START_PROCESSING(SSobj, src)
+3
View File
@@ -23,6 +23,9 @@
power_supply.use(round(power_supply.charge / severity))
update_icon()
/obj/item/gun/energy/get_cell()
return power_supply
/obj/item/gun/energy/New()
..()
if(cell_type)
@@ -22,6 +22,9 @@
var/obj/item/stock_parts/cell/cell = null // Used for firing superheated rods.
var/list/possible_tensions = list(XBOW_TENSION_20, XBOW_TENSION_40, XBOW_TENSION_60, XBOW_TENSION_80, XBOW_TENSION_FULL)
/obj/item/gun/throw/crossbow/get_cell()
return cell
/obj/item/gun/throw/crossbow/emp_act(severity)
if(cell && severity)
emp_act(severity)
@@ -24,6 +24,9 @@
var/hack_message = "You disable the safety safeguards, enabling the \"Mad Scientist\" mode."
var/unhack_message = "You re-enable the safety safeguards, enabling the \"NT Standard\" mode."
/obj/machinery/chem_dispenser/get_cell()
return cell
/obj/machinery/chem_dispenser/New()
..()
component_parts = list()
+2
View File
@@ -92,6 +92,8 @@
has_paint = 1
update_icons()
/obj/spacepod/get_cell()
return battery
/obj/spacepod/New()
. = ..()
+3 -1
View File
@@ -128,11 +128,13 @@
var/teleporting = 0
var/chargecost = 1000
/obj/item/rcs/get_cell()
return rcell
/obj/item/rcs/New()
..()
rcell = new(src)
/obj/item/rcs/examine(mob/user)
..(user)
to_chat(user, "There are [round(rcell.charge/chargecost)] charge\s left.")