Adds woodcutting mechanics (#15906)

* we out there cutting

* Fix

* changelog

* more wood cutting

* stump

* cool icons

* suggestions

* the log
This commit is contained in:
Alberyk
2023-03-07 17:20:14 +00:00
committed by GitHub
parent 17cc271ea5
commit 3392da8f54
19 changed files with 295 additions and 18 deletions
@@ -45,6 +45,9 @@
drop_sound = 'sound/items/drop/axe.ogg'
pickup_sound = 'sound/items/pickup/axe.ogg'
/obj/item/material/hatchet/can_woodcut()
return TRUE
/obj/item/material/hatchet/butch
name = "butcher's cleaver"
icon = 'icons/obj/kitchen.dmi'
@@ -59,6 +62,9 @@
slot_flags = SLOT_BELT
attack_verb = list("cleaved", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")
/obj/item/material/hatchet/butch/can_woodcut()
return FALSE
/obj/item/material/hatchet/unathiknife
name = "duelling knife"
desc = "A length of leather-bound wood studded with razor-sharp teeth. How crude."
@@ -70,6 +76,9 @@
icon_state = "unathiknife"
attack_verb = list("ripped", "torn", "cut")
/obj/item/material/hatchet/unathiknife/can_woodcut()
return FALSE
/obj/item/material/hatchet/machete
name = "machete"
desc = "A long, sturdy blade with a rugged handle. Leading the way to cursed treasures since before space travel."
@@ -92,7 +101,7 @@
/obj/item/material/hatchet/machete/Initialize()
. = ..()
if(build_from_parts)
if(build_from_parts)
var/image/I = image(icon, icon_state = "machete_handle")
I.color = pick(COLOR_BLUE, COLOR_RED, COLOR_CYAN, COLOR_BLACK, COLOR_AMBER, COLOR_GREEN, COLOR_OLIVE, COLOR_GUNMETAL, COLOR_DARK_BLUE_GRAY)
add_overlay(I)
@@ -112,6 +121,12 @@
icon_state = "machetedx"
build_from_parts = FALSE
/obj/item/material/hatchet/lumber
name = "woodcutting hatchet"
desc = "Made from the very things you cut down."
icon_state = "axe"
item_state = "axe"
/obj/item/material/hook
name = "meat hook"
desc = "A sharp, metal hook that sticks into things."
@@ -119,6 +119,9 @@
cleave(user, target)
..()
/obj/item/material/sword/axe/can_woodcut()
return TRUE
/obj/item/material/sword/khopesh
name = "khopesh"
desc = "An ancient sword shapped like a sickle."
@@ -228,6 +228,9 @@
cleave(user, target)
..()
/obj/item/material/twohanded/fireaxe/can_woodcut()
return TRUE
//spears, bay edition
/obj/item/material/twohanded/spear
icon_state = "spearglass0"
@@ -374,6 +377,12 @@
. = ..()
reagents.add_reagent(fuel_type, max_fuel)
/obj/item/material/twohanded/chainsaw/can_woodcut()
if(powered)
return TRUE
else
return ..()
/obj/item/material/twohanded/chainsaw/op //For events or whatever
opendelay = 5
max_fuel = 1000
@@ -547,6 +556,12 @@
sharp = 1
attack_verb = list("attacked", "poked", "jabbed","gored", "chopped", "cleaved", "torn", "cut", "stabbed")
/obj/item/material/twohanded/pike/halberd/can_woodcut()
if(wielded)
return TRUE
else
return ..()
/obj/item/material/twohanded/pike/pitchfork
icon_state = "pitchfork0"
base_icon = "pitchfork"
@@ -137,7 +137,7 @@
active_force = 40
active_throwforce = 60
active_w_class = ITEMSIZE_HUGE
armor_penetration = 20
armor_penetration = 20
throw_speed = 5
throw_range = 10
w_class = ITEMSIZE_HUGE
@@ -210,6 +210,12 @@
icon_state = initial(icon_state)
to_chat(user, "<span class='notice'>\The [src] is de-energised. It's just a regular axe now.</span>")
/obj/item/melee/energy/axe/can_woodcut()
if(active)
return TRUE
else
return FALSE
/*
* Energy Sword
*/