Files
kiwistation/code/game/objects/items/stacks/sheets/light.dm
T
Ashe Higgs d447acdc6e All-In-One grinder results are now defined by type, not by huge lists (#33181)
I had some time free, and noticed how awful the reagent grinder code was - it used huge static lists containing types and their associated reagents from grinding.

This is now split into two new vars on /obj/item - var/list/grind_results and var/list/juice_results, as well as two new helper procs, on_grind() and on_juice() to allow those to change based on conditions like plant potency. Such checks and the like have been moved to that. If any of these procs return -1, the operation is canceled.

I also fixed some of the recipes that didn't work. The reagent IDs for them didn't exist, leading me to believe that they weren't tested. I corrected that! (I've tested every single recipe in this PR, with the exception of a few juicing-related ones.)
2017-12-15 10:48:25 +13:00

39 lines
1.1 KiB
Plaintext

/obj/item/stack/light_w
name = "wired glass tile"
singular_name = "wired glass floor tile"
desc = "A glass tile, which is wired, somehow."
icon = 'icons/obj/tiles.dmi'
icon_state = "glass_wire"
w_class = WEIGHT_CLASS_NORMAL
force = 3
throwforce = 5
throw_speed = 3
throw_range = 7
flags_1 = CONDUCT_1
max_amount = 60
grind_results = list("silicon" = 1, "copper" = 1)
/obj/item/stack/light_w/attackby(obj/item/O, mob/user, params)
if(istype(O, /obj/item/wirecutters))
var/obj/item/stack/cable_coil/CC = new (user.loc)
CC.amount = 5
CC.add_fingerprint(user)
amount--
var/obj/item/stack/sheet/glass/G = new (user.loc)
G.add_fingerprint(user)
if(amount <= 0)
qdel(src)
else if(istype(O, /obj/item/stack/sheet/metal))
var/obj/item/stack/sheet/metal/M = O
if (M.use(1))
use(1)
var/obj/item/L = new /obj/item/stack/tile/light(user.loc)
to_chat(user, "<span class='notice'>You make a light tile.</span>")
L.add_fingerprint(user)
else
to_chat(user, "<span class='warning'>You need one metal sheet to finish the light tile!</span>")
else
return ..()