Refactors butchering to a component - item-based butchering effectiveness, speed, and chances (#35744)

* Butchering component

* auto-butchering based on toolspeed

* Gives drills their butchering back

* redoes toggles
This commit is contained in:
Ashe Higgs
2018-02-25 15:50:16 -05:00
committed by CitadelStationBot
parent 0589c06507
commit a7d5e4cdcf
29 changed files with 207 additions and 30 deletions
+19 -1
View File
@@ -234,6 +234,10 @@
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 100, "acid" = 30)
resistance_flags = FIRE_PROOF
/obj/item/twohanded/fireaxe/Initialize()
. = ..()
AddComponent(/datum/component/butchering, 100, 80, hitsound) //axes are not known for being precision butchering tools
/obj/item/twohanded/fireaxe/update_icon() //Currently only here to fuck with the on-mob icons.
icon_state = "fireaxe[wielded]"
return
@@ -470,6 +474,10 @@
var/obj/item/grenade/explosive = null
var/war_cry = "AAAAARGH!!!"
/obj/item/twohanded/spear/Initialize()
. = ..()
AddComponent(/datum/component/butchering, 100, 70) //decent in a pinch, but pretty bad.
/obj/item/twohanded/spear/suicide_act(mob/living/carbon/user)
user.visible_message("<span class='suicide'>[user] begins to sword-swallow \the [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
if(explosive)
@@ -562,6 +570,10 @@
actions_types = list(/datum/action/item_action/startchainsaw)
var/on = FALSE
/obj/item/twohanded/required/chainsaw/Initialize()
. = ..()
AddComponent(/datum/component/butchering, 30, 100, 0, 'sound/weapons/chainsawhit.ogg', TRUE)
/obj/item/twohanded/required/chainsaw/suicide_act(mob/living/carbon/user)
if(on)
user.visible_message("<span class='suicide'>[user] begins to tear [user.p_their()] head off with [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
@@ -580,8 +592,10 @@
force = on ? force_on : initial(force)
throwforce = on ? force_on : initial(force)
icon_state = "chainsaw_[on ? "on" : "off"]"
GET_COMPONENT_FROM(butchering, /datum/component/butchering, src)
butchering.butchering_enabled = on
if(hitsound == "swing_hit")
if(on)
hitsound = 'sound/weapons/chainsawhit.ogg'
else
hitsound = "swing_hit"
@@ -733,6 +747,10 @@
slot_flags = SLOT_BACK
hitsound = 'sound/weapons/bladeslice.ogg'
/obj/item/twohanded/vibro_weapon/Initialize()
. = ..()
AddComponent(/datum/component/butchering, 20, 105)
/obj/item/twohanded/vibro_weapon/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK)
if(wielded)
final_block_chance *= 2