Files
Bubberstation/code/game/objects/structures/headpike.dm
nightred 15452cac44 [READY] Two Handed Component (#49422)
About The Pull Request

For an item to be two handed just add this handy component.

All existing two handed items have been converted to use this component.
Why It's Good For The Game

It has components and signals, and now you can make items two handed so simply.

/obj/item/shockpaddles/ComponentInitialize()
	. = ..()
	AddComponent(/datum/component/two_handed)
2020-03-04 11:26:01 +13:00

50 lines
1.2 KiB
Plaintext

/obj/structure/headpike
name = "spooky head on a spear"
desc = "When you really want to send a message."
icon = 'icons/obj/structures.dmi'
icon_state = "headpike"
density = FALSE
anchored = TRUE
var/bonespear = FALSE
var/obj/item/spear/spear
var/obj/item/bodypart/head/victim
/obj/structure/headpike/bone //for bone spears
icon_state = "headpike-bone"
bonespear = TRUE
/obj/structure/headpike/CheckParts(list/parts_list)
..()
victim = locate(/obj/item/bodypart/head) in parts_list
name = "[victim.name] on a spear"
update_icon()
if(bonespear)
spear = locate(/obj/item/spear/bonespear) in parts_list
else
spear = locate(/obj/item/spear) in parts_list
/obj/structure/headpike/Initialize()
. = ..()
pixel_x = rand(-8, 8)
/obj/structure/headpike/update_overlays()
. = ..()
var/obj/item/bodypart/head/H = locate() in contents
if(H)
var/mutable_appearance/MA = new()
MA.copy_overlays(H)
MA.pixel_y = 12
. += H
/obj/structure/headpike/attack_hand(mob/user)
. = ..()
if(.)
return
to_chat(user, "<span class='notice'>You take down [src].</span>")
if(victim)
victim.forceMove(drop_location())
victim = null
spear.forceMove(drop_location())
spear = null
qdel(src)