Skip to content

Commit

Permalink
Merge pull request #2975 from EtheoBoxxman/smith-expansion
Browse files Browse the repository at this point in the history
Adds dusters and claws unarmed weapons to smithing
  • Loading branch information
Tk420634 authored Sep 5, 2023
2 parents 9e19716 + ac77cd8 commit c43d3dc
Show file tree
Hide file tree
Showing 5 changed files with 129 additions and 161 deletions.
1 change: 0 additions & 1 deletion code/game/objects/items/melee/f13onehanded.dm
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,6 @@ obj/item/melee/onehanded/knife/switchblade
item_state = "brass"
attack_verb = list("punched", "jabbed", "whacked")
force = 26
custom_materials = list(/datum/material/iron = 2000)

// Spiked knuckles Keywords: Damage 28
/obj/item/melee/unarmed/brass/spiked
Expand Down
179 changes: 19 additions & 160 deletions code/modules/smithing/anvil.dm
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
#define RECIPE_SPATHA "Papercutter Blade"
#define RECIPE_WARHONED "Sledge Axe Head"

#define RECIPE_KNUCKLES "Duster Lump"
#define RECIPE_CLAWS "Sharp Prongs"

GLOBAL_LIST_INIT(anvil_recipes, list(
RECIPE_HAMMER = /obj/item/smithing/hammerhead,
RECIPE_SHOVEL = /obj/item/smithing/shovelhead,
Expand Down Expand Up @@ -72,7 +75,10 @@ GLOBAL_LIST_INIT(anvil_recipes, list(
RECIPE_TRIDENT = /obj/item/smithing/tridenthead,
RECIPE_LONGSWORD = /obj/item/smithing/longswordblade,
RECIPE_SAW = /obj/item/smithing/sawblade,
RECIPE_BOWIE = /obj/item/smithing/bowieblade))
RECIPE_BOWIE = /obj/item/smithing/bowieblade,
RECIPE_KNUCKLES = /obj/item/smithing/unarmed/knuckles,
RECIPE_CLAWS = /obj/item/smithing/unarmed/claws,
))

/obj/structure/anvil
name = "anvil"
Expand Down Expand Up @@ -220,7 +226,9 @@ GLOBAL_LIST_INIT(anvil_recipes, list(
"Lance Head",
"Razorbar Blade",
"Papercutter Blade",
"Sledge Axe Head"
"Sledge Axe Head",
"Sharp Prongs",
"Duster Lump"
) //weak/strong/heavy hit affect strength. All the other steps shape.
var/stepdone = input(user, "How would you like to work the metal?") in shapingsteps

Expand All @@ -232,163 +240,6 @@ GLOBAL_LIST_INIT(anvil_recipes, list(

// Time it takes for us to uh...forge..?
var/steptime = 1 SECONDS
switch(stepdone)
if("Pickaxe Head")
playsound(src, 'code/modules/smithing/sound/anvil_strong.ogg',30)
do_smithing_sparks(1, TRUE, src)
user.visible_message("<span class='notice'>[user] hammers out imperfections in the metal.</span>", \
"<span class='notice'>You hammer out imperfections in the metal.</span>")
if("Shovel Head")
playsound(src, 'code/modules/smithing/sound/anvil_heavy.ogg',30)
do_smithing_sparks(2, TRUE, src)
user.visible_message("<span class='notice'>[user] forcefully hammers out imperfections in the metal.</span>", \
"<span class='notice'>You forcefuly hammer out imperfections in the metal.</span>")
if("Hammer Head")
playsound(src, 'code/modules/smithing/sound/anvil_double1.ogg',30)
do_smithing_sparks(1, TRUE, src)
user.visible_message("<span class='notice'>[user] folds the metal.</span>", \
"<span class='notice'>You fold the metal.</span>")
if("Prospecting Pick Head")
playsound(src, 'code/modules/smithing/sound/anvil_double2.ogg',30)
do_smithing_sparks(1, TRUE, src)
user.visible_message("<span class='notice'>[user] hammers both sides of the metal, drawing it out.</span>", \
"<span class='notice'>You hammer both sides of the metal, drawing it out.</span>")
if("Kitchen Knife Blade")
playsound(src, 'code/modules/smithing/sound/anvil_rapid.ogg',30)
do_smithing_sparks(1, TRUE, src)
user.visible_message("<span class='notice'>[user] flattens the metal, shrinking it.</span>", \
"<span class='notice'>You flatten the metal, shrinking it.</span>")
if("Crowbar")
playsound(src, 'code/modules/smithing/sound/anvil_single1.ogg',30)
do_smithing_sparks(1, TRUE, src)
user.visible_message("<span class='notice'>[user] bends the metal, using the rounded end of the anvil.</span>", \
"<span class='notice'>You bend the metal, using the rounded end of the anvil.</span>")
if("Crowbaxe")
playsound(src, 'code/modules/smithing/sound/anvil_single2.ogg',30)
do_smithing_sparks(1, TRUE, src)
user.visible_message("<span class='notice'>[user] uses the puncher to make holes in the metal.</span>", \
"<span class='notice'>You use the puncher to make holes in the metal.</span>")
if("Ring")
playsound(src, 'code/modules/smithing/sound/anvil_double3.ogg',30)
do_smithing_sparks(1, TRUE, src)
user.visible_message("<span class='notice'>[user] upsets the metal by hammering the thick end.</span>", \
"<span class='notice'>You upset the metal by hammering the thick end.</span>")
if("Unchained Ball")
playsound(src, 'code/modules/smithing/sound/anvil_double3.ogg',30)
do_smithing_sparks(1, TRUE, src)
user.visible_message("<span class='notice'>[user] upsets the metal by hammering the thick end.</span>", \
"<span class='notice'>You upset the metal by hammering the thick end.</span>")
if("Machete Blade")
playsound(src, 'code/modules/smithing/sound/anvil_double3.ogg',30)
do_smithing_sparks(1, TRUE, src)
user.visible_message("<span class='notice'>[user] upsets the metal by hammering the thick end.</span>", \
"<span class='notice'>You upset the metal by hammering the thick end.</span>")
if("Bumper Sabre Blade")
playsound(src, 'code/modules/smithing/sound/anvil_double3.ogg',30)
do_smithing_sparks(1, TRUE, src)
user.visible_message("<span class='notice'>[user] upsets the metal by hammering the thick end.</span>", \
"<span class='notice'>You upset the metal by hammering the thick end.</span>")
if("Sword Blade")
playsound(src, 'code/modules/smithing/sound/anvil_double3.ogg',30)
do_smithing_sparks(1, TRUE, src)
user.visible_message("<span class='notice'>[user] upsets the metal by hammering the thick end.</span>", \
"<span class='notice'>You upset the metal by hammering the thick end.</span>")
if("Weedwhacker Blade")
playsound(src, 'code/modules/smithing/sound/anvil_double3.ogg',30)
do_smithing_sparks(1, TRUE, src)
user.visible_message("<span class='notice'>[user] upsets the metal by hammering the thick end.</span>", \
"<span class='notice'>You upset the metal by hammering the thick end.</span>")
if("Scraptana Blade")
playsound(src, 'code/modules/smithing/sound/anvil_double3.ogg',30)
do_smithing_sparks(1, TRUE, src)
user.visible_message("<span class='notice'>[user] upsets the metal by hammering the thick end.</span>", \
"<span class='notice'>You upset the metal by hammering the thick end.</span>")
if("Long Blade")
playsound(src, 'code/modules/smithing/sound/anvil_double3.ogg',30)
do_smithing_sparks(1, TRUE, src)
user.visible_message("<span class='notice'>[user] upsets the metal by hammering the thick end.</span>", \
"<span class='notice'>You upset the metal by hammering the thick end.</span>")
if("Lawnmower Machete Blade")
playsound(src, 'code/modules/smithing/sound/anvil_double3.ogg',30)
do_smithing_sparks(1, TRUE, src)
user.visible_message("<span class='notice'>[user] upsets the metal by hammering the thick end.</span>", \
"<span class='notice'>You upset the metal by hammering the thick end.</span>")
if("Club Head")
playsound(src, 'code/modules/smithing/sound/anvil_double3.ogg',30)
do_smithing_sparks(1, TRUE, src)
user.visible_message("<span class='notice'>[user] upsets the metal by hammering the thick end.</span>", \
"<span class='notice'>You upset the metal by hammering the thick end.</span>")
if("Woodsplitter Head")
playsound(src, 'code/modules/smithing/sound/anvil_double3.ogg',30)
do_smithing_sparks(1, TRUE, src)
user.visible_message("<span class='notice'>[user] upsets the metal by hammering the thick end.</span>", \
"<span class='notice'>You upset the metal by hammering the thick end.</span>")
if("Homewrecker Blade")
playsound(src, 'code/modules/smithing/sound/anvil_double3.ogg',30)
do_smithing_sparks(1, TRUE, src)
user.visible_message("<span class='notice'>[user] upsets the metal by hammering the thick end.</span>", \
"<span class='notice'>You upset the metal by hammering the thick end.</span>")
if("Bonebreaker Head")
playsound(src, 'code/modules/smithing/sound/anvil_double3.ogg',30)
do_smithing_sparks(1, TRUE, src)
user.visible_message("<span class='notice'>[user] upsets the metal by hammering the thick end.</span>", \
"<span class='notice'>You upset the metal by hammering the thick end.</span>")
if("Shiv Blade")
playsound(src, 'code/modules/smithing/sound/anvil_double3.ogg',30)
do_smithing_sparks(1, TRUE, src)
user.visible_message("<span class='notice'>[user] upsets the metal by hammering the thick end.</span>", \
"<span class='notice'>You upset the metal by hammering the thick end.</span>")
if("Spear Head")
playsound(src, 'code/modules/smithing/sound/anvil_double3.ogg',30)
do_smithing_sparks(1, TRUE, src)
user.visible_message("<span class='notice'>[user] upsets the metal by hammering the thick end.</span>", \
"<span class='notice'>You upset the metal by hammering the thick end.</span>")
if("Javelin Head")
playsound(src, 'code/modules/smithing/sound/anvil_double3.ogg',30)
do_smithing_sparks(1, TRUE, src)
user.visible_message("<span class='notice'>[user] upsets the metal by hammering the thick end.</span>", \
"<span class='notice'>You upset the metal by hammering the thick end.</span>")
if("Throwing Knife Blade")
playsound(src, 'code/modules/smithing/sound/anvil_double3.ogg',30)
do_smithing_sparks(1, TRUE, src)
user.visible_message("<span class='notice'>[user] upsets the metal by hammering the thick end.</span>", \
"<span class='notice'>You upset the metal by hammering the thick end.</span>")
if("Trident Head")
playsound(src, 'code/modules/smithing/sound/anvil_double3.ogg',30)
do_smithing_sparks(1, TRUE, src)
user.visible_message("<span class='notice'>[user] upsets the metal by hammering the thick end.</span>", \
"<span class='notice'>You upset the metal by hammering the thick end.</span>")
if("Saw Blade")
playsound(src, 'code/modules/smithing/sound/anvil_double3.ogg',30)
do_smithing_sparks(1, TRUE, src)
user.visible_message("<span class='notice'>[user] upsets the metal by hammering the thick end.</span>", \
"<span class='notice'>You upset the metal by hammering the thick end.</span>")
if("Sharpblade Blade")
playsound(src, 'code/modules/smithing/sound/anvil_double3.ogg',30)
do_smithing_sparks(1, TRUE, src)
user.visible_message("<span class='notice'>[user] upsets the metal by hammering the thick end.</span>", \
"<span class='notice'>You upset the metal by hammering the thick end.</span>")
if("Lance Head")
playsound(src, 'code/modules/smithing/sound/anvil_double3.ogg',30)
do_smithing_sparks(1, TRUE, src)
user.visible_message("<span class='notice'>[user] upsets the metal by hammering the thick end.</span>", \
"<span class='notice'>You upset the metal by hammering the thick end.</span>")
if("Razorbar Blade")
playsound(src, 'code/modules/smithing/sound/anvil_double3.ogg',30)
do_smithing_sparks(1, TRUE, src)
user.visible_message("<span class='notice'>[user] upsets the metal by hammering the thick end.</span>", \
"<span class='notice'>You upset the metal by hammering the thick end.</span>")
if("Papercutter Blade")
playsound(src, 'code/modules/smithing/sound/anvil_double3.ogg',30)
do_smithing_sparks(1, TRUE, src)
user.visible_message("<span class='notice'>[user] upsets the metal by hammering the thick end.</span>", \
"<span class='notice'>You upset the metal by hammering the thick end.</span>")
if("Sledge Axe Head")
playsound(src, 'code/modules/smithing/sound/anvil_double3.ogg',30)
do_smithing_sparks(1, TRUE, src)
user.visible_message("<span class='notice'>[user] upsets the metal by hammering the thick end.</span>", \
"<span class='notice'>You upset the metal by hammering the thick end.</span>")

if(user.mind.skill_holder) // Skill modifier to make it faster at blacksmithing.
var/skillmod = user.mind.get_skill_level(/datum/skill/level/dwarfy/blacksmithing)/8 + 1 //Makes this faster as EXP gain was lowered
steptime = 50 / skillmod
Expand Down Expand Up @@ -523,12 +374,20 @@ GLOBAL_LIST_INIT(anvil_recipes, list(
stepsdone += "Sledge Axe Head"
currentsteps += 1
currentquality -= 1
if("Duster Lump")
stepsdone += "Duster Lump"
currentsteps += 1
currentquality -= 1
if("Sharp Prongs")
stepsdone += "Sharp Prongs"
currentsteps += 1
currentquality -= 1

// Display message
user.show_message(span_notice("You hammer the metal into a [stepdone]."))

// more sounds... uhhh...
//playsound(src, 'sound/effects/clang2.ogg',40, 2) - Keeping it commented for now.
playsound(src, 'code/modules/smithing/sound/anvil_double3.ogg',30)

// sparkles~
do_smithing_sparks(1, TRUE, src)
Expand Down
78 changes: 78 additions & 0 deletions code/modules/smithing/finished_items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,84 @@



//////////////////////////
// //
// UNARMED WEAPONS //
// //
//////////////////////////

/obj/item/melee/smith/unarmed
name = "glove weapon template"
desc = "should not be here"
icon = 'code/modules/smithing/icons/blacksmith.dmi'
attack_speed = CLICK_CD_MELEE * 0.9
slot_flags = INV_SLOTBIT_BELT | INV_SLOTBIT_GLOVES
w_class = WEIGHT_CLASS_SMALL
flags_1 = CONDUCT_1
sharpness = SHARP_NONE

throwforce = 10
throw_range = 5
attack_verb = list("punched", "jabbed", "whacked")
var/can_adjust_unarmed = TRUE
var/unarmed_adjusted = TRUE

/obj/item/melee/smith/unarmed/equipped(mob/user, slot)
. = ..()
var/mob/living/carbon/human/H = user
if(unarmed_adjusted)
mob_overlay_icon = righthand_file
if(!unarmed_adjusted)
mob_overlay_icon = lefthand_file
if(ishuman(user) && slot == SLOT_GLOVES)
ADD_TRAIT(user, TRAIT_UNARMED_WEAPON, "glove")
if(HAS_TRAIT(user, TRAIT_UNARMED_WEAPON))
H.dna.species.punchdamagehigh += force + 8
H.dna.species.punchdamagelow += force + 8
H.dna.species.attack_sound = hitsound
if(sharpness == SHARP_POINTY || sharpness == SHARP_EDGED)
H.dna.species.attack_verb = pick("slash","slice","rip","tear","cut","dice")
if(sharpness == SHARP_NONE)
H.dna.species.attack_verb = pick("punch","jab","whack")
if(ishuman(user) && slot != SLOT_GLOVES && !H.gloves)
REMOVE_TRAIT(user, TRAIT_UNARMED_WEAPON, "glove")
if(!HAS_TRAIT(user, TRAIT_UNARMED_WEAPON)) //removing your funny trait shouldn't make your fists infinitely stack damage.
H.dna.species.punchdamagehigh = 10
H.dna.species.punchdamagelow = 1
if(HAS_TRAIT(user, TRAIT_IRONFIST))
H.dna.species.punchdamagehigh = 12
H.dna.species.punchdamagelow = 6
if(HAS_TRAIT(user, TRAIT_STEELFIST))
H.dna.species.punchdamagehigh = 16
H.dna.species.punchdamagelow = 10
H.dna.species.attack_sound = 'sound/weapons/punch1.ogg'
H.dna.species.attack_verb = "punch"

/obj/item/melee/smith/unarmed/knuckles
name = "scrap knuckles"
desc = "Hardened knuckle grip made out of metal. They protect your hand, and do more damage, in unarmed combat."
icon_state = "knuckles_smith"
item_state = "knuckles_smith"
overlay_state = "grip_knuckles"
w_class = WEIGHT_CLASS_SMALL
slot_flags = INV_SLOTBIT_BELT | INV_SLOTBIT_GLOVES
attack_verb = list("punched", "jabbed", "whacked")
force = 33

/obj/item/melee/smith/unarmed/claws
name = "scrap claws"
desc = "Gloves with short claws built into the palms."
icon_state = "claws_smith"
item_state = "claws_smith"
overlay_state = "grip_claws"
w_class = WEIGHT_CLASS_SMALL
slot_flags = INV_SLOTBIT_BELT | INV_SLOTBIT_GLOVES
attack_verb = list("slashed", "sliced", "torn", "ripped", "diced", "cut")
sharpness = SHARP_EDGED
attack_speed = CLICK_CD_MELEE * 0.8
force = 28
hitsound = 'sound/weapons/bladeslice.ogg'

//////////////////////////
// //
// ONEHANDED WEAPONS //
Expand Down
Binary file modified code/modules/smithing/icons/blacksmith.dmi
Binary file not shown.
32 changes: 32 additions & 0 deletions code/modules/smithing/smithed_items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,38 @@
finalitem.force += 5
..()

/obj/item/smithing/unarmed/knuckles
name = "duster lump"
icon_state = "knuckles_smith"
finishingitem = /obj/item/stack/sheet/leatherstrips
finalitem = /obj/item/melee/smith/unarmed/knuckles

/obj/item/smithing/unarmed/knuckles/startfinish()
finalitem = new /obj/item/melee/smith/unarmed/knuckles(src)
// finalitem.force += quality*1.5
..()

/obj/item/smithing/unarmed/knuckles/startmasterworkfinish()
finalitem = new /obj/item/melee/smith/unarmed/knuckles(src)
finalitem.force += 5
..()

/obj/item/smithing/unarmed/claws
name = "sharp prongs"
icon_state = "claws_smith"
finishingitem = /obj/item/stack/sheet/leatherstrips
finalitem = /obj/item/melee/smith/unarmed/claws

/obj/item/smithing/unarmed/claws/startfinish()
finalitem = new /obj/item/melee/smith/unarmed/claws(src)
// finalitem.force += quality*1.5
..()

/obj/item/smithing/unarmed/claws/startmasterworkfinish()
finalitem = new /obj/item/melee/smith/unarmed/claws(src)
finalitem.force += 5
..()

////////////
// spears //
////////////
Expand Down

0 comments on commit c43d3dc

Please sign in to comment.