Files
CHOMPStation2/code/modules/assembly/shock_kit.dm
Neerti 828dacf485 Centralizes weight class definitions
A lot of new defines are now in inventory_sizes.dm, which contains;
All the size identifiers (the thing that tells the game if something is bulky, or w/e).
Storage costs for all the sizes, which are exponents of two, as previously.
A few constants for inventory size.

Also changes all storage item's capacity definitions by basing it off of how many 'normal slots' exist for it.  This allows one to change the definition for all of the defines in the file, and everything will follow along without needing to change 500 files.  In testing, I made all ITEMSIZE_COST_* defines doubled, and nothing had broke.

The benefit of doing all of this is that it makes adding new weight classes in the future much simpler, and makes knowing how much space a container has easier, as seeing ITEMSIZE_COST_NORMAL * 7 means it can hold seven normal items.
2016-09-22 00:51:51 -04:00

47 lines
1.2 KiB
Plaintext

/obj/item/assembly/shock_kit
name = "electrohelmet assembly"
desc = "This appears to be made from both an electropack and a helmet."
icon_state = "shock_kit"
var/obj/item/clothing/head/helmet/part1 = null
var/obj/item/device/radio/electropack/part2 = null
var/status = 0
w_class = ITEMSIZE_HUGE
flags = CONDUCT
/obj/item/assembly/shock_kit/Destroy()
qdel(part1)
qdel(part2)
..()
return
/obj/item/assembly/shock_kit/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/wrench) && !status)
var/turf/T = loc
if(ismob(T))
T = T.loc
part1.loc = T
part2.loc = T
part1.master = null
part2.master = null
part1 = null
part2 = null
qdel(src)
return
if(istype(W, /obj/item/weapon/screwdriver))
status = !status
user << "<span class='notice'>[src] is now [status ? "secured" : "unsecured"]!</span>"
add_fingerprint(user)
return
/obj/item/assembly/shock_kit/attack_self(mob/user as mob)
part1.attack_self(user, status)
part2.attack_self(user, status)
add_fingerprint(user)
return
/obj/item/assembly/shock_kit/receive_signal()
if(istype(loc, /obj/structure/bed/chair/e_chair))
var/obj/structure/bed/chair/e_chair/C = loc
C.shock()
return