Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drakes can dig through outcrops #9305

Merged
merged 1 commit into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 48 additions & 22 deletions code/modules/mining/mine_outcrops.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand All @@ -24,6 +48,7 @@
upperdrop = 4
outcropdrop = /obj/item/ore/diamond


/obj/structure/outcrop/phoron
name = "shiny outcrop"
desc = "A shiny rocky outcrop."
Expand All @@ -32,6 +57,7 @@
upperdrop = 8
outcropdrop = /obj/item/ore/phoron


/obj/structure/outcrop/iron
name = "rugged outcrop"
desc = "A rugged rocky outcrop."
Expand All @@ -40,6 +66,7 @@
upperdrop = 20
outcropdrop = /obj/item/ore/iron


/obj/structure/outcrop/coal
name = "rugged outcrop"
desc = "A rugged rocky outcrop."
Expand All @@ -48,6 +75,7 @@
upperdrop = 20
outcropdrop = /obj/item/ore/coal


/obj/structure/outcrop/lead
name = "rugged outcrop"
desc = "A rugged rocky outcrop."
Expand All @@ -56,6 +84,7 @@
upperdrop = 5
outcropdrop = /obj/item/ore/lead


/obj/structure/outcrop/gold
name = "hollow outcrop"
desc = "A hollow rocky outcrop."
Expand All @@ -64,6 +93,7 @@
upperdrop = 6
outcropdrop = /obj/item/ore/gold


/obj/structure/outcrop/silver
name = "hollow outcrop"
desc = "A hollow rocky outcrop."
Expand All @@ -72,6 +102,7 @@
upperdrop = 8
outcropdrop = /obj/item/ore/silver


/obj/structure/outcrop/platinum
name = "hollow outcrop"
desc = "A hollow rocky outcrop."
Expand All @@ -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."
Expand All @@ -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, "<span class='notice'>[user] begins to hack away at \the [src].</span>")
if(do_after(user,40))
to_chat(user, "<span class='notice'>You have finished digging!</span>")
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)
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
)
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading