From ccb61518aec1becf1d25eb065cff101445055735 Mon Sep 17 00:00:00 2001 From: Citinited Date: Sun, 30 Dec 2018 02:15:05 +0000 Subject: [PATCH] You can now build snowmen at Christmastime; removes commented out code --- code/__HELPERS/global_lists.dm | 6 +++++- code/game/objects/effects/snowcloud.dm | 21 +++++++++++++++++++++ code/game/objects/structures/statues.dm | 11 ----------- code/modules/crafting/recipes.dm | 13 ++++++++++++- code/modules/holiday/christmas.dm | 1 + 5 files changed, 39 insertions(+), 13 deletions(-) diff --git a/code/__HELPERS/global_lists.dm b/code/__HELPERS/global_lists.dm index a37be148b4e..5b830a72b9f 100644 --- a/code/__HELPERS/global_lists.dm +++ b/code/__HELPERS/global_lists.dm @@ -47,7 +47,11 @@ if(IS_WHITELISTED in S.species_traits) GLOB.whitelisted_species += S.name - init_subtypes(/datum/crafting_recipe, GLOB.crafting_recipes) + for(var/D in subtypesof(/datum/crafting_recipe)) + var/datum/crafting_recipe/R = D + if(!initial(R.roundstart_enabled)) + continue + GLOB.crafting_recipes += new R //Pipe list building init_subtypes(/datum/pipes, GLOB.construction_pipe_list) diff --git a/code/game/objects/effects/snowcloud.dm b/code/game/objects/effects/snowcloud.dm index a67bbd3c5f7..a05cc05778b 100644 --- a/code/game/objects/effects/snowcloud.dm +++ b/code/game/objects/effects/snowcloud.dm @@ -138,3 +138,24 @@ /obj/item/snowball/ex_act(severity) qdel(src) + +/obj/structure/snowman + name = "snowman" + desc = "Do you wanna build a snowman?" + density = TRUE + anchored = TRUE + climbable = FALSE + max_integrity = 50 + icon = 'icons/obj/stationobjs.dmi' + icon_state = "snowman" + +/obj/structure/snowman/attackby(obj/item/I, mob/user) + if(istype(I, /obj/item/snowball) && obj_integrity < max_integrity) + to_chat(user, "You patch some of the damage on [src] with [I].") + obj_integrity = max_integrity + qdel(I) + else + return ..() + +/obj/structure/snowman/fire_act() + qdel(src) diff --git a/code/game/objects/structures/statues.dm b/code/game/objects/structures/statues.dm index ba015c843fa..ffa440c18a5 100644 --- a/code/game/objects/structures/statues.dm +++ b/code/game/objects/structures/statues.dm @@ -313,17 +313,6 @@ icon = 'icons/obj/statuelarge.dmi' icon_state = "venus" -/* -/obj/structure/statue/snow - hardness = 0.5 - material_drop_type = /obj/item/stack/sheet/mineral/snow - -/obj/structure/statue/snow/snowman - name = "snowman" - desc = "Several lumps of snow put together to form a snowman." - icon_state = "snowman" -*/ - /obj/structure/statue/tranquillite hardness = 0.5 material_drop_type = /obj/item/stack/sheet/mineral/tranquillite diff --git a/code/modules/crafting/recipes.dm b/code/modules/crafting/recipes.dm index a5783f5ab3f..1246ee4e42e 100644 --- a/code/modules/crafting/recipes.dm +++ b/code/modules/crafting/recipes.dm @@ -7,6 +7,7 @@ var/parts[] = list() //type paths of items that will be placed in the result var/chem_catalysts[] = list() //like tools but for reagents var/category = CAT_MISC // Recipe category + var/roundstart_enabled = TRUE //Set to FALSE if you don't want a particular crafting recipe to be available all the time /datum/crafting_recipe/proc/AdjustChems(var/obj/resultobj as obj) //This proc is to replace the make_food proc of recipes from microwaves and such that are being converted to table crafting recipes. @@ -406,4 +407,14 @@ /datum/reagent/paint/black = 30, /obj/item/storage/toolbox = 1) //Paint in reagents so it doesnt take the container up, yet still take it from the beaker tools = list(/obj/item/reagent_containers/glass/rag = 1) //need something to paint with it - category = CAT_MISC \ No newline at end of file + category = CAT_MISC + +/datum/crafting_recipe/snowman + name = "Snowman" + result = /obj/structure/snowman + reqs = list(/obj/item/snowball = 10, + /obj/item/reagent_containers/food/snacks/grown/carrot = 1, + /obj/item/grown/log = 2) + time = 10 + category = CAT_MISC + roundstart_enabled = FALSE diff --git a/code/modules/holiday/christmas.dm b/code/modules/holiday/christmas.dm index ae8a1379c7f..ea608e35e4d 100644 --- a/code/modules/holiday/christmas.dm +++ b/code/modules/holiday/christmas.dm @@ -6,6 +6,7 @@ new /obj/item/a_gift(T) for(var/mob/living/simple_animal/pet/corgi/Ian/Ian in GLOB.mob_list) Ian.place_on_head(new /obj/item/clothing/head/helmet/space/santahat(Ian)) + GLOB.crafting_recipes += new /datum/crafting_recipe/snowman //The following spawn is necessary as both the timer and the shuttle systems initialise after the events system does, so we can't add stuff to the shuttle system as it doesn't exist yet and we can't use a timer spawn(60 SECONDS) var/datum/supply_packs/xmas = SSshuttle.supply_packs["[/datum/supply_packs/misc/snow_machine]"]