diff --git a/code/game/objects/items/weapons/material/material_weapons.dm b/code/game/objects/items/weapons/material/material_weapons.dm index 1e93d082177..236024fc81e 100644 --- a/code/game/objects/items/weapons/material/material_weapons.dm +++ b/code/game/objects/items/weapons/material/material_weapons.dm @@ -11,6 +11,7 @@ sharp = 0 edge = 0 + var/use_material_name = TRUE // Does the finished item put the material name in front of it? var/applies_material_colour = 1 var/unbreakable var/force_divisor = 0.5 @@ -50,7 +51,8 @@ if(!material) qdel(src) else - name = "[material.display_name] [initial(name)]" + if(use_material_name) + name = "[material.display_name] [initial(name)]" health = round(material.integrity/10) if(applies_material_colour) color = material.icon_colour diff --git a/code/game/objects/items/weapons/material/swords.dm b/code/game/objects/items/weapons/material/swords.dm index f5bcd31debe..cb144b99f0d 100644 --- a/code/game/objects/items/weapons/material/swords.dm +++ b/code/game/objects/items/weapons/material/swords.dm @@ -149,4 +149,78 @@ icon_state = "amohdan_sword" item_state = "amohdan_sword" contained_sprite = 1 - slot_flags = SLOT_BELT \ No newline at end of file + slot_flags = SLOT_BELT + +// improvised sword +/obj/item/weapon/material/sword/improvised_sword + name = "selfmade sword" + desc = "A crudely made, rough looking sword. Still appears to be quite deadly." + icon = 'icons/obj/weapons.dmi' + icon_state = "improvsword" + item_state = "improvsword" + var/obj/item/weapon/material/hilt //what is the handle made of? + force_divisor = 0.3 + slot_flags = SLOT_BELT + +/obj/item/weapon/material/sword/improvised_sword/apply_hit_effect() + . = ..() + if(!unbreakable) + if(hilt.material.is_brittle()) + health = 0 + else if(!prob(hilt.material.hardness)) + health-- + check_health() + +/obj/item/weapon/material/sword/improvised_sword/proc/assignDescription() + if(hilt) + desc = "A crudely made, rough looking sword. Still appears to be quite deadly. It has a blade of [src.material], and a hilt of [hilt.material]." + else + desc = "A crudely made, rough looking sword. Still appears to be quite deadly. It has a blade of [src.material]." + +// the things needed to create the above +/obj/item/weapon/material/sword_hilt + name = "hilt" + desc = "A hilt without a blade, quite useless." + icon = 'icons/obj/weapons_build.dmi' + icon_state = "swordhilt" + unbreakable = TRUE + force_divisor = 0.05 + thrown_force_divisor = 0.2 + +/obj/item/weapon/material/sword_hilt/attackby(var/obj/O, mob/user) + if(istype(O, /obj/item/weapon/material/sword_blade)) + var/obj/item/weapon/material/sword_blade/blade = O + var/obj/item/weapon/material/sword/improvised_sword/new_sword = new(src.loc, blade.material.name) + new_sword.hilt = src + user.drop_from_inventory(src,new_sword) + user.drop_from_inventory(blade,new_sword) + user.put_in_hands(new_sword) + qdel(blade) + qdel(src) + new_sword.assignDescription() + else + ..() + +/obj/item/weapon/material/sword_blade + name = "blade" + desc = "A blade without a hilt, don't cut yourself!" + icon = 'icons/obj/weapons_build.dmi' + icon_state = "swordblade" + unbreakable = TRUE + force_divisor = 0.20 + thrown_force_divisor = 0.3 + +/obj/item/weapon/material/sword_blade/attackby(var/obj/O, mob/user) + if(istype(O, /obj/item/weapon/material/sword_hilt)) + var/obj/item/weapon/material/sword_hilt/hilt = O + var/obj/item/weapon/material/sword/improvised_sword/new_sword = new(src.loc, src.material.name) + new_sword.hilt = hilt.material + new_sword.assignDescription() + user.drop_from_inventory(src,new_sword) + user.drop_from_inventory(hilt,new_sword) + user.put_in_hands(new_sword) + qdel(hilt) + qdel(src) + new_sword.assignDescription() + else + ..() \ No newline at end of file diff --git a/code/modules/materials/material_recipes.dm b/code/modules/materials/material_recipes.dm index 2791e920b44..f97d0f5a264 100644 --- a/code/modules/materials/material_recipes.dm +++ b/code/modules/materials/material_recipes.dm @@ -8,6 +8,8 @@ // If is_brittle() returns true, these are only good for a single strike. recipes += new/datum/stack_recipe("[display_name] baseball bat", /obj/item/weapon/material/twohanded/baseballbat, 10, time = 20, one_per_turf = 0, on_floor = 1, supplied_material = "[name]") + recipes += new/datum/stack_recipe("[display_name] sword hilt", /obj/item/weapon/material/sword_hilt, 10, time = 100, one_per_turf = 0, on_floor = 1, supplied_material = "[name]") + recipes += new/datum/stack_recipe("[display_name] sword blade", /obj/item/weapon/material/sword_blade, 15, time = 100, one_per_turf = 0, on_floor = 1, supplied_material = "[name]") recipes += new/datum/stack_recipe("[display_name] spoon", /obj/item/weapon/material/kitchen/utensil/spoon/plastic, 1, on_floor = 1, supplied_material = "[name]") recipes += new/datum/stack_recipe("[display_name] ring", /obj/item/clothing/ring/material, 1, on_floor = 1, supplied_material = "[name]") recipes += new/datum/stack_recipe("[display_name] armor plate", /obj/item/weapon/material/armor_plating, 3, time = 20, on_floor = 1, supplied_material = "[name]") diff --git a/html/changelogs/geeves - improvSword.yml b/html/changelogs/geeves - improvSword.yml new file mode 100644 index 00000000000..14e24a6540a --- /dev/null +++ b/html/changelogs/geeves - improvSword.yml @@ -0,0 +1,41 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +# balance +# admin +# backend +# security +# refactor +################################# + +# Your name. +author: Geeves + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - rscadd: "You can now build improvised swords. The hilt determines the integrity thereof, while the blade determines the damage it does." diff --git a/icons/mob/belt.dmi b/icons/mob/belt.dmi index 71875df9d56..5c591d51f1c 100644 Binary files a/icons/mob/belt.dmi and b/icons/mob/belt.dmi differ diff --git a/icons/mob/items/lefthand.dmi b/icons/mob/items/lefthand.dmi index 20e977dbb19..e32cf5bcc42 100644 Binary files a/icons/mob/items/lefthand.dmi and b/icons/mob/items/lefthand.dmi differ diff --git a/icons/mob/items/righthand.dmi b/icons/mob/items/righthand.dmi index 0539da87fc1..e16b6a39db5 100644 Binary files a/icons/mob/items/righthand.dmi and b/icons/mob/items/righthand.dmi differ diff --git a/icons/obj/weapons.dmi b/icons/obj/weapons.dmi index e5dc110ad5f..d8542f78441 100644 Binary files a/icons/obj/weapons.dmi and b/icons/obj/weapons.dmi differ diff --git a/icons/obj/weapons_build.dmi b/icons/obj/weapons_build.dmi index 307eca3bb60..b8b154c3f7f 100644 Binary files a/icons/obj/weapons_build.dmi and b/icons/obj/weapons_build.dmi differ