From ccb61518aec1becf1d25eb065cff101445055735 Mon Sep 17 00:00:00 2001 From: Citinited Date: Sun, 30 Dec 2018 02:15:05 +0000 Subject: [PATCH 1/4] 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]"] From abe99ba8ad3f75054692b8a9cb0b42d2b145c439 Mon Sep 17 00:00:00 2001 From: Citinited Date: Sun, 30 Dec 2018 02:15:57 +0000 Subject: [PATCH 2/4] Snowman construction time tweak --- code/modules/crafting/recipes.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/crafting/recipes.dm b/code/modules/crafting/recipes.dm index 1246ee4e42e..98091fc33a8 100644 --- a/code/modules/crafting/recipes.dm +++ b/code/modules/crafting/recipes.dm @@ -415,6 +415,6 @@ reqs = list(/obj/item/snowball = 10, /obj/item/reagent_containers/food/snacks/grown/carrot = 1, /obj/item/grown/log = 2) - time = 10 + time = 50 category = CAT_MISC roundstart_enabled = FALSE From 48f37473d7f086c9200da3bf4b49b36378e696ef Mon Sep 17 00:00:00 2001 From: Citinited Date: Sun, 30 Dec 2018 02:25:34 +0000 Subject: [PATCH 3/4] proper path for built snowmen --- code/game/objects/effects/snowcloud.dm | 21 --------------------- code/game/objects/structures/statues.dm | 22 ++++++++++++++++++++++ code/modules/crafting/recipes.dm | 2 +- 3 files changed, 23 insertions(+), 22 deletions(-) diff --git a/code/game/objects/effects/snowcloud.dm b/code/game/objects/effects/snowcloud.dm index a05cc05778b..a67bbd3c5f7 100644 --- a/code/game/objects/effects/snowcloud.dm +++ b/code/game/objects/effects/snowcloud.dm @@ -138,24 +138,3 @@ /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 ffa440c18a5..96d7857fa6f 100644 --- a/code/game/objects/structures/statues.dm +++ b/code/game/objects/structures/statues.dm @@ -341,6 +341,28 @@ anchored = 1 density = 1 +/obj/structure/snowman/built + 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/built/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/built/fire_act() + qdel(src) + + /obj/structure/kidanstatue name = "Obsidian Kidan warrior statue" desc = "A beautifully carved and menacing statue of a Kidan warrior made out of obsidian. It looks very heavy." diff --git a/code/modules/crafting/recipes.dm b/code/modules/crafting/recipes.dm index 98091fc33a8..4fc0d229d3f 100644 --- a/code/modules/crafting/recipes.dm +++ b/code/modules/crafting/recipes.dm @@ -411,7 +411,7 @@ /datum/crafting_recipe/snowman name = "Snowman" - result = /obj/structure/snowman + result = /obj/structure/snowman/built reqs = list(/obj/item/snowball = 10, /obj/item/reagent_containers/food/snacks/grown/carrot = 1, /obj/item/grown/log = 2) From eff4107049ee076af519f799ad9f29778756fbbd Mon Sep 17 00:00:00 2001 From: Citinited Date: Sun, 30 Dec 2018 03:00:33 +0000 Subject: [PATCH 4/4] Snowman drops stuff on destroy now --- code/game/objects/structures/statues.dm | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/code/game/objects/structures/statues.dm b/code/game/objects/structures/statues.dm index 96d7857fa6f..090327d1c7f 100644 --- a/code/game/objects/structures/statues.dm +++ b/code/game/objects/structures/statues.dm @@ -338,18 +338,18 @@ desc = "Seems someone made a snowman here." icon = 'icons/obj/stationobjs.dmi' icon_state = "snowman" - anchored = 1 - density = 1 + anchored = TRUE + density = TRUE /obj/structure/snowman/built - name = "snowman" - desc = "Do you wanna build a snowman?" - density = TRUE - anchored = TRUE - climbable = FALSE + desc = "Just like the ones you remember from childhood!" max_integrity = 50 - icon = 'icons/obj/stationobjs.dmi' - icon_state = "snowman" + +/obj/structure/snowman/built/Destroy() + new /obj/item/reagent_containers/food/snacks/grown/carrot(drop_location()) + new /obj/item/grown/log(drop_location()) + new /obj/item/grown/log(drop_location()) + return ..() /obj/structure/snowman/built/attackby(obj/item/I, mob/user) if(istype(I, /obj/item/snowball) && obj_integrity < max_integrity)