Exoplanet Overhaul: The Shape of Things to Come (#16216)

* the end of the beginning

* SPEED

* SPEED

* we real speed

* fix ore gen

* re-organize exoplanet stuff

* reorg and rename defines, fix ores

* Everything Else

* 1.2.0+a3 rust_g

* fix merge

* get rid of noise maps

* fix adhomai, delete random maps

* make adhomai poggers or something idk

* debug

* crystal planet, misc bugfixes

* fixes

* log

* change mineral gen to make adhomai work

* try this

* huh

* huhw

* rust_g 1.2.0+a4

* port adhomai changes to correct file

* fix for rock nomad

* bugfixes
This commit is contained in:
Wildkins
2023-04-25 13:48:54 +00:00
committed by GitHub
parent 1cdda204ab
commit 9f1bdd2847
92 changed files with 2361 additions and 1216 deletions
@@ -1,47 +0,0 @@
//tree
/obj/structure/flora/tree/adhomai
icon = 'icons/obj/flora/adhomai_trees.dmi'
icon_state = "tree1"
pixel_x = -32
stumptype = /obj/structure/flora/stump/adhomai
/obj/structure/flora/tree/adhomai/Initialize(mapload)
. = ..()
icon_state = "tree[rand(1, 12)]"
/obj/structure/flora/stump/adhomai
icon = 'icons/obj/flora/adhomai_trees.dmi'
icon_state = "stump"
pixel_x = -32
//bushes
/obj/structure/flora/bush/adhomai
icon = 'icons/obj/flora/adhomai_flora.dmi'
icon_state = "bush1"
anchored = 1
/obj/structure/flora/bush/adhomai/Initialize(mapload)
. = ..()
icon_state = "bush[rand(1, 7)]"
//grass
/obj/structure/flora/grass/adhomai
icon = 'icons/obj/flora/adhomai_flora.dmi'
icon_state = "grass1"
/obj/structure/flora/grass/adhomai/Initialize(mapload)
. = ..()
icon_state = "grass[rand(1, 4)]"
//rock
/obj/structure/flora/rock/adhomai
icon = 'icons/obj/flora/adhomai_flora.dmi'
icon_state = "rock1"
/obj/structure/flora/rock/adhomai/Initialize(mapload)
. = ..()
icon_state = "rock[rand(1, 5)]"
@@ -1,385 +0,0 @@
/obj/structure/flora
name = "flora parent object"
desc = DESC_PARENT
anchored = TRUE
density = TRUE
var/cutting
/obj/structure/flora/proc/dig_up(mob/user)
user.visible_message(SPAN_NOTICE("\The [user] begins digging up \the [src]..."))
if(do_after(user, 150))
if(Adjacent(user))
user.visible_message(SPAN_NOTICE("\The [user] removes \the [src]!"))
qdel(src)
/obj/structure/flora/proc/can_dig()
return FALSE
/obj/structure/flora/attackby(obj/item/I, mob/user)
if(I.is_shovel() && can_dig())
dig_up(user)
return
..()
/obj/structure/flora/tree
name = "tree"
desc = "A tree."
density = TRUE
layer = 9
pixel_x = -16
var/max_chop_health = 180
var/chop_health = 180 //15 hits with steel hatchet, 5 with wielded fireaxe
var/fall_force = 60
var/list/contained_objects = list() //If it has anything except wood. Fruit, pinecones, animals, etc.
var/stumptype = /obj/structure/flora/stump //stump to make when chopped
var/static/list/fall_forbid = list(/obj/structure/flora, /obj/effect, /obj/structure/bonfire, /obj/structure/pit)
/obj/structure/flora/tree/proc/update_desc()
desc = initial(desc)
switch(chop_health / max_chop_health)
if(0 to 0.25)
desc = " It looks like it's about to fall!"
if(0.26 to 0.5)
desc += " Just a bit more work and it'll fall!"
if(0.51 to 0.75)
desc += " It's been chopped at a few times."
if(0.76 to 0.95)
desc += " Looks like someone just started cutting it down."
/obj/structure/flora/tree/attackby(obj/item/I, mob/user)
if(I.can_woodcut())
if(cutting)
return
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
cutting = TRUE
if(istype(I, /obj/item/material/twohanded/chainsaw))
var/obj/item/material/twohanded/chainsaw/C = I
if(C.powered)
user.visible_message(SPAN_NOTICE("\The [user] begins cutting down \the [src]..."), SPAN_NOTICE("You start cutting down \the [src]..."))
playsound(get_turf(user), 'sound/weapons/saw/chainsawhit.ogg', 60, 1)
shake_animation()
if(do_after(user, 50))
timber(user)
else
to_chat(user, SPAN_WARNING("Try turning \the [C] on first!"))
cutting = FALSE
return
else if(do_after(user, I.w_class * 5)) //Small windup
user.do_attack_animation(src)
shake_animation()
playsound(get_turf(src), 'sound/effects/woodcutting.ogg', 50, 1)
chop_health -= I.force
update_desc()
if(prob(20))
user.visible_message(SPAN_NOTICE("\The [user] chops at \the [src]."), SPAN_NOTICE("You chop at \the [src]."), SPAN_NOTICE("You hear someone chopping wood."))
if(prob(I.force/3))
var/list/valid_turfs = list()
for(var/turf/T in circle_range(src, 1))
if(T.contains_dense_objects())
continue
valid_turfs += T
if(!valid_turfs.len)
valid_turfs += get_turf(src)
var/obj/item/stack/material/wood/branch/B = new(pick(valid_turfs))
B.amount = 1
visible_message(SPAN_NOTICE("\The [B] falls from \the [src]."))
if(chop_health <= 0)
timber(user)
cutting = FALSE
return
..()
/obj/structure/flora/tree/proc/timber(mob/user)
var/turf/fall_loc //Where we will fall
//We prefer to fall directly away from the user if possible
var/turf/pref_loc = get_cardinal_step_away(src, user)
if(!pref_loc.contains_dense_objects(TRUE))
fall_loc = pref_loc
//Otherwise, we fall elsewhere
else
var/list/fall_spots = list()
for(var/turf/T in orange(1, src))
if(locate(user) in T.contents) //Won't fall on woodcutter
continue
if(T.contains_dense_objects(TRUE)) //Let's avoid dense objects but not mobs
continue
fall_spots += T
if(!fall_spots.len)
fall_loc = get_turf(src)
else
fall_loc = pick(fall_spots)
playsound(get_turf(src), 'sound/species/diona/gestalt_grow.ogg', 50)
for(var/atom/A in fall_loc.contents)
if(is_type_in_list(A, fall_forbid))
continue
if(isliving(A))
var/mob/living/L = A
visible_message(SPAN_WARNING("\The [src] crushes \the [L] under its weight!"))
if(ishuman(L))
var/mob/living/carbon/human/H = L
var/obj/item/organ/external/affected = pick(H.organs)
affected.take_damage(fall_force)
else
if(L.mob_size <= fall_force / 5)
L.gib()
else
L.health -= fall_force
if(L.health <= 0)
L.gib()
if(isobj(A) && !istype(A, /obj/item/stack) && A != src)
var/obj/O = A
if(prob(fall_force * 0.75))
visible_message(SPAN_WARNING("\The [src] crushes \the [O] under its weight!"))
qdel(A)
new /obj/structure/flora/stump/log(fall_loc)
var/obj/item/stack/material/wood/branch/B = new(fall_loc)
B.amount = rand(5, 8)
new stumptype(get_turf(src))
qdel(src)
/obj/structure/flora/stump
name = "stump"
desc = "Nature's chair."
icon = 'icons/obj/wood.dmi'
icon_state = "tree_stump"
density = FALSE
anchored = TRUE
/obj/structure/flora/stump/can_dig()
return TRUE
/obj/structure/flora/stump/log
name = "big log"
desc = "A sideways tree, but dead. Chop this into useable logs!"
anchored = FALSE
icon_state = "timber"
/obj/structure/flora/stump/log/attackby(obj/item/I, mob/user)
if(I.can_woodcut())
if(cutting)
return
cutting = TRUE
var/chopsound = istype(I, /obj/item/material/twohanded/chainsaw) ? 'sound/weapons/saw/chainsawhit.ogg' : 'sound/effects/woodcutting.ogg'
playsound(get_turf(user), chopsound, 50, 1)
user.visible_message(SPAN_NOTICE("\The [user] begins chopping \the [src] into log sections."), SPAN_NOTICE("You begin chopping \the [src] into log sections."))
var/chopspeed = 1
if(istype(I, /obj/item/material/twohanded))
var/obj/item/material/twohanded/W = I
chopspeed = W.wielded ? 2 : 1
if(do_after(user, 100 / chopspeed))
user.visible_message(SPAN_NOTICE("\The [user] chops \the [src] into log sections."), SPAN_NOTICE("You chop \the [src] into log sections."))
var/obj/item/stack/material/wood/log/L = new(get_turf(src))
L.amount = rand(5, 8)
qdel(src)
cutting = FALSE
else
..()
/obj/structure/flora/tree/pine
name = "pine tree"
icon = 'icons/obj/flora/pinetrees.dmi'
icon_state = "pine_1"
/obj/structure/flora/tree/pine/New()
..()
icon_state = "pine_[rand(1, 3)]"
/obj/structure/flora/tree/pine/xmas
name = "xmas tree"
icon = 'icons/obj/flora/pinetrees.dmi'
icon_state = "pine_c"
/obj/structure/flora/tree/pine/xmas/New()
..()
icon_state = "pine_c"
/obj/structure/flora/tree/dead
icon = 'icons/obj/flora/deadtrees.dmi'
icon_state = "tree_1"
/obj/structure/flora/tree/dead/New()
..()
icon_state = "tree_[rand(1, 6)]"
/obj/structure/flora/tree/jungle/small/patience
name = "Patience"
desc = "A lush and healthy tree. A small golden plaque at its base reads its name, in plain text, Patience."
icon_state = "patiencebottom"
density = FALSE
layer = 3
/obj/structure/flora/tree/jungle/small/patience_top
name = "Patience"
desc = "A lush and healthy tree. A small golden plaque at its base reads its name, in plain text, Patience."
icon_state = "patiencetop"
density = TRUE
pixel_y = -32
/obj/structure/flora/tree/jungle/small/patience/Initialize()
. = ..()
var/turf/T = get_step(src, NORTH)
if(T)
new /obj/structure/flora/tree/jungle/small/patience_top(T)
// Rocks
/obj/structure/flora/rock
name = "rock"
desc = "A rock."
icon = 'icons/obj/flora/rocks_grey.dmi'
icon_state = "basalt"
/obj/structure/flora/rock/pile
name = "rocks"
desc = "A pile of rocks."
icon_state = "lavarocks"
/obj/structure/flora/rock/ice
name = "ice"
desc = "A large formation made of ice."
icon = 'icons/obj/flora/ice_rocks.dmi'
icon_state = "rock_1"
/obj/structure/flora/rock/ice/Initialize(mapload)
. = ..()
icon_state = "rock_[rand(1,2)]"
// Bushes, Flowers, and Grass
/obj/structure/flora/ausbushes
name = "bush"
desc = "A bush."
icon = 'icons/obj/flora/ausflora.dmi'
icon_state = "firstbush_1"
density = FALSE
/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)
/obj/structure/flora/ausbushes/reedbush
icon_state = "reedbush_1"
/obj/structure/flora/ausbushes/reedbush/New()
..()
icon_state = "reedbush_[rand(1, 4)]"
/obj/structure/flora/ausbushes/leafybush
icon_state = "leafybush_1"
/obj/structure/flora/ausbushes/leafybush/New()
..()
icon_state = "leafybush_[rand(1, 3)]"
/obj/structure/flora/ausbushes/palebush
icon_state = "palebush_1"
/obj/structure/flora/ausbushes/palebush/New()
..()
icon_state = "palebush_[rand(1, 4)]"
/obj/structure/flora/ausbushes/stalkybush
icon_state = "stalkybush_1"
/obj/structure/flora/ausbushes/stalkybush/New()
..()
icon_state = "stalkybush_[rand(1, 3)]"
/obj/structure/flora/ausbushes/grassybush
icon_state = "grassybush_1"
/obj/structure/flora/ausbushes/grassybush/New()
..()
icon_state = "grassybush_[rand(1, 4)]"
/obj/structure/flora/ausbushes/fernybush
icon_state = "fernybush_1"
/obj/structure/flora/ausbushes/fernybush/New()
..()
icon_state = "fernybush_[rand(1, 3)]"
/obj/structure/flora/ausbushes/sunnybush
icon_state = "sunnybush_1"
/obj/structure/flora/ausbushes/sunnybush/New()
..()
icon_state = "sunnybush_[rand(1, 3)]"
/obj/structure/flora/ausbushes/genericbush
icon_state = "genericbush_1"
/obj/structure/flora/ausbushes/genericbush/New()
..()
icon_state = "genericbush_[rand(1, 4)]"
/obj/structure/flora/ausbushes/pointybush
icon_state = "pointybush_1"
/obj/structure/flora/ausbushes/pointybush/New()
..()
icon_state = "pointybush_[rand(1, 4)]"
/obj/structure/flora/ausbushes/lavendergrass
icon_state = "lavendergrass_1"
/obj/structure/flora/ausbushes/lavendergrass/New()
..()
icon_state = "lavendergrass_[rand(1, 4)]"
/obj/structure/flora/ausbushes/ywflowers
icon_state = "ywflowers_1"
/obj/structure/flora/ausbushes/ywflowers/New()
..()
icon_state = "ywflowers_[rand(1, 3)]"
/obj/structure/flora/ausbushes/brflowers
icon_state = "brflowers_1"
/obj/structure/flora/ausbushes/brflowers/New()
..()
icon_state = "brflowers_[rand(1, 3)]"
/obj/structure/flora/ausbushes/ppflowers
icon_state = "ppflowers_1"
/obj/structure/flora/ausbushes/ppflowers/New()
..()
icon_state = "ppflowers_[rand(1, 4)]"
/obj/structure/flora/ausbushes/sparsegrass
icon_state = "sparsegrass_1"
/obj/structure/flora/ausbushes/sparsegrass/New()
..()
icon_state = "sparsegrass_[rand(1, 3)]"
/obj/structure/flora/ausbushes/fullgrass
icon_state = "fullgrass_1"
/obj/structure/flora/ausbushes/fullgrass/New()
..()
icon_state = "fullgrass_[rand(1, 3)]"
@@ -1,52 +0,0 @@
//tree
/obj/structure/flora/tree/grove
icon = 'icons/obj/flora/grove_trees.dmi'
icon_state = "grove_tree1"
/obj/structure/flora/tree/grove/New()
..()
icon_state = "grove_tree[rand(1, 6)]"
//bushes
/obj/structure/flora/bush/grove
icon = 'icons/obj/flora/groveflora.dmi'
icon_state = "grove_bush1"
anchored = 1
/obj/structure/flora/bush/grove/New()
..()
icon_state = "grove_bush[rand(1, 4)]"
//clutter
/obj/structure/flora/clutter
name = "clutter"
icon = 'icons/obj/flora/groveflora.dmi'
icon_state = "grove_clutter1"
anchored = 1
/obj/structure/flora/clutter/New()
..()
icon_state = "grove_clutter[rand(1, 9)]"
//stalks
/obj/structure/flora/stalks
name = "stalks"
icon = 'icons/obj/flora/groveflora.dmi'
icon_state = "grove_stalks"
anchored = 1
/obj/structure/flora/stalks/New()
..()
icon_state = "grove_stalks[rand(1, 2)]"
//bamboo
/obj/structure/flora/bamboo
name = "bamboo stalks"
icon = 'icons/obj/flora/groveflora.dmi'
icon_state = "grove_bamboo"
anchored = 1
/obj/structure/flora/stalks/New()
..()
icon_state = "grove_bamboo[rand(1, 3)]"
@@ -1,22 +0,0 @@
/obj/structure/flora/tree/jungle
name = "tree"
icon_state = "tree"
desc = "A lush and healthy tree."
icon = 'icons/obj/flora/jungletrees.dmi'
pixel_x = -48
pixel_y = -20
/obj/structure/flora/tree/jungle/small
pixel_y = 0
pixel_x = -32
icon = 'icons/obj/flora/jungletreesmall.dmi'
//Jungle grass
/obj/structure/flora/grass/jungle
name = "jungle grass"
desc = "Thick alien flora."
icon = 'icons/obj/flora/jungleflora.dmi'
icon_state = "grassa"
/obj/structure/flora/grass/jungle/b
icon_state = "grassb"
@@ -1,128 +0,0 @@
/obj/structure/flora/pottedplant
name = "potted plant"
desc = "A potted plant."
icon = 'icons/obj/plants.dmi'
icon_state = "plant-26"
anchored = FALSE
density = FALSE
var/dead = FALSE
var/obj/item/stored_item
/obj/structure/flora/pottedplant/Destroy()
QDEL_NULL(stored_item)
return ..()
/obj/structure/flora/pottedplant/proc/death()
if(!dead)
icon_state = "plant-dead"
name = "dead [name]"
desc = "A dead potted plant."
dead = TRUE
//No complex interactions, just make them fragile
/obj/structure/flora/pottedplant/ex_act(var/severity = 2.0)
death()
return ..()
/obj/structure/flora/pottedplant/fire_act()
death()
return ..()
/obj/structure/flora/pottedplant/attackby(obj/item/W, mob/user)
if(!ishuman(user))
return
if(istype(W, /obj/item/holder))
return //no hiding mobs in there
user.visible_message("[user] begins digging around inside of \the [src].", "You begin digging around in \the [src], trying to hide \the [W].")
playsound(loc, 'sound/effects/plantshake.ogg', 50, 1)
if(do_after(user, 20, act_target = src))
if(!stored_item)
if(W.w_class <= ITEMSIZE_NORMAL)
user.drop_from_inventory(W,src)
stored_item = W
to_chat(user,"<span class='notice'>You hide \the [W] in [src].</span>")
return
else
to_chat(user,"<span class='notice'>\The [W] can't be hidden in [src], it's too big.</span>")
return
else
to_chat(user,"<span class='notice'>There is something hidden in [src].</span>")
return
return ..()
/obj/structure/flora/pottedplant/attack_hand(mob/user)
user.visible_message("[user] begins digging around inside of \the [src].", "You begin digging around in \the [src], searching it.")
playsound(loc, 'sound/effects/plantshake.ogg', 50, 1)
if(do_after(user, 40, act_target = src))
if(!stored_item)
to_chat(user,"<span class='notice'>There is nothing hidden in [src].</span>")
else
if(istype(stored_item, /obj/item/device/paicard))
stored_item.forceMove(src.loc)
to_chat(user,"<span class='notice'>You reveal \the [stored_item] from [src].</span>")
else
user.put_in_hands(stored_item)
to_chat(user,"<span class='notice'>You take \the [stored_item] from [src].</span>")
stored_item = null
/obj/structure/flora/pottedplant/bullet_act(var/obj/item/projectile/Proj)
if (prob(Proj.damage*2))
death()
return 1
return ..()
// Added random icon selection for potted plants.
// It was silly they always used the same sprite when we have 26 sprites of them in the icon file.
/obj/structure/flora/pottedplant/random/New()
..()
var/number = rand(1,36)
if (number == 36)
if (prob(90)) // Make the weird one rarer
number = rand(1,35)
else if(!desc)
desc = "A half-sentient plant borne from a mishap in a Zeng-Hu genetics lab."
if(!desc)
switch(number) //Wezzy's cool new plant description code. Special thanks to Sindorman.
if(3)
desc = "A bouquet of Bieselite flora."
if(4)
desc = "A bamboo plant. Used widely in Japanese crafts."
if(5)
desc = "Some kind of fern."
if(7)
desc = "A reedy plant mostly used for decoration in Skrell homes, admired for its luxuriant stalks."
if(9)
desc = "A fleshy cave dwelling plant with huge nodules for flowers."
if(9)
desc = "A scrubby cactus adapted to the Moghes deserts."
if(13)
desc = "A hardy succulent adapted to the Moghes deserts."
if(14)
desc = "That's a huge flower. Previously, the petals would be used in dyes for unathi garb. Now it's more of a decorative plant."
if(15)
desc = "A pitiful pot of stubby flowers."
if(18)
desc = "An orchid plant. As beautiful as it is delicate."
if(19)
desc = "A ropey, aquatic plant with crystaline flowers."
if(20)
desc = "A bioluminescent half-plant half-fungus hybrid. Said to come from Sedantis I."
if(22)
desc = "A cone shrub. Sadly doesn't come from Coney Island."
if(26)
desc = "A bulrush. Commonly referred to as cattail."
if(27)
desc = "A rose bush. Don't prick yourself."
if(32)
desc = "A woody shrub."
if(33)
desc = "A woody shrub. Seems to be in need of watering."
if(34)
desc = "A woody shrub. This one seems to be in bloom. It's just like one of my japanese animes."
else
desc = "Just your common, everyday houseplant."
if (number < 10)
number = "0[number]"
icon_state = "plant-[number]"
@@ -1,39 +0,0 @@
// Grass
/obj/structure/flora/grass
name = "\proper grass"
desc = "Some grass."
icon = 'icons/obj/flora/snowflora.dmi'
density = FALSE
/obj/structure/flora/grass/brown
icon_state = "snowgrass1bb"
/obj/structure/flora/grass/brown/New()
..()
icon_state = "snowgrass[rand(1, 3)]bb"
/obj/structure/flora/grass/green
icon_state = "snowgrass1gb"
/obj/structure/flora/grass/green/New()
..()
icon_state = "snowgrass[rand(1, 3)]gb"
/obj/structure/flora/grass/both
icon_state = "snowgrassall1"
/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)]"
-32
View File
@@ -1,32 +0,0 @@
/obj/structure/monolith
name = "monolith"
desc = "An obviously artifical structure of unknown origin."
icon = 'icons/obj/monolith.dmi'
icon_state = "jaggy1"
layer = ABOVE_ALL_MOB_LAYER
density = TRUE
anchored = TRUE
var/active = FALSE
var/list/possible_colors = list("#232B2B", COLOR_ASTEROID_ROCK, COLOR_HULL)
/obj/structure/monolith/Initialize()
. = ..()
icon_state = "jaggy[rand(1,4)]"
if(!color)
color = pick(possible_colors)
update_icon()
/obj/structure/monolith/update_icon()
overlays.Cut()
if(active)
var/image/I = image(icon,"[icon_state]decor")
I.appearance_flags = RESET_COLOR
I.color = get_random_colour(0, 150, 255)
I.layer = EFFECTS_ABOVE_LIGHTING_LAYER
add_overlay(I)
set_light(0.3, 0.1, 2, l_color = I.color)
var/turf/simulated/floor/exoplanet/T = get_turf(src)
if(istype(T))
var/image/I = overlay_image(icon, "dugin", T.dirt_color, RESET_COLOR)
add_overlay(I)
-191
View File
@@ -1,191 +0,0 @@
/obj/structure/pit
name = "pit"
desc = "Watch your step, partner."
icon = 'icons/obj/pit.dmi'
icon_state = "pit1"
blend_mode = BLEND_MULTIPLY
density = FALSE
anchored = TRUE
var/open = 1
/obj/structure/pit/attackby(obj/item/W, mob/user)
if(istype(W,/obj/item/shovel))
visible_message("<span class='notice'>\The [user] starts [open ? "filling" : "digging open"] \the [src]</span>")
if(W.use_tool(src, user, 50, volume = 50))
visible_message("<span class='notice'>\The [user] [open ? "fills" : "digs open"] \the [src]!</span>")
if(open)
close(user)
else
open()
else
to_chat(user, "<span class='notice'>You stop shoveling.</span>")
return
if (!open && istype(W,/obj/item/stack/material/wood))
if(locate(/obj/structure/gravemarker) in src.loc)
to_chat(user, "<span class='notice'>There's already a grave marker here.</span>")
else
visible_message("<span class='notice'>\The [user] starts making a grave marker on top of \the [src]</span>")
if( do_after(user, 50) )
visible_message("<span class='notice'>\The [user] finishes the grave marker</span>")
var/obj/item/stack/material/wood/plank = W
plank.use(1)
new/obj/structure/gravemarker(src.loc)
else
to_chat(user, "<span class='notice'>You stop making a grave marker.</span>")
return
..()
/obj/structure/pit/update_icon()
icon_state = "pit[open]"
if(istype(loc,/turf/simulated/floor/exoplanet))
var/turf/simulated/floor/exoplanet/E = loc
if(E.dirt_color)
color = E.dirt_color
/obj/structure/pit/proc/open()
name = "pit"
desc = "Watch your step, partner."
open = 1
for(var/atom/movable/A in src)
A.forceMove(src.loc)
update_icon()
/obj/structure/pit/proc/close(var/user)
name = "mound"
desc = "Some things are better left buried."
open = 0
for(var/atom/movable/A in src.loc)
if(!A.anchored && A != user)
A.forceMove(src)
update_icon()
/obj/structure/pit/return_air()
if(open && loc)
return loc.return_air()
/obj/structure/pit/proc/digout(mob/escapee)
var/breakout_time = 1 //2 minutes by default
if(open)
return
if(escapee.stat || escapee.restrained())
return
escapee.setClickCooldown(100)
to_chat(escapee, "<span class='warning'>You start digging your way out of \the [src] (this will take about [breakout_time] minute\s)</span>")
visible_message("<span class='danger'>Something is scratching its way out of \the [src]!</span>")
for(var/i in 1 to (6*breakout_time * 2)) //minutes * 6 * 5seconds * 2
playsound(src.loc, 'sound/weapons/bite.ogg', 100, 1)
if(!do_after(escapee, 50))
to_chat(escapee, "<span class='warning'>You have stopped digging.</span>")
return
if(open)
return
if(i == 6*breakout_time)
to_chat(escapee, "<span class='warning'>Halfway there...</span>")
to_chat(escapee, "<span class='warning'>You successfuly dig yourself out!</span>")
visible_message("<span class='danger'>\the [escapee] emerges from \the [src]!</span>")
playsound(src.loc, 'sound/effects/squelch1.ogg', 100, 1)
open()
/obj/structure/pit/Crossed(AM as mob|obj)
for(var/obj/item/landmine/I in contents)
I.Crossed(AM, TRUE)
..()
/obj/structure/pit/closed
name = "mound"
desc = "Some things are better left buried."
open = FALSE
/obj/structure/pit/closed/Initialize()
. = ..()
close()
//invisible until unearthed first
/obj/structure/pit/closed/hidden
invisibility = INVISIBILITY_OBSERVER
/obj/structure/pit/closed/hidden/open()
..()
set_invisibility(INVISIBILITY_LEVEL_ONE)
//buried land mines
/obj/structure/pit/landmine
name = "mound"
desc = "Some things are better left buried."
open = FALSE
var/landmine_prob = 25
/obj/structure/pit/landmine/Initialize()
. = ..()
if(prob(landmine_prob))
new /obj/item/landmine(src)
close()
/obj/structure/pit/landmine/hidden
invisibility = INVISIBILITY_OBSERVER
/obj/structure/pit/landmine/hidden/open()
..()
set_invisibility(INVISIBILITY_LEVEL_ONE)
//spoooky
/obj/structure/pit/closed/grave
name = "grave"
icon_state = "pit0"
/obj/structure/pit/closed/grave/Initialize()
var/obj/structure/closet/crate/coffin/C = new(src.loc)
var/obj/effect/decal/remains/human/bones = new(C)
bones.layer = BELOW_MOB_LAYER
var/obj/structure/gravemarker/random/R = new(src.loc)
R.generate()
. = ..()
/obj/structure/gravemarker
name = "grave marker"
desc = "You're not the first."
icon = 'icons/obj/gravestone.dmi'
icon_state = "wood"
pixel_x = 15
pixel_y = 8
anchored = TRUE
var/message = "Unknown."
/obj/structure/gravemarker/cross
icon_state = "cross"
/obj/structure/gravemarker/examine(mob/user)
. = ..()
to_chat(user, "It says: '[message]'")
/obj/structure/gravemarker/random/Initialize()
generate()
. = ..()
/obj/structure/gravemarker/random/proc/generate()
icon_state = pick("wood","cross")
var/nam = random_name(MALE, SPECIES_HUMAN)
message = "Here lies [nam]."
/obj/structure/gravemarker/attackby(obj/item/W, mob/user)
if(istype(W,/obj/item/material/hatchet))
visible_message("<span class = 'warning'>\The [user] starts hacking away at \the [src] with \the [W].</span>")
if(!do_after(user, 30))
visible_message("<span class = 'warning'>\The [user] hacks \the [src] apart.</span>")
new /obj/item/stack/material/wood(src)
qdel(src)
if(istype(W,/obj/item/pen))
var/msg = sanitize(input(user, "What should it say?", "Grave marker", message) as text|null)
if(msg)
message = msg