diff --git a/code/modules/crafting/forging/forge_anvil.dm b/code/modules/crafting/forging/forge_anvil.dm index 00a7524efe8..eab2574a5e6 100644 --- a/code/modules/crafting/forging/forge_anvil.dm +++ b/code/modules/crafting/forging/forge_anvil.dm @@ -1,14 +1,15 @@ /obj/structure/anvil - name = "anvil" - desc = "A heavy block of material used as support for hammering things into shape." - icon = 'icons/obj/structures/anvil.dmi' - icon_state = ICON_STATE_WORLD - anchored = TRUE - density = TRUE - opacity = FALSE - atom_flags = ATOM_FLAG_CLIMBABLE - w_class = ITEM_SIZE_STRUCTURE //_LARGE - material = /decl/material/solid/metal/iron + name = "anvil" + desc = "A heavy block of material used as support for hammering things into shape." + icon = 'icons/obj/structures/anvil.dmi' + icon_state = ICON_STATE_WORLD + anchored = TRUE + density = TRUE + opacity = FALSE + atom_flags = ATOM_FLAG_CLIMBABLE + w_class = ITEM_SIZE_STRUCTURE //_LARGE + material = /decl/material/solid/metal/iron + max_health = 1000 structure_flags = STRUCTURE_FLAG_SURFACE material_alteration = MAT_FLAG_ALTERATION_ALL @@ -48,8 +49,18 @@ . = ..() +// Chipped out of a boulder with a pick. /obj/structure/anvil/boulder - name_prefix = "crude" - icon = 'icons/obj/structures/anvil_crude.dmi' - desc = "A crude anvil chipped out of a chunk of stone. It probably won't last very long." - material = /decl/material/solid/stone/granite + name_prefix = "crude" + icon = 'icons/obj/structures/anvil_crude.dmi' + desc = "A crude anvil chipped out of a chunk of stone. It probably won't last very long." + material = /decl/material/solid/stone/granite + max_health = 500 + +// Improvised with spaceman materials. +/obj/structure/anvil/improvised + name_prefix = "improvised" + icon = 'icons/obj/structures/anvil_crude.dmi' // anvil_improvised.dmi' + desc = "A anvil roughly improvised out of scrap metal. It probably won't last very long." + material = /decl/material/solid/metal/steel + max_health = 500 diff --git a/code/modules/crafting/forging/forge_billet.dm b/code/modules/crafting/forging/forge_billet.dm index 3ea9f79dbfb..089761a1eb5 100644 --- a/code/modules/crafting/forging/forge_billet.dm +++ b/code/modules/crafting/forging/forge_billet.dm @@ -1,8 +1,8 @@ /obj/item/billet - name = "billet" - desc = "An unworked or partially-worked length of metal used to forge items and tools." - icon = 'icons/obj/items/billet.dmi' - icon_state = ICON_STATE_WORLD + name = "billet" + desc = "An unworked or partially-worked length of metal used to forge items and tools." + icon = 'icons/obj/items/billet.dmi' + icon_state = ICON_STATE_WORLD material_alteration = MAT_FLAG_ALTERATION_ALL var/decl/forging_step/current_forging_step = /decl/forging_step/billet @@ -90,6 +90,9 @@ var/obj/item/forged_thing = set_forging_step(next_step) if(istype(forged_thing)) user.visible_message(SPAN_NOTICE("\The [user] has [next_action.work_verb] the billet into \a [forged_thing].")) + // Forging gradually degrades anvils. + if(!QDELETED(anvil)) + anvil.take_damage(rand(10, 20), BRUTE) return TRUE /obj/item/billet/examine(mob/user, distance, infix, suffix) @@ -102,15 +105,12 @@ /obj/item/billet/proc/standard_forging_checks(mob/user, obj/item/used_item, decl/forging_step/last_step, decl/forging_action/next_action, obj/structure/anvil/anvil) // We cancelled or changed state, abort. if(!next_action || current_forging_step != last_step || !(next_action in current_forging_step.steps)) - world << "fail 1 ![next_action] || [current_forging_step] != [last_step] || !([next_action] in [current_forging_step.steps])" return FALSE // Something has been destroyed since we started forging. if(QDELETED(src) || QDELETED(used_item) || QDELETED(anvil) || QDELETED(user)) - world << "fail 2 qdel" return FALSE // Something else has changed, very unfortunate. if(loc != anvil.loc || !CanPhysicallyInteract(user) || user.get_active_held_item() != used_item) - world << "fail 3 loc" return FALSE return hot_enough_to_forge() diff --git a/code/modules/crafting/stack_recipes/recipes_steel.dm b/code/modules/crafting/stack_recipes/recipes_steel.dm index 9befbe3d3f1..534e362bfc8 100644 --- a/code/modules/crafting/stack_recipes/recipes_steel.dm +++ b/code/modules/crafting/stack_recipes/recipes_steel.dm @@ -116,3 +116,7 @@ /decl/stack_recipe/steel/furniture/target_stake result_type = /obj/structure/target_stake difficulty = MAT_VALUE_NORMAL_DIY + +/decl/stack_recipe/steel/furniture + result_type = /obj/structure/anvil/improvised + difficulty = MAT_VALUE_HARD_DIY diff --git a/code/modules/xenoarcheaology/boulder.dm b/code/modules/xenoarcheaology/boulder.dm index ba7a38c2f3d..fe2ab49f360 100644 --- a/code/modules/xenoarcheaology/boulder.dm +++ b/code/modules/xenoarcheaology/boulder.dm @@ -98,3 +98,27 @@ var/mob/living/silicon/robot/R = AM if(IS_PICK(R.module_active)) attackby(R.module_active,R) + +/obj/structure/boulder/get_alt_interactions(mob/user) + . = ..() + LAZYADD(., /decl/interaction_handler/chip_anvil) + +/decl/interaction_handler/chip_anvil + name = "Chip Into Anvil" + expected_target_type = /obj/structure/boulder + var/work_skill = SKILL_CONSTRUCTION + +/decl/interaction_handler/chip_anvil/is_possible(atom/target, mob/user, obj/item/prop) + . = ..() && istype(prop) && IS_PICK(prop) && prop.material?.hardness >= target.get_material()?.hardness && user.skill_check(work_skill, SKILL_BASIC) + +/decl/interaction_handler/chip_anvil/invoked(atom/target, mob/user, obj/item/prop) + user.visible_message(SPAN_NOTICE("\The [user] begins chipping \the [target] into a rough anvil using \the [prop].")) + if(!user.do_skilled(10 SECONDS, work_skill, target)) + return FALSE + if(QDELETED(user) || QDELETED(target) || QDELETED(prop) || user.get_active_held_item() != prop || !CanPhysicallyInteractWith(user, target)) + return FALSE + if(!is_possible(target, user, prop)) + return FALSE + user.visible_message(SPAN_NOTICE("\The [user] chips \the [target] into a rough anvil using \the [prop].")) + new /obj/structure/anvil/boulder(get_turf(target), target.get_material()?.type) + return TRUE