mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-19 02:54:41 +01:00
Separates the wizard hat and fake beard into two different items (#31171)
* separate wizard hat and beard into two separate items * small sprite tweak * lint * Update code/modules/clothing/suits/wiz_robe.dm Co-authored-by: JimKil3 <47290811+JimKil3@users.noreply.github.com> Signed-off-by: Pooble <90473506+poobsie@users.noreply.github.com> * make the wizzy beard clip onto the wizzy hat --------- Signed-off-by: Pooble <90473506+poobsie@users.noreply.github.com> Co-authored-by: JimKil3 <47290811+JimKil3@users.noreply.github.com>
This commit is contained in:
@@ -193,6 +193,10 @@
|
||||
display_name = "Bandana, skull"
|
||||
path = /obj/item/clothing/mask/bandana/skull
|
||||
|
||||
/datum/gear/fake_beard
|
||||
display_name = "Fake beard"
|
||||
path = /obj/item/clothing/mask/fake_beard
|
||||
|
||||
/datum/gear/pai
|
||||
display_name = "Personal Artificial Intelligence"
|
||||
path = /obj/item/paicard
|
||||
|
||||
@@ -375,36 +375,57 @@
|
||||
var/obj/item/clothing/under/has_under = null
|
||||
/// the attached hats to this hat.
|
||||
var/list/attached_hats = list()
|
||||
/// the attached masks to this hat
|
||||
var/list/attached_masks = list()
|
||||
/// if this hat can have hats placed on top of it.
|
||||
var/can_have_hats = FALSE
|
||||
/// if this hat can be a hat of a hat. Hat^2
|
||||
var/can_be_hat = TRUE
|
||||
/// if this hat can have masks attached to it.
|
||||
var/can_have_mask = FALSE
|
||||
|
||||
|
||||
/obj/item/clothing/head/AltShiftClick(mob/user)
|
||||
if(user.stat || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED) || !Adjacent(user))
|
||||
return
|
||||
if(!length(attached_hats))
|
||||
|
||||
var/list/removable_items = list()
|
||||
removable_items += attached_hats
|
||||
removable_items += attached_masks
|
||||
|
||||
if(!length(removable_items))
|
||||
return
|
||||
var/obj/item/clothing/head/hat
|
||||
if(length(attached_hats) > 1)
|
||||
var/pick = radial_menu_helper(usr, src, attached_hats, custom_check = FALSE, require_near = TRUE)
|
||||
if(!pick || !istype(pick, /obj/item/clothing/head) || !Adjacent(usr))
|
||||
|
||||
var/obj/item/picked_item
|
||||
if(length(removable_items) > 1)
|
||||
var/pick = radial_menu_helper(usr, src, removable_items, custom_check = FALSE, require_near = TRUE)
|
||||
if(!pick || !Adjacent(usr))
|
||||
return
|
||||
hat = pick
|
||||
picked_item = pick
|
||||
else
|
||||
hat = attached_hats[1]
|
||||
remove_hat(user, hat)
|
||||
picked_item = removable_items[1]
|
||||
|
||||
// Remove the appropriate item type
|
||||
if(istype(picked_item, /obj/item/clothing/head))
|
||||
remove_hat(user, picked_item)
|
||||
else if(istype(picked_item, /obj/item/clothing/mask))
|
||||
remove_mask(user, picked_item)
|
||||
|
||||
/obj/item/clothing/head/Destroy()
|
||||
if(is_equipped())
|
||||
var/mob/M = loc
|
||||
for(var/obj/item/clothing/head/H as anything in attached_hats)
|
||||
H.on_removed(M)
|
||||
for(var/obj/item/clothing/mask/mask as anything in attached_masks)
|
||||
detach_mask(mask, null)
|
||||
else
|
||||
for(var/obj/item/clothing/head/H as anything in attached_hats)
|
||||
H.forceMove(get_turf(src))
|
||||
for(var/obj/item/clothing/mask/mask as anything in attached_masks)
|
||||
mask.attached_to_hat = null
|
||||
mask.forceMove(get_turf(src))
|
||||
attached_hats = null
|
||||
attached_masks = null
|
||||
return ..()
|
||||
|
||||
/obj/item/clothing/head/dropped(mob/user, silent)
|
||||
@@ -420,6 +441,9 @@
|
||||
. = ..()
|
||||
for(var/obj/item/clothing/head/hat as anything in attached_hats)
|
||||
. += "\A [hat] is placed neatly on top."
|
||||
for(var/obj/item/clothing/mask/mask as anything in attached_masks)
|
||||
. += "\A [mask] is attached to it."
|
||||
if(length(attached_hats) || length(attached_masks))
|
||||
. += SPAN_NOTICE("<b>Alt-Shift-Click</b> to remove an accessory.")
|
||||
|
||||
//when user attached a hat to H (another hat)
|
||||
@@ -513,9 +537,69 @@
|
||||
/obj/item/clothing/head/attackby__legacy__attackchain(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/clothing/head) && can_have_hats)
|
||||
attach_hat(I, user, TRUE)
|
||||
else if(istype(I, /obj/item/clothing/mask) && can_have_mask)
|
||||
var/obj/item/clothing/mask/M = I
|
||||
if(M.can_attach_to_hat)
|
||||
attach_mask(M, user, TRUE)
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/item/clothing/head/proc/can_attach_mask(obj/item/clothing/mask/mask)
|
||||
if(!can_have_mask)
|
||||
return FALSE
|
||||
if(!mask.can_attach_to_hat)
|
||||
return FALSE
|
||||
if(length(attached_masks) >= 1)
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/item/clothing/head/proc/attach_mask(obj/item/clothing/mask/mask, mob/user, unequip = FALSE)
|
||||
if(!can_attach_mask(mask))
|
||||
to_chat(user, SPAN_NOTICE("You cannot attach [mask] to [src]."))
|
||||
return FALSE
|
||||
|
||||
if(unequip && !user.drop_item_to_ground(mask))
|
||||
return FALSE
|
||||
|
||||
attached_masks += mask
|
||||
mask.attached_to_hat = src
|
||||
mask.forceMove(src)
|
||||
|
||||
if(ishuman(loc))
|
||||
var/mob/living/carbon/human/H = loc
|
||||
H.update_inv_head()
|
||||
|
||||
to_chat(user, SPAN_NOTICE("You attach [mask] to [src]."))
|
||||
return TRUE
|
||||
|
||||
/obj/item/clothing/head/proc/detach_mask(obj/item/clothing/mask/mask, mob/user)
|
||||
if(!(mask in attached_masks))
|
||||
return FALSE
|
||||
|
||||
attached_masks -= mask
|
||||
mask.attached_to_hat = null
|
||||
|
||||
if(user)
|
||||
user.put_in_hands(mask)
|
||||
else
|
||||
mask.forceMove(get_turf(src))
|
||||
|
||||
if(ishuman(loc))
|
||||
var/mob/living/carbon/human/H = loc
|
||||
H.update_inv_head()
|
||||
|
||||
return TRUE
|
||||
|
||||
/obj/item/clothing/head/proc/remove_mask(mob/user, obj/item/clothing/mask/mask)
|
||||
if(!isliving(user))
|
||||
return
|
||||
if(user.incapacitated())
|
||||
return
|
||||
if(!Adjacent(user))
|
||||
return
|
||||
if(detach_mask(mask, user))
|
||||
to_chat(user, SPAN_NOTICE("You remove [mask] from [src]."))
|
||||
|
||||
//////////////////////////////
|
||||
// MARK: MASK
|
||||
//////////////////////////////
|
||||
@@ -528,6 +612,10 @@
|
||||
permeability_coefficient = 0.7
|
||||
|
||||
var/adjusted_flags = null
|
||||
/// If this mask can be attached to a hat
|
||||
var/can_attach_to_hat = FALSE
|
||||
/// The head clothing that this mask is attached to
|
||||
var/obj/item/clothing/head/attached_to_hat = null
|
||||
|
||||
//Proc that moves gas/breath masks out of the way
|
||||
/obj/item/clothing/mask/proc/adjustmask(mob/user)
|
||||
|
||||
@@ -320,6 +320,12 @@
|
||||
desc = "A mask carved out of wood, detailed carefully by hand."
|
||||
icon_state = "bumba"
|
||||
|
||||
/obj/item/clothing/mask/fake_beard
|
||||
name = "fake beard"
|
||||
desc = "A fake beard. Great for making you look wise, festive, or senile."
|
||||
icon_state = "fake_beard"
|
||||
can_attach_to_hat = TRUE
|
||||
|
||||
/obj/item/clothing/mask/fawkes
|
||||
name = "Guy Fawkes mask"
|
||||
desc = "A mask designed to help you remember a specific date."
|
||||
|
||||
@@ -46,13 +46,14 @@
|
||||
)
|
||||
|
||||
/obj/item/clothing/head/wizard/fake
|
||||
desc = "It has WIZZARD written across it in sequins. Comes with a cool beard."
|
||||
desc = "It has WIZZARD written across it in sequins. Clip-on beard sold separately."
|
||||
icon_state = "wizard-fake"
|
||||
gas_transfer_coefficient = 1
|
||||
permeability_coefficient = 1
|
||||
armor = null
|
||||
magical = FALSE
|
||||
resistance_flags = FLAMMABLE
|
||||
can_have_mask = TRUE
|
||||
icon_monitor = 'icons/mob/clothing/species/machine/monitor/hood.dmi'
|
||||
sprite_sheets = list("Vox" = 'icons/mob/clothing/species/vox/head.dmi')
|
||||
|
||||
|
||||
@@ -827,6 +827,11 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
|
||||
var/hat_worn_icon_state = hat.worn_icon_state || hat.icon_state
|
||||
standing.overlays += image(icon = hat_worn_icon, icon_state = hat_worn_icon_state)
|
||||
|
||||
for(var/obj/item/clothing/mask/mask in w_hat.attached_masks)
|
||||
var/mask_worn_icon = listgetindex(mask.sprite_sheets, dna.species.sprite_sheet_name) || mask.worn_icon || 'icons/mob/clothing/mask.dmi'
|
||||
var/mask_worn_icon_state = mask.worn_icon_state || mask.icon_state
|
||||
standing.overlays += image(icon = mask_worn_icon, icon_state = mask_worn_icon_state)
|
||||
|
||||
if(head.blood_DNA)
|
||||
var/image/bloodsies = image("icon" = dna.species.blood_mask, "icon_state" = "helmetblood")
|
||||
bloodsies.color = head.blood_color
|
||||
|
||||
Reference in New Issue
Block a user