Skip to content

Commit

Permalink
New Primitive Tool + Iron Rods Can Be Melted (#868) (#1966)
Browse files Browse the repository at this point in the history
* New Primitive Tool + Iron Rods Can Be Melted

* Update modular_nova/modules/reagent_forging/code/forge.dm



* Update modular_nova/modules/reagent_forging/code/forge.dm



* Update modular_nova/modules/reagent_forging/code/forge.dm



* Update modular_nova/modules/reagent_forging/code/forge.dm



* Update modular_nova/modules/reagent_forging/code/forge.dm



* Update modular_nova/modules/reagent_forging/code/forge.dm



* fix iron rod result + consumption amount

---------

Co-authored-by: MortoSasye <[email protected]>
Co-authored-by: GoldenAlpharex <[email protected]>
Co-authored-by: Bloop <[email protected]>
  • Loading branch information
4 people authored Feb 13, 2024
1 parent c83ac97 commit d824890
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 0 deletions.
15 changes: 15 additions & 0 deletions modular_nova/modules/ashwalkers/code/items/ash_surgery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,18 @@
/datum/crafting_recipe/ash_recipe/ash_hemostat
name = "Ash Hemostat"
result = /obj/item/hemostat/ashwalker

/obj/item/bonesetter/ashwalker
name = "primitive bonesetter"
icon = 'modular_nova/modules/ashwalkers/icons/ashwalker_tools.dmi'
icon_state = "bonesetter"

greyscale_colors = null
greyscale_config = null
greyscale_config_inhand_left = null
greyscale_config_inhand_right = null
greyscale_config_worn = null

/datum/crafting_recipe/ash_recipe/ash_bonesetter
name = "Ash Bonesetter"
result = /obj/item/bonesetter/ashwalker
Binary file modified modular_nova/modules/ashwalkers/icons/ashwalker_tools.dmi
Binary file not shown.
46 changes: 46 additions & 0 deletions modular_nova/modules/reagent_forging/code/forge.dm
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,12 @@
handle_metal_cup_melting(attacking_item, user)
return TRUE

if(istype(attacking_item, /obj/item/stack/rods))
in_use = TRUE
smelt_iron_rods(attacking_item, user)
in_use = FALSE
return TRUE

return ..()

/// Take the given tray and place it inside the forge, updating everything relevant to that
Expand Down Expand Up @@ -740,6 +746,46 @@
COOLDOWN_START(spawned_glass, remaining_heat, glassblowing_amount)
spawned_glass.total_time = glassblowing_amount

/// Almost a copy from the proc smelt_ore but to smelt iron rods
/obj/structure/reagent_forge/proc/smelt_iron_rods(obj/attacking_item, mob/living/user)

var/obj/item/stack/rods/rod_item = attacking_item

if(!istype(rod_item))
return

if(forge_temperature < MIN_FORGE_TEMP)
fail_message(user, "forge too cool")
return

var/skill_modifier = user.mind.get_skill_modifier(/datum/skill/smithing, SKILL_SPEED_MODIFIER)

if(rod_item.amount < 2)
fail_message(user, "too few iron rods to smelt")
return

balloon_alert_to_viewers("smelting...")

if(!do_after(user, skill_modifier * 3 SECONDS, target = src))
fail_message(user, "stopped smelting [rod_item]")
return

var/src_turf = get_turf(src)
var/spawning_item = /obj/item/stack/sheet/iron
var/rods_to_sheet_amount = round((rod_item.amount / 2))
var/used_rods = rod_item.amount

if(ISODD(used_rods))
used_rods = used_rods - 1

rod_item.use(used_rods)
var/obj/item/stack/sheet/iron/result = new spawning_item(src_turf)

if(rods_to_sheet_amount > 1)
result.add(rods_to_sheet_amount - 1)

balloon_alert_to_viewers("finished smelting!")

/obj/structure/reagent_forge/billow_act(mob/living/user, obj/item/tool)
if(in_use) // Preventing billow use if the forge is in use to prevent spam
fail_message(user, "forge busy")
Expand Down

0 comments on commit d824890

Please sign in to comment.