Files
Bubberstation/code/game/objects/structures/headpike.dm
SkyratBot bbedb5d2a2 [MIRROR] Headpikes now use proper grammar when referencing their spear type [MDB IGNORE] (#18644)
* Headpikes now use proper grammar when referencing their spear type (#72626)

## About The Pull Request

When creating a name for the headpike structure, the spear name is now
used, rather than just a reference to the spear itself. This led to
funky grammar and ruined immersion etc etc.
## Why It's Good For The Game

Closes #72583.
## Changelog
🆑
spellcheck: Head-spears are now named properly when using alternate
spear types.
/🆑

* Headpikes now use proper grammar when referencing their spear type

Co-authored-by: Rhials <Datguy33456@gmail.com>
2023-01-11 22:30:12 -08:00

82 lines
1.9 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/obj/item/spear/spear
var/obj/item/spear/speartype = /obj/item/spear
var/obj/item/bodypart/head/victim
/obj/structure/headpike/bone //for bone spears
icon_state = "headpike-bone"
speartype = /obj/item/spear/bonespear
/obj/structure/headpike/bamboo //for bamboo spears
icon_state = "headpike-bamboo"
speartype = /obj/item/spear/bamboospear
/obj/structure/headpike/Initialize(mapload)
. = ..()
if(mapload)
CheckParts()
pixel_x = rand(-8, 8)
/obj/structure/headpike/Destroy()
QDEL_NULL(victim)
QDEL_NULL(spear)
return ..()
/obj/structure/headpike/CheckParts(list/parts_list)
victim = locate() in parts_list
if(!victim) //likely a mapspawned one
victim = new(src)
victim.real_name = random_unique_name(prob(50))
spear = locate(speartype) in parts_list
if(!spear)
spear = new speartype(src)
update_appearance()
return ..()
/obj/structure/headpike/update_name()
name = "[victim.real_name] on a [spear.name]"
return ..()
/obj/structure/headpike/update_overlays()
. = ..()
if(!victim)
return
var/mutable_appearance/MA = new()
MA.copy_overlays(victim)
MA.pixel_y = 12
MA.pixel_x = pixel_x
. += victim
/obj/structure/headpike/handle_atom_del(atom/A)
if(A == victim)
victim = null
if(A == spear)
spear = null
if(!QDELETED(src))
deconstruct(TRUE)
return ..()
/obj/structure/headpike/deconstruct(disassembled)
if(victim) //Make sure the head always comes off
victim.forceMove(drop_location())
victim = null
if(!disassembled)
return ..()
if(spear)
spear.forceMove(drop_location())
spear = null
return ..()
/obj/structure/headpike/attack_hand(mob/user, list/modifiers)
. = ..()
if(.)
return
to_chat(user, span_notice("You take down [src]."))
deconstruct(TRUE)