From 14d8d9bfdc0ebb2bf987b9d55e729d350d119ca1 Mon Sep 17 00:00:00 2001 From: Spookerton Date: Sat, 30 Dec 2023 01:10:39 +0000 Subject: [PATCH] drakes can dig through outcrops --- code/modules/mining/mine_outcrops.dm | 70 +++++++++++++------ .../sif/grafadreka/grafadreka_interaction.dm | 23 ++++++ 2 files changed, 71 insertions(+), 22 deletions(-) diff --git a/code/modules/mining/mine_outcrops.dm b/code/modules/mining/mine_outcrops.dm index a1c2c675ff7..c9e1091d86f 100644 --- a/code/modules/mining/mine_outcrops.dm +++ b/code/modules/mining/mine_outcrops.dm @@ -11,11 +11,35 @@ var/upperdrop = 10 var/outcropdrop = /obj/item/ore/glass + /obj/structure/outcrop/Initialize() . = ..() - if(prob(1)) + if (prob(1)) add_overlay("[initial(icon_state)]-egg") + +/obj/structure/outcrop/attackby(obj/item/item, mob/living/user) + if (!istype(item, /obj/item/pickaxe)) + return ..() + visible_message( + SPAN_ITALIC("\The [user] begins to hack away at \the [src]."), + SPAN_ITALIC("You hear the industrious clanging of metal on rock!") + ) + if (!do_after(user, 4 SECONDS, src)) + return TRUE + visible_message( + SPAN_ITALIC("\The [user] breaks the [src] apart."), + SPAN_ITALIC("You hear rocks shatter apart!") + ) + var/turf/turf = get_turf(src) + qdel(src) + if (!turf) + return TRUE + for (var/i = 1 to rand(mindrop, upperdrop)) + new outcropdrop (turf) + return TRUE + + /obj/structure/outcrop/diamond name = "shiny outcrop" desc = "A shiny rocky outcrop." @@ -24,6 +48,7 @@ upperdrop = 4 outcropdrop = /obj/item/ore/diamond + /obj/structure/outcrop/phoron name = "shiny outcrop" desc = "A shiny rocky outcrop." @@ -32,6 +57,7 @@ upperdrop = 8 outcropdrop = /obj/item/ore/phoron + /obj/structure/outcrop/iron name = "rugged outcrop" desc = "A rugged rocky outcrop." @@ -40,6 +66,7 @@ upperdrop = 20 outcropdrop = /obj/item/ore/iron + /obj/structure/outcrop/coal name = "rugged outcrop" desc = "A rugged rocky outcrop." @@ -48,6 +75,7 @@ upperdrop = 20 outcropdrop = /obj/item/ore/coal + /obj/structure/outcrop/lead name = "rugged outcrop" desc = "A rugged rocky outcrop." @@ -56,6 +84,7 @@ upperdrop = 5 outcropdrop = /obj/item/ore/lead + /obj/structure/outcrop/gold name = "hollow outcrop" desc = "A hollow rocky outcrop." @@ -64,6 +93,7 @@ upperdrop = 6 outcropdrop = /obj/item/ore/gold + /obj/structure/outcrop/silver name = "hollow outcrop" desc = "A hollow rocky outcrop." @@ -72,6 +102,7 @@ upperdrop = 8 outcropdrop = /obj/item/ore/silver + /obj/structure/outcrop/platinum name = "hollow outcrop" desc = "A hollow rocky outcrop." @@ -80,6 +111,7 @@ upperdrop = 5 outcropdrop = /obj/item/ore/osmium + /obj/structure/outcrop/uranium name = "spiky outcrop" desc = "A spiky rocky outcrop, it glows faintly." @@ -88,30 +120,24 @@ upperdrop = 8 outcropdrop = /obj/item/ore/uranium -/obj/structure/outcrop/attackby(obj/item/W as obj, mob/user as mob) - if (istype(W, /obj/item/pickaxe)) - to_chat(user, "[user] begins to hack away at \the [src].") - if(do_after(user,40)) - to_chat(user, "You have finished digging!") - for(var/i=0;i<(rand(mindrop,upperdrop));i++) - new outcropdrop(get_turf(src)) - qdel(src) - return - -/obj/random/outcrop //In case you want an outcrop without pre-determining the type of ore. + +/obj/random/outcrop name = "random rock outcrop" desc = "This is a random rock outcrop." icon = 'icons/obj/outcrop.dmi' icon_state = "outcrop-random" + /obj/random/outcrop/item_to_spawn() - return pick(prob(100);/obj/structure/outcrop, - prob(100);/obj/structure/outcrop/iron, - prob(100);/obj/structure/outcrop/coal, - prob(65);/obj/structure/outcrop/silver, - prob(50);/obj/structure/outcrop/gold, - prob(30);/obj/structure/outcrop/uranium, - prob(30);/obj/structure/outcrop/phoron, - prob(7);/obj/structure/outcrop/diamond, - prob(15);/obj/structure/outcrop/platinum, - prob(15);/obj/structure/outcrop/lead) \ No newline at end of file + return pick( + prob(100); /obj/structure/outcrop, + prob(100); /obj/structure/outcrop/iron, + prob(100); /obj/structure/outcrop/coal, + prob(65); /obj/structure/outcrop/silver, + prob(50); /obj/structure/outcrop/gold, + prob(30); /obj/structure/outcrop/uranium, + prob(30); /obj/structure/outcrop/phoron, + prob(15); /obj/structure/outcrop/platinum, + prob(15); /obj/structure/outcrop/lead, + prob(7); /obj/structure/outcrop/diamond + ) diff --git a/code/modules/mob/living/simple_mob/subtypes/animal/sif/grafadreka/grafadreka_interaction.dm b/code/modules/mob/living/simple_mob/subtypes/animal/sif/grafadreka/grafadreka_interaction.dm index 4501655a386..f7d79e6961d 100644 --- a/code/modules/mob/living/simple_mob/subtypes/animal/sif/grafadreka/grafadreka_interaction.dm +++ b/code/modules/mob/living/simple_mob/subtypes/animal/sif/grafadreka/grafadreka_interaction.dm @@ -48,6 +48,29 @@ qdel(src) +/obj/structure/outcrop/interaction_grafadreka(mob/living/simple_mob/animal/sif/grafadreka/drake) + . = TRUE + drake.visible_message( + SPAN_ITALIC("\The [drake] claws away at \a [src]."), + SPAN_ITALIC("You dig industriously at \the [src]."), + SPAN_ITALIC("You hear something scrabbling on stone!"), + range = 5 + ) + if (!do_after(drake, 4 SECONDS, src)) + return + visible_message( + SPAN_WARNING("\The [src] crumbles away to debris."), + SPAN_NOTICE("You finish digging up the [src]."), + SPAN_ITALIC("You hear small rocks tumbling around!"), + range = 5 + ) + var/turf/turf = get_turf(src) + qdel(src) + if (turf) + for (var/i = 1 to rand(mindrop, upperdrop)) + new outcropdrop (turf) + + /obj/item/bikehorn/interaction_grafadreka(mob/living/simple_mob/animal/sif/grafadreka/drake) . = TRUE if (drake.a_intent != I_HELP)