Merge pull request #14943 from WanderingFox95/WanderingFox95-custom-kegs

Custom Kegs
This commit is contained in:
silicons
2021-07-18 15:06:30 -07:00
committed by GitHub
3 changed files with 38 additions and 0 deletions
@@ -179,6 +179,7 @@ GLOBAL_LIST_INIT(metal_recipes, list ( \
GLOBAL_LIST_INIT(plasteel_recipes, list ( \
new/datum/stack_recipe("AI core", /obj/structure/AIcore, 4, time = 50, one_per_turf = TRUE), \
new/datum/stack_recipe("bomb assembly", /obj/machinery/syndicatebomb/empty, 10, time = 50), \
new/datum/stack_recipe("plasteel keg", /obj/structure/custom_keg, 10, time = 50), \
new/datum/stack_recipe("micro powered fan assembly", /obj/machinery/fan_assembly, 5, time = 50, one_per_turf = TRUE, on_floor = TRUE), \
new /datum/stack_recipe_list("crates", list( \
new /datum/stack_recipe("gray crate", /obj/structure/closet/crate, 5, time = 50, one_per_turf = 1, on_floor = 1), \
@@ -73,3 +73,40 @@
icon_state = "barrel_open"
else
icon_state = "barrel"
/obj/structure/custom_keg
name = "Plasteel Keg"
desc = "A large plasteel keg. You can use it to hold liquids. You may wanna label this, too."
icon = 'icons/obj/objects.dmi'
icon_state = "keg"
density = TRUE
anchored = FALSE
pressure_resistance = 2 * ONE_ATMOSPHERE
max_integrity = 300
var/open = FALSE
/obj/structure/custom_keg/Initialize()
create_reagents(1000, DRAINABLE | AMOUNT_VISIBLE)
. = ..()
/obj/structure/custom_keg/examine(mob/user)
. = ..()
. += "<span class='notice'>It is currently [open?"open, letting you pour liquids in.":"closed, letting you draw liquids from the tap."]</span>"
/obj/structure/custom_keg/on_attack_hand(mob/user, act_intent = user.a_intent, unarmed_attack_flags)
open = !open
if(open)
DISABLE_BITFIELD(reagents.reagents_holder_flags, DRAINABLE)
ENABLE_BITFIELD(reagents.reagents_holder_flags, REFILLABLE)
to_chat(user, "<span class='notice'>You open [src], letting you fill it.</span>")
else
DISABLE_BITFIELD(reagents.reagents_holder_flags, REFILLABLE)
ENABLE_BITFIELD(reagents.reagents_holder_flags, DRAINABLE)
to_chat(user, "<span class='notice'>You close [src], letting you draw from its tap.</span>")
update_icon()
/obj/structure/custom_keg/update_icon_state()
if(open)
icon_state = "keg_open"
else
icon_state = "keg"