Merge pull request #5542 from VOREStation/upstream-merge-6328

[MIRROR] Makes Heavy-Duty Cell Chargers Constructable
This commit is contained in:
Novacat
2019-07-31 02:10:06 -04:00
committed by GitHub
8 changed files with 146 additions and 63 deletions
@@ -144,6 +144,14 @@
build_path = /obj/machinery/recharger/wallcharger
board_type = new /datum/frame/frame_types/wall_charger
/obj/item/weapon/circuitboard/cell_charger
name = T_BOARD("heavy-duty cell charger")
build_path = /obj/machinery/cell_charger
board_type = new /datum/frame/frame_types/cell_charger
req_components = list(
/obj/item/weapon/stock_parts/capacitor = 1,
/obj/item/stack/cable_coil = 5)
/obj/item/weapon/circuitboard/washing
name = T_BOARD("washing machine")
build_path = /obj/machinery/washing_machine
+10 -20
View File
@@ -18,6 +18,7 @@
var/status = 0 //whether the thing is on or not
var/obj/item/weapon/cell/bcell = null
var/hitcost = 240
var/use_external_power = FALSE //only used to determine if it's a cyborg baton
/obj/item/weapon/melee/baton/New()
..()
@@ -108,6 +109,8 @@
user <<"<span class='warning'>The baton does not have a power source installed.</span>"
/obj/item/weapon/melee/baton/attackby(obj/item/weapon/W, mob/user)
if(use_external_power)
return
if(istype(W, /obj/item/weapon/cell))
if(istype(W, /obj/item/weapon/cell/device))
if(!bcell)
@@ -136,6 +139,11 @@
return ..()
/obj/item/weapon/melee/baton/attack_self(mob/user)
if(use_external_power)
//try to find our power cell
var/mob/living/silicon/robot/R = loc
if (istype(R))
bcell = R.cell
if(bcell && bcell.charge > hitcost)
status = !status
user << "<span class='notice'>[src] is now [status ? "on" : "off"].</span>"
@@ -204,16 +212,7 @@
//secborg stun baton module
/obj/item/weapon/melee/baton/robot
hitcost = 500
/obj/item/weapon/melee/baton/robot/attack_self(mob/user)
//try to find our power cell
var/mob/living/silicon/robot/R = loc
if (istype(R))
bcell = R.cell
return ..()
/obj/item/weapon/melee/baton/robot/attackby(obj/item/weapon/W, mob/user)
return
use_external_power = TRUE
//Makeshift stun baton. Replacement for stun gloves.
/obj/item/weapon/melee/baton/cattleprod
@@ -274,13 +273,4 @@
// Borg version, for the lost module.
/obj/item/weapon/melee/baton/shocker/robot
/obj/item/weapon/melee/baton/shocker/robot/attack_self(mob/user)
//try to find our power cell
var/mob/living/silicon/robot/R = loc
if (istype(R))
bcell = R.cell
return ..()
/obj/item/weapon/melee/baton/shocker/robot/attackby(obj/item/weapon/W, mob/user)
return
use_external_power = TRUE