More blacksmithing tweaks (#20692)

* More blacksmithing tweaks

 - Forging sword blades now makes a dorf-friendly sword
 - Fixes oversight where materials with an unitialized melt_temperature could be heated by ANYTHING (looking at you, phazon)

* Adds some more swords
This commit is contained in:
MadmanMartian
2018-11-30 09:33:10 +00:00
committed by jknpj
parent 3c758cf54a
commit 6c165f0b06
8 changed files with 111 additions and 21 deletions

View File

@@ -1,21 +1,33 @@
/obj/item/item_head
icon = 'icons/obj/misc_components.dmi'
var/obj/item/result
var/list/finishing_requirements = list(/obj/item/item_handle) //Things required to finish this object.
/obj/item/item_head/examine(mob/user)
..()
if(finishing_requirements.len)
to_chat(user, "<span class = 'notice'>It looks like it requires:")
for(var/i in finishing_requirements)
var/obj/I = i
to_chat(user, "<span class = 'notice'>A [initial(I.name)]</span>")
/obj/item/item_head/attackby(obj/item/I, mob/user)
if(istype(I, /obj/item/item_handle))
if(is_type_in_list(I, finishing_requirements))
to_chat(user, "<span class = 'notice'>You begin to attach \the [I] to \the [src].</span>")
if(do_after(user, src, 4 SECONDS))
user.drop_item(I)
user.drop_item(src)
result = new result
var/datum/material/mat = material_type
if(mat)
result.dorfify(mat, 0, quality)
finishing_requirements.Remove(I.type)
qdel(I)
qdel(src)
user.put_in_hands(result)
return
if(!finishing_requirements.len) //We're done
user.drop_item(src)
result = new result
var/datum/material/mat = material_type
if(mat)
result.dorfify(mat, 0, quality)
user.put_in_hands(result)
qdel(src)
return
..()
/obj/item/item_head/hammer_head
@@ -34,4 +46,43 @@
name = "item handle"
icon = 'icons/obj/misc_components.dmi'
icon_state = "item_handle"
desc = "a generic handle, with no purpose."
desc = "a generic handle, with no purpose."
/obj/item/sword_handle
name = "sword handle"
icon = 'icons/obj/misc_components.dmi'
icon_state = "sword_handle"
desc = "A generic sword handle."
/obj/item/cross_guard
name = "sword crossguard"
icon = 'icons/obj/misc_components.dmi'
icon_state = "crossguard"
desc = "Used to make sure what you're stabbing doesn't slide all the way to your hand, or your hand slide to the stabby bit."
/obj/item/item_head/sword
name = "sword blade"
icon_state = "large_metal_blade"
desc = "Rather unwieldy without a hilt."
finishing_requirements = list(/obj/item/sword_handle, /obj/item/cross_guard)
result = /obj/item/weapon/sword
/obj/item/item_head/sword/scimitar
name = "scimitar blade"
icon_state = "large_curved_blade"
desc = "Curved. Swords."
result = /obj/item/weapon/sword/scimitar
/obj/item/item_head/sword/shortsword
name = "shortsword blade"
result = /obj/item/weapon/sword/shortsword
/obj/item/item_head/sword/gladius
name = "gladius blade"
result = /obj/item/weapon/sword/gladius
finishing_requirements = list(/obj/item/sword_handle)
/obj/item/item_head/sword/sabre
name = "sabre blade"
icon_state = "large_curved_blade"
result = /obj/item/weapon/sword/sabre

View File

@@ -107,8 +107,14 @@
var/datum/stack_recipe_list/blacksmithing_recipes = new("blacksmithing recipes", list(
new/datum/stack_recipe/blacksmithing("hammer head", /obj/item/item_head/hammer_head, 4, time = 5 SECONDS, required_strikes = 6),
new/datum/stack_recipe/blacksmithing("pickaxe head", /obj/item/item_head/pickaxe_head, 4, time = 5 SECONDS, required_strikes = 8),
new/datum/stack_recipe/blacksmithing("sword blade", /obj/item/weapon/metal_blade, 8, time = 8 SECONDS, required_strikes = 13),
new/datum/stack_recipe/blacksmithing("pickaxe head", /obj/item/item_head/pickaxe_head, 4, time = 5 SECONDS, required_strikes = 8),
new/datum/stack_recipe/blacksmithing("sword crossguard", /obj/item/cross_guard, 4, time = 5 SECONDS, required_strikes = 4),
null,
new/datum/stack_recipe/blacksmithing("sword blade", /obj/item/item_head/sword, 8, time = 8 SECONDS, required_strikes = 13),
new/datum/stack_recipe/blacksmithing("scimitar blade", /obj/item/item_head/sword/scimitar, 8, time = 8 SECONDS, required_strikes = 13),
new/datum/stack_recipe/blacksmithing("shortsword blade", /obj/item/item_head/sword/shortsword, 8, time = 8 SECONDS, required_strikes = 13),
new/datum/stack_recipe/blacksmithing("gladius blade", /obj/item/item_head/sword/gladius, 8, time = 8 SECONDS, required_strikes = 13),
new/datum/stack_recipe/blacksmithing("sabre blade", /obj/item/item_head/sword/sabre, 8, time = 8 SECONDS, required_strikes = 13),
))
@@ -287,6 +293,7 @@ var/list/datum/stack_recipe/wood_recipes = list (
new/datum/stack_recipe("boomerang", /obj/item/weapon/boomerang, 6, time = 50 ),
new/datum/stack_recipe("buckler", /obj/item/weapon/shield/riot/buckler, 5, time = 50 ),
new/datum/stack_recipe("item handle", /obj/item/item_handle, 1,2,20, time = 2 SECONDS ),
new/datum/stack_recipe("sword handle", /obj/item/sword_handle, 1,2,10, time = 2 SECONDS, other_reqs = list(/obj/item/stack/sheet/metal = 1)),
new/datum/stack_recipe("wooden paddle", /obj/item/weapon/macuahuitl, 1, time = 50 ),
new/datum/stack_recipe/dorf("training sword", /obj/item/weapon/melee/training_sword, 4, time = 12, on_floor = 1, inherit_material = TRUE, gen_quality = TRUE),
null,

View File

@@ -97,6 +97,10 @@
icon_state = "knight_templar"
item_state = "knight_templar"
/obj/item/clothing/suit/armor/knight/plain
icon_state = "knight_grey"
item_state = "knight_grey"
/obj/item/clothing/suit/armor/xcomsquaddie
name = "Squaddie Armor"
desc = "A suit of armor with heavy padding to protect against projectile attacks. Distributed to shadow organization squaddies."

View File

@@ -136,9 +136,10 @@ var/global/list/initial_materials //Stores all the matids = 0 in helping New
var/brunt_damage_mod = 1
var/sharpness_mod = 1
var/quality_mod = 1
var/melt_temperature
var/melt_temperature = MELTPOINT_STEEL
var/armor_mod = 1
/datum/material/New()
if(processed_name=="")
processed_name=name
@@ -308,6 +309,7 @@ var/global/list/initial_materials //Stores all the matids = 0 in helping New
brunt_damage_mod = 1.4
sharpness_mod = 1.8
quality_mod = 2.2
melt_temperature = MELTPOINT_PLASMA
/datum/material/phazon/on_use(obj/source, atom/target, mob/user)
if(!..())

View File

@@ -149,10 +149,10 @@
to_chat(user, "You wrap cable around the base of \the [src], creating a grip.")
if(src.loc == user)
user.drop_item(src, force_drop = 1)
var/obj/item/weapon/sword/I = new (get_turf(user))
var/obj/item/weapon/sword/weaponcraft/I = new (get_turf(user))
user.put_in_hands(I)
else
new /obj/item/weapon/sword(get_turf(src.loc))
new /obj/item/weapon/sword/weaponcraft(get_turf(src.loc))
C.use(5)
qdel(src)
if(iswelder(W))

View File

@@ -14,13 +14,15 @@
sharpness = 1.2
sharpness_flags = SHARP_TIP | SHARP_BLADE
attack_verb = list("attacks", "slashes", "stabs", "slices", "tears", "rips", "dices", "cuts")
/obj/item/weapon/sword/weaponcraft
var/obj/item/weapon/reagent_containers/hypospray/hypo = null
/obj/item/weapon/sword/suicide_act(mob/user)
to_chat(viewers(user), "<span class='danger'>[user] is falling on the [src.name]! It looks like \he's trying to commit suicide.</span>")
return(SUICIDE_ACT_BRUTELOSS)
/obj/item/weapon/sword/attack_self(mob/user as mob)
/obj/item/weapon/sword/weaponcraft/attack_self(mob/user as mob)
if(!hypo)
return
to_chat(user, "You remove \the [hypo] from \the [src].")
@@ -29,13 +31,13 @@
hypo = null
overlays.len = 0
/obj/item/weapon/sword/update_icon()
/obj/item/weapon/sword/weaponcraft/update_icon()
overlays.len = 0
if(hypo)
var/image/hypo_icon = image('icons/obj/weaponsmithing.dmi', src, "sword_hypo_overlay")
overlays += hypo_icon
/obj/item/weapon/sword/attackby(obj/item/weapon/W, mob/user)
/obj/item/weapon/sword/weaponcraft/attackby(obj/item/weapon/W, mob/user)
if(istype(W, /obj/item/weapon/metal_blade))
to_chat(user, "You attach \the [W] to \the [src].")
if(src.loc == user)
@@ -67,7 +69,7 @@
qdel(src)
qdel(W)
/obj/item/weapon/sword/Destroy()
/obj/item/weapon/sword/weaponcraft/Destroy()
if(hypo)
qdel(hypo)
hypo = null
@@ -190,7 +192,7 @@
update_color()
if(iscrowbar(W))
to_chat(user, "You pry the aluminum cylinder off of \the [src].")
var/obj/item/weapon/sword/I = new (get_turf(src))
var/obj/item/weapon/sword/weaponcraft/I = new (get_turf(src))
if(HY)
I.hypo = HY
HY.forceMove(I)
@@ -280,4 +282,28 @@
if (istype(loc,/mob/living/carbon/human))
var/mob/living/carbon/human/H = loc
H.update_inv_hands()
H.update_inv_back()
H.update_inv_back()
/obj/item/weapon/sword/shortsword
name = "shortsword"
desc = "A short-bladed sword, used for close combat agility, over overpowering your foes."
icon_state = "shortsword"
item_state = "sword"
/obj/item/weapon/sword/gladius
name = "gladius"
desc = "An ancient sword design employed by the romans, used for its simple design for mass manufacture. It lacks a cross-guard."
icon_state = "gladius"
item_state = "sword"
/obj/item/weapon/sword/sabre
name = "sabre"
desc = "A sword with a slight-curved blade, associated with cavalry usage. Commonly used for duelling in academic fencing."
icon_state = "sabre"
item_state = "sword"
/obj/item/weapon/sword/scimitar
name = "scimitar"
desc = "A sword with a curved blade. The curved blade made it easier for use from horseback."
icon_state = "scimitar"
item_state = "sword"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 546 B

After

Width:  |  Height:  |  Size: 795 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 18 KiB