mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-24 05:30:05 +01:00
* Fixes Headsets Being Wonky On Non-Poly Parrots (#82046) ## About The Pull Request Fixes #81861 Basically we just typecasted too hard on the headset strippable item so it was impossible to get headsets from non-Poly parrots. pretty silly mistake because literally everything else is meant to typecast to just `/mob/living/basic/parrot`. one line fix and leroy jenkins ## Why It's Good For The Game parrots shouldn't "eat" headsets and make them entirely unretrievable once placed on their ears. ## Changelog 🆑 fix: If you place a headset on a non-Poly Parrot, you should be able to remove it from the parrot as-expected now rather than having the parrot send it to the shadow realm. /🆑 * Fixes Headsets Being Wonky On Non-Poly Parrots --------- Co-authored-by: san7890 <the@san7890.com>
61 lines
1.8 KiB
Plaintext
61 lines
1.8 KiB
Plaintext
/datum/strippable_item/parrot_headset
|
|
key = STRIPPABLE_ITEM_PARROT_HEADSET
|
|
|
|
/datum/strippable_item/parrot_headset/get_item(atom/source)
|
|
var/mob/living/basic/parrot/parrot_source = source
|
|
return istype(parrot_source) ? parrot_source.ears : null
|
|
|
|
/datum/strippable_item/parrot_headset/try_equip(atom/source, obj/item/equipping, mob/user)
|
|
. = ..()
|
|
if (!.)
|
|
return FALSE
|
|
|
|
if (!istype(equipping, /obj/item/radio/headset))
|
|
to_chat(user, span_warning("[equipping] won't fit!"))
|
|
return FALSE
|
|
|
|
return TRUE
|
|
|
|
// There is no delay for putting a headset on a parrot.
|
|
/datum/strippable_item/parrot_headset/start_equip(atom/source, obj/item/equipping, mob/user)
|
|
return TRUE
|
|
|
|
/datum/strippable_item/parrot_headset/finish_equip(atom/source, obj/item/equipping, mob/user)
|
|
var/obj/item/radio/headset/radio = equipping
|
|
if (!istype(radio))
|
|
return
|
|
|
|
var/mob/living/basic/parrot/parrot_source = source
|
|
if (!istype(parrot_source))
|
|
return
|
|
|
|
if (!user.transferItemToLoc(radio, source))
|
|
return
|
|
|
|
parrot_source.ears = radio
|
|
|
|
to_chat(user, span_notice("You fit [radio] onto [source]."))
|
|
|
|
/datum/strippable_item/parrot_headset/start_unequip(atom/source, mob/user)
|
|
. = ..()
|
|
if (!.)
|
|
return FALSE
|
|
|
|
var/mob/living/basic/parrot/parrot_source = source
|
|
if (!istype(parrot_source))
|
|
return
|
|
|
|
if (parrot_source.stat == CONSCIOUS)
|
|
var/list/list_of_channels = parrot_source.get_available_channels()
|
|
parrot_source.say("[list_of_channels ? "[pick(list_of_channels)] " : null]BAWWWWWK LEAVE THE HEADSET BAWKKKKK!", forced = "attempted headset removal")
|
|
|
|
return TRUE
|
|
|
|
/datum/strippable_item/parrot_headset/finish_unequip(atom/source, mob/user)
|
|
var/mob/living/basic/parrot/parrot_source = source
|
|
if (!istype(parrot_source))
|
|
return
|
|
|
|
parrot_source.ears.forceMove(parrot_source.drop_location())
|
|
parrot_source.ears = null
|