Skip to content

Commit

Permalink
Merge pull request #3959 from MistakeNot4892/feature/hatchets
Browse files Browse the repository at this point in the history
Moving hatchets and machetes onto /tool subtypes.
  • Loading branch information
out-of-phaze authored May 3, 2024
2 parents fedb866 + c13d56b commit fbc31d0
Show file tree
Hide file tree
Showing 36 changed files with 132 additions and 96 deletions.
2 changes: 1 addition & 1 deletion code/datums/extensions/storage/subtypes_belt.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
/obj/item/inducer/,
/obj/item/robotanalyzer,
/obj/item/tool/hoe/mini,
/obj/item/hatchet,
/obj/item/tool/axe/hatchet,
/obj/item/scanner/plant,
/obj/item/stack/tape_roll,
/obj/item/chems/spray/extinguisher/mini,
Expand Down
2 changes: 1 addition & 1 deletion code/datums/extensions/storage/subtypes_firstaid.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
can_hold = list(
/obj/item/screwdriver,
/obj/item/wrench,
/obj/item/hatchet,
/obj/item/tool/axe/hatchet,
/obj/item/utensil/fork,
/obj/item/shard,
/obj/item/flame/fuelled/lighter,
Expand Down
2 changes: 1 addition & 1 deletion code/datums/extensions/storage/subtypes_pockets.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
storage_slots = 2
max_w_class = ITEM_SIZE_NORMAL //for knives
can_hold = list(
/obj/item/hatchet,
/obj/item/tool/axe/hatchet,
/obj/item/knife,
)

Expand Down
4 changes: 2 additions & 2 deletions code/datums/supplypacks/hydroponics.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
name = "Gear - Hydroponics Supplies"
contains = list(/obj/item/chems/spray/plantbgone = 4,
/obj/item/chems/glass/bottle/ammonia = 2,
/obj/item/hatchet,
/obj/item/tool/axe/hatchet,
/obj/item/tool/hoe/mini,
/obj/item/scanner/plant,
/obj/item/clothing/gloves/thick/botany,
Expand Down Expand Up @@ -41,7 +41,7 @@

/decl/hierarchy/supply_pack/hydroponics/weedcontrol
name = "Gear - Weed control"
contains = list(/obj/item/hatchet = 2,
contains = list(/obj/item/tool/axe/hatchet = 2,
/obj/item/chems/spray/plantbgone = 4,
/obj/item/clothing/mask/gas = 2,
/obj/item/grenade/chem_grenade/antiweed = 2)
Expand Down
63 changes: 0 additions & 63 deletions code/game/objects/items/weapons/material/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -45,69 +45,6 @@
sharp = FALSE
edge = FALSE

/obj/item/hatchet
name = "hatchet"
desc = "A very sharp axe blade upon a short fibremetal handle. It has a long history of chopping things, but now it is used for chopping wood."
icon = 'icons/obj/items/tool/hatchet.dmi'
icon_state = "hatchet"
max_force = 15
item_flags = ITEM_FLAG_IS_WEAPON
material_force_multiplier = 0.2 // 12 with hardness 60 (steel)
thrown_material_force_multiplier = 0.25 // 15 with weight 60 (steel)
w_class = ITEM_SIZE_SMALL
sharp = 1
edge = 1
origin_tech = @'{"materials":2,"combat":1}'
attack_verb = list("chopped", "torn", "cut")
material = /decl/material/solid/metal/steel
material_alteration = MAT_FLAG_ALTERATION_NAME
hitsound = "chop"

/obj/item/hatchet/Initialize()
. = ..()
set_extension(src, /datum/extension/tool, list(TOOL_HATCHET = TOOL_QUALITY_DEFAULT))

/obj/item/hatchet/unbreakable
max_health = ITEM_HEALTH_NO_DAMAGE

/obj/item/hatchet/machete
name = "machete"
desc = "A long, sturdy blade with a rugged handle. Leading the way to cursed treasures since before space travel."
icon = 'icons/obj/items/weapon/machetes/machete.dmi'
icon_state = ICON_STATE_WORLD
w_class = ITEM_SIZE_NORMAL
slot_flags = SLOT_LOWER_BODY
material = /decl/material/solid/metal/titanium
base_parry_chance = 50
max_force = 20
material_force_multiplier = 0.20 //20 with hardness 80 (titanium) or 15 with hardness 60 (steel)
var/static/list/standard_machete_icons = list(
'icons/obj/items/weapon/machetes/machete.dmi',
'icons/obj/items/weapon/machetes/machete_red.dmi',
'icons/obj/items/weapon/machetes/machete_blue.dmi',
'icons/obj/items/weapon/machetes/machete_black.dmi',
'icons/obj/items/weapon/machetes/machete_olive.dmi'
)

/obj/item/hatchet/machete/Initialize()
icon = pick(standard_machete_icons)
. = ..()

/obj/item/hatchet/machete/unbreakable
max_health = ITEM_HEALTH_NO_DAMAGE

/obj/item/hatchet/machete/steel
name = "fabricated machete"
desc = "A long, machine-stamped blade with a somewhat ungainly handle. Found in military surplus stores, malls, and horror movies since before interstellar travel."
base_parry_chance = 40
material = /decl/material/solid/metal/steel
matter = list(/decl/material/solid/organic/plastic = MATTER_AMOUNT_REINFORCEMENT)

/obj/item/hatchet/machete/deluxe
name = "deluxe machete"
desc = "A fine example of a machete, with a polished blade, wooden handle and a leather cord loop."
icon = 'icons/obj/items/weapon/machetes/machete_dx.dmi'

/obj/item/scythe
name = "scythe"
desc = "A sharp and curved blade on a long fibremetal handle, this tool makes it easy to reap what you sow."
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/weapons/storage/belt.dm
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@
icon = 'icons/clothing/belt/machete.dmi'
overlay_flags = BELT_OVERLAY_HOLSTER
storage = /datum/storage/holster/machete
can_holster = list(/obj/item/hatchet/machete)
can_holster = list(/obj/item/tool/machete)
sound_in = 'sound/effects/holster/sheathin.ogg'
sound_out = 'sound/effects/holster/sheathout.ogg'

Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/weapons/storage/firstaid.dm
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
return list(
/obj/item/screwdriver,
/obj/item/wrench,
/obj/item/hatchet,
/obj/item/tool/axe/hatchet,
/obj/item/utensil/fork,
/obj/item/shard,
/obj/item/flame/fuelled/lighter,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
/obj/item/clothing/mask/bandana/botany,
/obj/item/clothing/head/bandana/green,
/obj/item/tool/hoe/mini,
/obj/item/hatchet,
/obj/item/tool/axe/hatchet,
/obj/item/wirecutters/clippers,
/obj/item/chems/spray/plantbgone,
)
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/structures/crates_lockers/crates.dm
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@
/obj/item/chems/spray/plantbgone = 2,
/obj/item/tool/hoe/mini = 2,
/obj/item/plants = 2,
/obj/item/hatchet = 2,
/obj/item/tool/axe/hatchet = 2,
/obj/item/wirecutters/clippers = 2,
/obj/item/scanner/plant = 2
)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/clothing/webbing/holster.dm
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
desc = "A handsome synthetic leather sheath with matching belt."
icon = 'icons/clothing/accessories/holsters/holster_machete.dmi'
can_holster = list(
/obj/item/hatchet/machete,
/obj/item/tool/machete,
/obj/item/knife/kitchen/cleaver,
/obj/item/sword/katana
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
path = /obj/item/gun/projectile/flare

/datum/fabricator_recipe/arms_ammo/hidden
path = /obj/item/hatchet/machete/steel
path = /obj/item/tool/machete/steel
hidden = TRUE

/datum/fabricator_recipe/arms_ammo/hidden/shotgun
Expand Down
2 changes: 1 addition & 1 deletion code/modules/fabrication/designs/general/designs_tools.dm
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
path = /obj/item/wrench

/datum/fabricator_recipe/tool/hatchet
path = /obj/item/hatchet
path = /obj/item/tool/axe/hatchet

/datum/fabricator_recipe/tool/minihoe
path = /obj/item/tool/hoe/mini
Expand Down
10 changes: 5 additions & 5 deletions code/modules/mechs/equipment/combat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@
restricted_hardpoints = list(HARDPOINT_LEFT_HAND, HARDPOINT_RIGHT_HAND)
restricted_software = list(MECH_SOFTWARE_UTILITY)

/obj/item/hatchet/machete/mech
/obj/item/tool/machete/mech
name = "mechete"
desc = "That thing is too big to be called a machete. Too big, too thick, too heavy, and too rough, it is more like a large hunk of iron."
w_class = ITEM_SIZE_GARGANTUAN
Expand All @@ -244,14 +244,14 @@
material_force_multiplier = 0.75 // Equals 20 AP with 25 force
max_health = ITEM_HEALTH_NO_DAMAGE //Else we need a whole system for replacement blades

/obj/item/hatchet/machete/mech/apply_hit_effect(mob/living/target, mob/living/user, hit_zone)
/obj/item/tool/machete/mech/apply_hit_effect(mob/living/target, mob/living/user, hit_zone)
. = ..()
if (.)
do_attack_effect(target, "smash")
if (target.mob_size < user.mob_size) //Damaging attacks overwhelm smaller mobs
target.throw_at(get_edge_target_turf(target,get_dir(user, target)),1, 1)

/obj/item/hatchet/machete/mech/resolve_attackby(atom/A, mob/user, click_params)
/obj/item/tool/machete/mech/resolve_attackby(atom/A, mob/user, click_params)
//Case 1: Default, you are hitting something that isn't a mob. Just do whatever, this isn't dangerous or op.
if (!isliving(A))
return ..()
Expand All @@ -261,7 +261,7 @@
playsound(user, 'sound/mecha/mechmove03.ogg', 35, 1)
return ..()

/obj/item/hatchet/machete/mech/attack_self(mob/living/user)
/obj/item/tool/machete/mech/attack_self(mob/living/user)
. = ..()
if (user.a_intent != I_HURT)
return
Expand All @@ -281,7 +281,7 @@

/obj/item/mech_equipment/mounted_system/melee/machete
icon_state = "mech_blade"
holding = /obj/item/hatchet/machete/mech
holding = /obj/item/tool/machete/mech


//Ballistic shield
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/obj/item/plants,
/obj/item/wirecutters/clippers,
/obj/item/tool/hoe/mini/unbreakable,
/obj/item/hatchet/unbreakable,
/obj/item/tool/axe/hatchet/unbreakable,
/obj/item/chems/glass/bucket,
/obj/item/scalpel/laser,
/obj/item/circular_saw,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
/obj/item/gripper/service,
/obj/item/chems/glass/bucket,
/obj/item/tool/hoe/mini,
/obj/item/hatchet,
/obj/item/tool/axe/hatchet,
/obj/item/scanner/plant,
/obj/item/plants,
/obj/item/robot_harvester,
Expand Down
2 changes: 1 addition & 1 deletion code/modules/spells/spellbook/druid.dm
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@
/obj/item/seeds,
/obj/item/wirecutters/clippers,
/obj/item/scanner/plant,
/obj/item/hatchet,
/obj/item/tool/axe/hatchet,
/obj/item/tool/hoe/mini
)
6 changes: 6 additions & 0 deletions code/modules/tools/components/head.dm
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ var/global/list/_tool_properties_cache = list()
icon_state = "shovel"
tool_type = /obj/item/tool/shovel

/obj/item/tool_component/head/handaxe
name = "hand axe head"
desc = "The head of a hand axe."
icon_state = "handaxe"
tool_type = /obj/item/tool/axe

/obj/item/tool_component/head/pickaxe
name = "pickaxe head"
desc = "The head of a pickaxe."
Expand Down
3 changes: 3 additions & 0 deletions code/modules/tools/components/recipes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
/decl/stack_recipe/tool/head/shovel
result_type = /obj/item/tool_component/head/shovel

/decl/stack_recipe/tool/head/handaxe
result_type = /obj/item/tool_component/head/handaxe

/decl/stack_recipe/tool/head/sledgehammer
difficulty = MAT_VALUE_VERY_HARD_DIY
result_type = /obj/item/tool_component/head/sledgehammer
Expand Down
38 changes: 38 additions & 0 deletions code/modules/tools/subtypes/axes.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/obj/item/tool/axe
name = "hand axe"
desc = "A handheld tool for chopping things, wood, food, or people."
icon_state = "preview"
icon = 'icons/obj/items/tool/axes/handaxe.dmi'
sharp = TRUE
edge = TRUE
force = 10
handle_material = /decl/material/solid/organic/wood
material_force_multiplier = 0.3
thrown_material_force_multiplier = 0.25 // 15 with weight 60 (steel)
max_force = 15
item_flags = ITEM_FLAG_IS_WEAPON
origin_tech = @'{"materials":2,"combat":1}'
attack_verb = list("chopped", "torn", "cut")
hitsound = "chop"

/obj/item/tool/axe/get_initial_tool_qualities()
var/static/list/tool_qualities = list(
TOOL_HATCHET = TOOL_QUALITY_DEFAULT
)
return tool_qualities

// Legacy SS13 hatchet.
/obj/item/tool/axe/hatchet
name = "hatchet"
desc = "A very sharp axe blade upon a short fibremetal handle. It has a long history of chopping things, but now it is used for chopping wood."
icon = 'icons/obj/items/tool/axes/hatchet.dmi'
material_force_multiplier = 0.2 // 12 with hardness 60 (steel)
w_class = ITEM_SIZE_SMALL
material_alteration = MAT_FLAG_ALTERATION_NAME
handle_material = /decl/material/solid/organic/plastic

/obj/item/tool/axe/hatchet/get_handle_color()
return null

/obj/item/tool/axe/hatchet/unbreakable
max_health = ITEM_HEALTH_NO_DAMAGE
48 changes: 48 additions & 0 deletions code/modules/tools/subtypes/machetes.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/obj/item/tool/machete
name = "machete"
desc = "A long, sturdy blade with a rugged handle. Leading the way to cursed treasures since before space travel."
icon = 'icons/obj/items/weapon/machetes/machete.dmi'
w_class = ITEM_SIZE_NORMAL
slot_flags = SLOT_LOWER_BODY
material = /decl/material/solid/metal/titanium
base_parry_chance = 50
max_force = 20
material_force_multiplier = 0.2 //20 with hardness 80 (titanium) or 15 with hardness 60 (steel)
origin_tech = @'{"materials":2,"combat":1}'
attack_verb = list("chopped", "torn", "cut")
var/static/list/standard_machete_icons = list(
'icons/obj/items/weapon/machetes/machete.dmi',
'icons/obj/items/weapon/machetes/machete_red.dmi',
'icons/obj/items/weapon/machetes/machete_blue.dmi',
'icons/obj/items/weapon/machetes/machete_black.dmi',
'icons/obj/items/weapon/machetes/machete_olive.dmi'
)

/obj/item/tool/machete/Initialize()
icon = pick(standard_machete_icons)
. = ..()

/obj/item/tool/machete/get_handle_color()
return null

/obj/item/tool/machete/get_initial_tool_qualities()
var/static/list/tool_qualities = list(
TOOL_HATCHET = TOOL_QUALITY_MEDIOCRE,
TOOL_HAMMER = TOOL_QUALITY_BAD
)
return tool_qualities

/obj/item/tool/machete/unbreakable
max_health = ITEM_HEALTH_NO_DAMAGE

/obj/item/tool/machete/steel
name = "fabricated machete"
desc = "A long, machine-stamped blade with a somewhat ungainly handle. Found in military surplus stores, malls, and horror movies since before interstellar travel."
base_parry_chance = 40
material = /decl/material/solid/metal/steel
matter = list(/decl/material/solid/organic/plastic = MATTER_AMOUNT_REINFORCEMENT)

/obj/item/tool/machete/deluxe
name = "deluxe machete"
desc = "A fine example of a machete, with a polished blade, wooden handle and a leather cord loop."
icon = 'icons/obj/items/weapon/machetes/machete_dx.dmi'
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
/obj/item/clipboard,
/obj/item/cell,
/obj/item/circular_saw,
/obj/item/hatchet,
/obj/item/tool/axe/hatchet,
/obj/item/handcuffs,
/obj/item/hemostat,
/obj/item/knife/kitchen,
Expand Down
Binary file added icons/obj/items/tool/axes/handaxe.dmi
Binary file not shown.
Binary file added icons/obj/items/tool/axes/hatchet.dmi
Binary file not shown.
Binary file modified icons/obj/items/tool/components/tool_head.dmi
Binary file not shown.
Binary file removed icons/obj/items/tool/hatchet.dmi
Binary file not shown.
2 changes: 1 addition & 1 deletion maps/antag_spawn/ert/ert_base.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
"az" = (
/obj/structure/table/steel_reinforced,
/obj/item/twohanded/baseballbat/aluminium,
/obj/item/hatchet,
/obj/item/tool/axe/hatchet,
/turf/unsimulated/floor{
icon_state = "dark"
},
Expand Down
4 changes: 2 additions & 2 deletions maps/away/slavers/slavers_base.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
/area/slavers_base/mort)
"aA" = (
/obj/structure/rack,
/obj/item/hatchet,
/obj/item/tool/axe/hatchet,
/turf/floor/airless,
/area/slavers_base/mort)
"aB" = (
Expand Down Expand Up @@ -1796,7 +1796,7 @@
"fa" = (
/obj/structure/table,
/obj/item/firstaid/regular,
/obj/item/hatchet,
/obj/item/tool/axe/hatchet,
/turf/floor/tiled/airless,
/area/slavers_base/med)
"fb" = (
Expand Down
Loading

0 comments on commit fbc31d0

Please sign in to comment.