From 82544e72165035f55896e0f74aa68913451c71f7 Mon Sep 17 00:00:00 2001 From: kyres1 <36868890+kyres1@users.noreply.github.com> Date: Fri, 25 Aug 2023 17:01:36 -0500 Subject: [PATCH] Adds interactions for exoplanet foliage and terrain (#17079) * im gay * Update code/modules/overmap/exoplanets/decor/_turfs.dm Co-authored-by: SleepyGemmy <99297919+SleepyGemmy@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Fluffy <65877598+FluffyGhoster@users.noreply.github.com> --------- Co-authored-by: SleepyGemmy <99297919+SleepyGemmy@users.noreply.github.com> Co-authored-by: Fluffy <65877598+FluffyGhoster@users.noreply.github.com> --- aurorastation.dme | 1 + .../overmap/exoplanets/biomes/jungle.dm | 12 ++--- .../overmap/exoplanets/decor/_turfs.dm | 8 +++ .../overmap/exoplanets/decor/flora/_bush.dm | 50 +++++++++++------- .../overmap/exoplanets/decor/flora/jungle.dm | 13 ++--- .../overmap/exoplanets/decor/flora/snow.dm | 24 ++++----- .../overmap/exoplanets/decor/objs/clearing.dm | 35 ++++++++++++ html/changelogs/kyres1-foliage_fun.yml | 8 +++ icons/obj/flora/clearing.dmi | Bin 0 -> 1657 bytes 9 files changed, 108 insertions(+), 43 deletions(-) create mode 100644 code/modules/overmap/exoplanets/decor/objs/clearing.dm create mode 100644 html/changelogs/kyres1-foliage_fun.yml create mode 100644 icons/obj/flora/clearing.dmi diff --git a/aurorastation.dme b/aurorastation.dme index 5a4fc6a03c6..3c2fab38ab0 100644 --- a/aurorastation.dme +++ b/aurorastation.dme @@ -2751,6 +2751,7 @@ #include "code\modules\overmap\exoplanets\decor\flora\marsh.dm" #include "code\modules\overmap\exoplanets\decor\flora\potted.dm" #include "code\modules\overmap\exoplanets\decor\flora\snow.dm" +#include "code\modules\overmap\exoplanets\decor\objs\clearing.dm" #include "code\modules\overmap\exoplanets\decor\objs\monolith.dm" #include "code\modules\overmap\exoplanets\decor\objs\pit.dm" #include "code\modules\overmap\exoplanets\decor\turfs\barren.dm" diff --git a/code/modules/overmap/exoplanets/biomes/jungle.dm b/code/modules/overmap/exoplanets/biomes/jungle.dm index 61414334add..c97ea9bf465 100644 --- a/code/modules/overmap/exoplanets/biomes/jungle.dm +++ b/code/modules/overmap/exoplanets/biomes/jungle.dm @@ -18,9 +18,9 @@ /obj/structure/flora/bush/jungle/c/random = 3 ), GRASSES = list( - /obj/effect/floor_decal/junglegrass/random = 4, - /obj/effect/floor_decal/junglegrass/dense/random = 2, - /obj/effect/floor_decal/junglegrass/rocky/random = 1 + /obj/structure/flora/grass/junglegrass/random = 4, + /obj/structure/flora/grass/junglegrass/dense/random = 2, + /obj/structure/flora/grass/junglegrass/rocky/random = 1 ), WILDLIFE = list( /mob/living/simple_animal/yithian = 1, @@ -43,9 +43,9 @@ /obj/structure/flora/bush/jungle/c/random = 3 ), GRASSES = list( - /obj/effect/floor_decal/junglegrass/random = 4, - /obj/effect/floor_decal/junglegrass/dense/random = 2, - /obj/effect/floor_decal/junglegrass/rocky/random = 1 + /obj/structure/flora/grass/junglegrass/random = 4, + /obj/structure/flora/grass/junglegrass/dense/random = 2, + /obj/structure/flora/grass/junglegrass/rocky/random = 1 ), WILDLIFE = list( /mob/living/simple_animal/yithian = 1, diff --git a/code/modules/overmap/exoplanets/decor/_turfs.dm b/code/modules/overmap/exoplanets/decor/_turfs.dm index f820924fab4..92992ee7022 100644 --- a/code/modules/overmap/exoplanets/decor/_turfs.dm +++ b/code/modules/overmap/exoplanets/decor/_turfs.dm @@ -43,6 +43,14 @@ if(T.use(1)) playsound(src, 'sound/items/Deconstruct.ogg', 80, 1) ChangeTurf(/turf/simulated/floor, FALSE, FALSE, FALSE, TRUE) + else if(diggable && istype(C,/obj/item/material/minihoe)) + visible_message(SPAN_NOTICE("\The [user] starts clearing \the [src]")) + if(C.use_tool(src, user, 50, volume = 50)) + to_chat(user, SPAN_NOTICE("You make a small clearing.")) + new /obj/structure/clearing(src) + diggable = FALSE + else + to_chat(user, SPAN_NOTICE("You stop shoveling.")) /turf/simulated/floor/exoplanet/ex_act(severity) switch(severity) diff --git a/code/modules/overmap/exoplanets/decor/flora/_bush.dm b/code/modules/overmap/exoplanets/decor/flora/_bush.dm index e25e7c63749..0c5fcf8d1b4 100644 --- a/code/modules/overmap/exoplanets/decor/flora/_bush.dm +++ b/code/modules/overmap/exoplanets/decor/flora/_bush.dm @@ -1,3 +1,34 @@ +/obj/structure/flora/bush + name = "bush" + desc = "A bush." + icon = 'icons/obj/flora/snowflora.dmi' + icon_state = "snowbush1" + density = FALSE + +/obj/structure/flora/bush/Initialize() + . = ..() + icon_state = "snowbush[rand(1, 6)]" + +/obj/structure/flora/bush/attackby(var/obj/item/W, var/mob/user) + if(istype(W, /obj/item/material/scythe)) + shake_animation() + if(W.use_tool(src, user, 50, volume = 50)) + if(prob(50)) + new /obj/item/stack/material/wood(get_turf(src), 2) + if(prob(40)) + new /obj/item/stack/material/wood(get_turf(src), 4) + if(prob(10)) + var/pickberry = pick(list(/obj/item/seeds/berryseed, /obj/item/seeds/blueberryseed)) + new /obj/item/stack/material/wood(get_turf(src), 4) + new pickberry(get_turf(src), 4) + to_chat(user, SPAN_NOTICE("You find some seeds as you hack the bush away.")) + to_chat(user, SPAN_NOTICE("You slice at the bush!")) + qdel(src) + else if(istype(W, /obj/item/material/hatchet)) + shake_animation() + if(W.use_tool(src, user, 50, volume = 50)) + to_chat(user, SPAN_NOTICE("You chop at the bush!")) + qdel(src) /obj/structure/flora/ausbushes name = "bush" @@ -9,22 +40,3 @@ /obj/structure/flora/ausbushes/New() ..() icon_state = "firstbush_[rand(1, 4)]" - -/obj/structure/flora/ausbushes/attackby(var/obj/item/W, var/mob/user) - if(istype(W, /obj/item/material/scythe)) - if(prob(50)) - new /obj/item/stack/material/wood(get_turf(src), 2) - if(prob(40)) - new /obj/item/stack/material/wood(get_turf(src), 4) - if(prob(10)) - var/pickberry = pick(list(/obj/item/seeds/berryseed, /obj/item/seeds/blueberryseed)) - new /obj/item/stack/material/wood(get_turf(src), 4) - new pickberry(get_turf(src), 4) - to_chat(user, SPAN_NOTICE("You find some seeds as you hack the bush away.")) - to_chat(user, SPAN_NOTICE("You slice at the bush!")) - qdel(src) - playsound(src, 'sound/effects/woodcutting.ogg', 50, TRUE) - if(istype(W, /obj/item/material/hatchet)) // No items. - to_chat(user, SPAN_NOTICE("You chop at the bush!")) - qdel(src) - playsound(src, 'sound/effects/woodcutting.ogg', 50, TRUE) diff --git a/code/modules/overmap/exoplanets/decor/flora/jungle.dm b/code/modules/overmap/exoplanets/decor/flora/jungle.dm index 127ef738947..5e4879609af 100644 --- a/code/modules/overmap/exoplanets/decor/flora/jungle.dm +++ b/code/modules/overmap/exoplanets/decor/flora/jungle.dm @@ -1,23 +1,24 @@ -/obj/effect/floor_decal/junglegrass +/obj/structure/flora/grass/junglegrass name = "jungle grass" icon = 'icons/obj/flora/jungleflora.dmi' icon_state = "grassb" + density = FALSE -/obj/effect/floor_decal/junglegrass/random/Initialize(mapload, newdir, newcolour, bypass, set_icon_state) +/obj/structure/flora/grass/junglegrass/random/Initialize(mapload, newdir, newcolour, bypass, set_icon_state) icon_state = "grassb[rand(1,5)]" . = ..() -/obj/effect/floor_decal/junglegrass/dense +/obj/structure/flora/grass/junglegrass/dense icon_state = "grassa" -/obj/effect/floor_decal/junglegrass/dense/random/Initialize(mapload, newdir, newcolour, bypass, set_icon_state) +/obj/structure/flora/grass/junglegrass/dense/random/Initialize(mapload, newdir, newcolour, bypass, set_icon_state) icon_state = "grassa[rand(1,5)]" . = ..() -/obj/effect/floor_decal/junglegrass/rocky +/obj/structure/flora/grass/junglegrass/rocky icon_state = "rock" -/obj/effect/floor_decal/junglegrass/rocky/random/Initialize(mapload, newdir, newcolour, bypass, set_icon_state) +/obj/structure/flora/grass/junglegrass/rocky/random/Initialize(mapload, newdir, newcolour, bypass, set_icon_state) icon_state = "rock[rand(1,5)]" . = ..() diff --git a/code/modules/overmap/exoplanets/decor/flora/snow.dm b/code/modules/overmap/exoplanets/decor/flora/snow.dm index 2db1466050a..99ccc98c243 100644 --- a/code/modules/overmap/exoplanets/decor/flora/snow.dm +++ b/code/modules/overmap/exoplanets/decor/flora/snow.dm @@ -5,6 +5,18 @@ icon = 'icons/obj/flora/snowflora.dmi' density = FALSE +/obj/structure/flora/grass/attackby(var/obj/item/W, var/mob/user) + if(istype(W, /obj/item/material/scythe)) + shake_animation() + if(W.use_tool(src, user, 10, volume = 50)) + to_chat(user, SPAN_NOTICE("You slice the grass away with the scythe!")) + qdel(src) + else if(istype(W, /obj/item/material/hatchet)) + shake_animation() + if(W.use_tool(src, user, 50, volume = 50)) + to_chat(user, SPAN_NOTICE("You chop at the grass!")) + qdel(src) + /obj/structure/flora/grass/brown icon_state = "snowgrass1bb" @@ -25,15 +37,3 @@ /obj/structure/flora/grass/both/New() ..() icon_state = "snowgrassall[rand(1, 3)]" - -// Bushes -/obj/structure/flora/bush - name = "bush" - desc = "A bush." - icon = 'icons/obj/flora/snowflora.dmi' - icon_state = "snowbush1" - density = FALSE - -/obj/structure/flora/bush/Initialize() - . = ..() - icon_state = "snowbush[rand(1, 6)]" diff --git a/code/modules/overmap/exoplanets/decor/objs/clearing.dm b/code/modules/overmap/exoplanets/decor/objs/clearing.dm new file mode 100644 index 00000000000..c420516d46e --- /dev/null +++ b/code/modules/overmap/exoplanets/decor/objs/clearing.dm @@ -0,0 +1,35 @@ +/obj/structure/clearing + name = "clearing" + desc = "A small clearing from surrounding terrain or foliage." + icon = 'icons/obj/flora/clearing.dmi' + icon_state = "smooth" + blend_mode = BLEND_MULTIPLY + density = FALSE + anchored = TRUE + smooth = SMOOTH_MORE + canSmoothWith = list( + /obj/structure/clearing, + /obj/structure/lattice/catwalk, + /obj/structure/lattice/catwalk/indoor, + /turf/simulated/floor/concrete, + /turf/simulated/floor/plating, + /turf/simulated/floor/tiled, + /turf/simulated/floor/wood, + /turf/simulated/wall + ) + +/obj/structure/clearing/attackby(obj/item/W, mob/user) + if(istype(W,/obj/item/material/minihoe)) + visible_message(SPAN_NOTICE("\The [user] starts adjusting the \the [src]")) + if(W.use_tool(src, user, 50, volume = 50)) + visible_message(SPAN_NOTICE("\The [user] adjusts \the [src]!")) + qdel(src) + else + to_chat(user, SPAN_NOTICE("You stop adjusting the terrain.")) + return + +/obj/structure/clearing/update_icon() + if(istype(loc,/turf/simulated/floor/exoplanet)) + var/turf/simulated/floor/exoplanet/E = loc + if(E.dirt_color) + color = E.dirt_color diff --git a/html/changelogs/kyres1-foliage_fun.yml b/html/changelogs/kyres1-foliage_fun.yml new file mode 100644 index 00000000000..e12a46c0a08 --- /dev/null +++ b/html/changelogs/kyres1-foliage_fun.yml @@ -0,0 +1,8 @@ +author: kyres1 + +delete-after: True + +changes: + - rscadd: "Added a method of clearing paths into exoplanet land by using mini hoes." + - tweak: "Scythes and hatchets can now clear grass and bushes on exoplanets." + - bugfix: "Changed the paths of jungle decals to be structures instead, so grass can actually be interacted with." diff --git a/icons/obj/flora/clearing.dmi b/icons/obj/flora/clearing.dmi new file mode 100644 index 0000000000000000000000000000000000000000..d9a391615ffece23ff9f3a5aa9d29a07d2e47236 GIT binary patch literal 1657 zcmZ{lYdDl?7{{k&dP_9Zk+>L@4py77O@)jhhYVrJ7CFt*7F*0)s5v!LUfYl~NIGmz zaVcRUv9raDmn56ourfIx2GK}kFfnHA+g|l?KRo~Ye*XXa{yiU`B#PGoJsm?G6bhwB zc60VcYVMb#t%WFKfN6ph4CSDoOJZUo2!e=mI2=Sh)dkZ?v?SKo>k!IeL~lx)b^`-_1C(i4Tk9(vDg5CEwy{UFGEwp`hL0t4Olw4AF^`@3eBLh059HLFx4-0^};$(~7geI>V1#->%_N2aZMWN8%WM@aeh>H`Qf$1ft zx+n_HD1xfBde56$jq)sHYP+=4Ks9+*R9HfGAC7Bo#@q3Iv~F7dQcR3UrOBiJzaBUJv(4{SAp=m~! z7jEq?qQAy%W*h@$fqt%8iWCyR6aUMduU!0xH`dv<;=~t%^O|ExEvOe0?Q!fuDA@4(I~( zx}C-b7R+`e^k-VGfA&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