From 4e15c5e751afe841d2531fcb4709d528cac44d87 Mon Sep 17 00:00:00 2001 From: KathrinBailey <53862927+KathrinBailey@users.noreply.github.com> Date: Mon, 10 May 2021 14:48:57 +0100 Subject: [PATCH] Stone walls & Mineable ore veins (#5498) * all the stuff! * Additional check for mining ore * Cleans up the file I usually make messy files and separate stuff out, makes it easier for me to look at. I probably should neaten up again... * Apply suggestions from code review Co-authored-by: Gandalf * adds examine tip and more ore veins Co-authored-by: Gandalf --- code/__DEFINES/icon_smoothing.dm | 1 + .../modules/stone/code/ore_veins.dm | 134 ++++++++++++++++++ modular_skyrat/modules/stone/code/stone.dm | 79 +++++++++++ modular_skyrat/modules/stone/icons/ore.dmi | Bin 0 -> 3370 bytes modular_skyrat/modules/stone/icons/wall.dmi | Bin 0 -> 3060 bytes tgstation.dme | 2 + 6 files changed, 216 insertions(+) create mode 100644 modular_skyrat/modules/stone/code/ore_veins.dm create mode 100644 modular_skyrat/modules/stone/code/stone.dm create mode 100644 modular_skyrat/modules/stone/icons/ore.dmi create mode 100644 modular_skyrat/modules/stone/icons/wall.dmi diff --git a/code/__DEFINES/icon_smoothing.dm b/code/__DEFINES/icon_smoothing.dm index bb7c61f8390..e1edb67d048 100644 --- a/code/__DEFINES/icon_smoothing.dm +++ b/code/__DEFINES/icon_smoothing.dm @@ -95,6 +95,7 @@ DEFINE_BITFIELD(smoothing_flags, list( #define SMOOTH_GROUP_SURVIVAL_TIANIUM_POD S_OBJ(14) ///turf/closed/wall/mineral/titanium/survival/pod, /obj/machinery/door/airlock/survival_pod, /obj/structure/window/shuttle/survival_pod #define SMOOTH_GROUP_HIERO_WALL S_OBJ(15) ///obj/effect/temp_visual/elite_tumor_wall, /obj/effect/temp_visual/hierophant/wall +#define SMOOTH_GROUP_STONE_WALLS S_OBJ(19) ///turf/closed/wall/mineral/stone, /obj/structure/falsewall/stone // SKYRAT EDIT: Adds stone #define SMOOTH_GROUP_PAPERFRAME S_OBJ(20) ///obj/structure/window/paperframe, /obj/structure/mineral_door/paperframe #define SMOOTH_GROUP_WINDOW_FULLTILE S_OBJ(21) ///turf/closed/indestructible/fakeglass, /obj/structure/window/fulltile, /obj/structure/window/reinforced/fulltile, /obj/structure/window/reinforced/tinted/fulltile, /obj/structure/window/plasma/fulltile, /obj/structure/window/plasma/reinforced/fulltile diff --git a/modular_skyrat/modules/stone/code/ore_veins.dm b/modular_skyrat/modules/stone/code/ore_veins.dm new file mode 100644 index 00000000000..1cf6881889e --- /dev/null +++ b/modular_skyrat/modules/stone/code/ore_veins.dm @@ -0,0 +1,134 @@ +/obj/structure/ore_vein + name = "ore vein" + desc = "An ore vein that can mined." + icon = 'modular_skyrat/modules/stone/icons/ore.dmi' + icon_state = "stone" + density = TRUE + anchored = TRUE + /// When we start mining, what do we tell the user they're mining? + var/ore_descriptor = "stone" + /// What type of ore do we drop? + var/ore_type = /obj/item/stack/ore/stone + /// How much ore do we drop? + var/ore_amount = 1 + /// If the ore vein has been recently mined. If so, we cannot mine and must wait for it to regenerate. + var/depleted = FALSE + /// How long it takes for the ore to 'respawn' after being mined. + var/regeneration_time = 15 SECONDS + /// How long it takes for a tool to mine the ore vein. + var/mining_time = 3 SECONDS + /// How many unique sprites for ore we have, we will pick them at random. + var/unique_sprites = 1 + /// If we should pick a random sprite for the ore vein or not. + var/random_sprite = TRUE + /// Our original description to hold. We'll revert to this when switching between the ore vein being depleted and not. + var/base_desc = "" + +/obj/structure/ore_vein/Initialize() + . = ..() + base_desc = desc + if(random_sprite == TRUE) + icon_state += "[rand(1, (unique_sprites))]" + base_icon_state = icon_state + +/obj/structure/ore_vein/update_icon_state() + . = ..() + if(depleted == TRUE) + icon_state = "[base_icon_state]_depleted" + else + icon_state = "[base_icon_state]" + +/obj/structure/ore_vein/examine() + . = ..() + . += "[depleted ? "The ore vein is exhausted." : ""]" + +/obj/structure/ore_vein/attackby(obj/item/W, mob/user, params) + if(W.tool_behaviour != TOOL_MINING) + to_chat(user, "You need a pickaxe to mine this.") + return FALSE + if(!ore_type) + to_chat(user, "There's no ore to mine!") + return FALSE + if(!ore_amount) + to_chat(user, "The [src] is too low quality to yield any useful amount of [ore_descriptor].") + return FALSE + if(depleted == TRUE) + to_chat(user, "This ore vein is exhausted.") + return FALSE +// Our early return checks to tell the user what went wrong. + to_chat(user, "You start mining the [ore_descriptor]...") + if(W.use_tool(src, user, src.mining_time, volume=50)) + to_chat(user, "You mine the [ore_descriptor].") + if(ore_type && ore_amount && depleted == FALSE) + new ore_type(loc, ore_amount) + SSblackbox.record_feedback("tally", "pick_used_mining", 1, W.type) + depleted = TRUE + update_icon_state() + addtimer(CALLBACK(src, .proc/regenerate_ore), regeneration_time) + +// After the ore vein finishes its wait, we make the ore 'respawn' and return the ore to its original post-Initialize() icon_state. +/obj/structure/ore_vein/proc/regenerate_ore() + depleted = FALSE + update_icon_state() + +/obj/structure/ore_vein/stone + name = "stone mine" + desc = "High-quality stone that once mined and refined, creates a robust construction material." + icon_state = "stone" + ore_type = /obj/item/stack/ore/stone + ore_amount = 1 + unique_sprites = 2 + +/obj/structure/ore_vein/iron + name = "iron mine" + desc = "An iron ore vein!" + icon_state = "iron" + ore_descriptor = "iron" + ore_type = /obj/item/stack/ore/iron + ore_amount = 1 + unique_sprites = 2 + mining_time = 5 SECONDS + +/obj/structure/ore_vein/silver + name = "silver mine" + desc = "Silver! In demand for more than it's beautiful lustre." + icon_state = "silver" + ore_descriptor = "silver" + ore_type = /obj/item/stack/ore/silver + ore_amount = 1 + unique_sprites = 1 + mining_time = 10 SECONDS + regeneration_time = 20 SECONDS + +/obj/structure/ore_vein/gold + name = "gold mine" + desc = "Precious shiny gold! A vital component for goods like electronics all the way to un-manned space vehicles." + icon_state = "gold" + ore_descriptor = "gold" + ore_type = /obj/item/stack/ore/gold + ore_amount = 1 + unique_sprites = 2 + mining_time = 10 SECONDS + regeneration_time = 20 SECONDS + +/obj/structure/ore_vein/plasma + name = "plasma mine" + desc = "Solid plasma! It's rather common." + icon_state = "plasma" + ore_descriptor = "plasma" + ore_type = /obj/item/stack/ore/plasma + ore_amount = 1 + unique_sprites = 1 + mining_time = 5 SECONDS + regeneration_time = 20 SECONDS + +/obj/structure/ore_vein/diamond + name = "diamond mine" + desc = "Diamond! It's rare and its industrial applications keep it very valuable." + icon_state = "diamond" + ore_descriptor = "diamond" + ore_type = /obj/item/stack/ore/diamond + ore_amount = 1 + unique_sprites = 2 + mining_time = 30 SECONDS + regeneration_time = 120 SECONDS diff --git a/modular_skyrat/modules/stone/code/stone.dm b/modular_skyrat/modules/stone/code/stone.dm new file mode 100644 index 00000000000..10dc0ddd708 --- /dev/null +++ b/modular_skyrat/modules/stone/code/stone.dm @@ -0,0 +1,79 @@ +/obj/item/stack/sheet/mineral/stone + name = "stone" + desc = "Stone brick." + singular_name = "stone block" + icon = 'modular_skyrat/modules/stone/icons/ore.dmi' + icon_state = "sheet-stone" + inhand_icon_state = "sheet-metal" + mats_per_unit = list(/datum/material/stone=MINERAL_MATERIAL_AMOUNT) + throwforce = 10 +// flags_1 = null + resistance_flags = FIRE_PROOF + merge_type = /obj/item/stack/sheet/mineral/stone + grind_results = null + point_value = 0 +// tableVariant = /obj/structure/table/stone + material_type = /datum/material/stone + matter_amount = 0 +// cost = 500 + source = null + +/datum/material/stone + name = "stone" + desc = "It's stone." + categories = list(MAT_CATEGORY_ORE = TRUE, MAT_CATEGORY_RIGID = TRUE, MAT_CATEGORY_BASE_RECIPES = TRUE, MAT_CATEGORY_ITEM_MATERIAL=TRUE) + sheet_type = /obj/item/stack/sheet/mineral/stone + value_per_unit = 0.005 + beauty_modifier = 0.01 + +/obj/item/stack/ore/stone + name = "unrefined stone" + desc = "Chunks of high-quality stone. This could be cut into bricks to form a really good building material." + icon = 'modular_skyrat/modules/stone/icons/ore.dmi' + icon_state = "stone_ore" + inhand_icon_state = "Iron ore" + singular_name = "unrefined stone chunk" + points = 1 + mats_per_unit = list(/datum/material/stone=MINERAL_MATERIAL_AMOUNT) + refined_type = /obj/item/stack/sheet/mineral/stone + mine_experience = 1 + scan_state = null + spreadChance = 20 + merge_type = /obj/item/stack/ore/stone + +/turf/closed/wall/mineral/stone + name = "stone wall" + desc = "A wall made of solid stone brick." + icon = 'modular_skyrat/modules/stone/icons/wall.dmi' + icon_state = "wall-0" + base_icon_state = "wall" + sheet_type = /obj/item/stack/sheet/mineral/stone + slicing_duration = 1.5 SECONDS //literal rock + explosion_block = 2 + smoothing_flags = SMOOTH_BITMASK + smoothing_groups = list(SMOOTH_GROUP_CLOSED_TURFS, SMOOTH_GROUP_WALLS, SMOOTH_GROUP_STONE_WALLS) + canSmoothWith = list(SMOOTH_GROUP_STONE_WALLS) + custom_materials = list(/datum/material/stone = 4000) + +/turf/closed/indestructible/stone + name = "stone wall" + desc = "A wall made of solid stone brick." + icon = 'modular_skyrat/modules/stone/icons/wall.dmi' + icon_state = "wall-0" + base_icon_state = "wall" + smoothing_flags = SMOOTH_BITMASK + smoothing_groups = list(SMOOTH_GROUP_CLOSED_TURFS, SMOOTH_GROUP_WALLS, SMOOTH_GROUP_STONE_WALLS) + canSmoothWith = list(SMOOTH_GROUP_STONE_WALLS) + custom_materials = list(/datum/material/stone = 4000) + +/obj/structure/falsewall/stone + name = "stone wall" + desc = "A wall made of solid stone brick." + icon = 'modular_skyrat/modules/stone/icons/wall.dmi' + icon_state = "wall-0" + base_icon_state = "wall" + mineral = /obj/item/stack/sheet/mineral/stone + walltype = /turf/closed/wall/mineral/stone + smoothing_flags = SMOOTH_BITMASK + smoothing_groups = list(SMOOTH_GROUP_CLOSED_TURFS, SMOOTH_GROUP_WALLS, SMOOTH_GROUP_STONE_WALLS) + canSmoothWith = list(SMOOTH_GROUP_STONE_WALLS) diff --git a/modular_skyrat/modules/stone/icons/ore.dmi b/modular_skyrat/modules/stone/icons/ore.dmi new file mode 100644 index 0000000000000000000000000000000000000000..116a36a7c81b0392c6fd9d2999877e2463b0e5ba GIT binary patch literal 3370 zcmV+_4b}3AP)005u}0{{R3yb+fl0001BP)t-sz`(#Z zH#(r8piW0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YIuwK$J`kN}Ukg#@;oO0!fe_A2Hy zEtNz!kVXo0BKW1(T-W4e6C$$=D<)hAW7`|-4Va_MS52z4MiE+WIgd_!as_eV+KSGi zF{icVGS`ZiR?+8mvd)=w(YeVGKLB1=?2o_x=F}xvkEe-aadS60LZ`=mL$q9U0AjzO zcg1kB6A1$}Hj$;L!!KhP(KcFX6MF?RsL6b0KR|Bm=rDXbJRc!=Dd8x`!Byz5)fo5Y z2AR10SB1atf6B7xh+DgA!0Fh$8ek1nFdO55@k;MX_-A*D~Zezr#XFNHZE^` zG_EyuEL{p%&JAPmVch7}P^|LK`|u|g-B!Hg#9-)DYkK|orN#&Up+CSpOFn0gn~mHd zPlrbC!OgE=`A=5G0ds&o@?V(I+lY1X=1{D0$G4jNZf4dN<|`PwL#_M{OXjPti$7c= zw<{%E)SGcgI8vga*3DfwpKXO1K8S~%s>`HhjWd;bnEC(KU~2<5Ny(U->6)9E?eZCh UF)Dsa@G}>(G_^7*#5t4y17Y^}IRF3v literal 0 HcmV?d00001 diff --git a/tgstation.dme b/tgstation.dme index 34145743242..3fe16b2e8a3 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -4272,6 +4272,8 @@ #include "modular_skyrat\modules\specborg\code\game\objects\items\cyborg_items.dm" #include "modular_skyrat\modules\specborg\code\modules\living\sillicon\robot\robot_module.dm" #include "modular_skyrat\modules\ssd_indicator\code\mob.dm" +#include "modular_skyrat\modules\stone\code\ore_veins.dm" +#include "modular_skyrat\modules\stone\code\stone.dm" #include "modular_skyrat\modules\stock_market\code\articles.dm" #include "modular_skyrat\modules\stock_market\code\computer.dm" #include "modular_skyrat\modules\stock_market\code\computer_circuitboards.dm"