mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-09 15:15:34 +01:00
21b4095dfd
Upstream 04/17/2026 fixes https://github.com/Bubberstation/Bubberstation/issues/5549 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: tgstation-ci[bot] <179393467+tgstation-ci[bot]@users.noreply.github.com> Co-authored-by: ArcaneMusic <41715314+ArcaneMusic@users.noreply.github.com> Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com> Co-authored-by: Rhials <28870487+Rhials@users.noreply.github.com> Co-authored-by: rageguy505 <54517726+rageguy505@users.noreply.github.com> Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com> Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com> Co-authored-by: Aliceee2ch <160794176+Aliceee2ch@users.noreply.github.com> Co-authored-by: Time-Green <7501474+Time-Green@users.noreply.github.com> Co-authored-by: Tsar-Salat <62388554+Tsar-Salat@users.noreply.github.com> Co-authored-by: SmArtKar <44720187+SmArtKar@users.noreply.github.com> Co-authored-by: Maxipat <108554989+Maxipat112@users.noreply.github.com> Co-authored-by: SyncIt21 <110812394+SyncIt21@users.noreply.github.com> Co-authored-by: deltanedas <39013340+deltanedas@users.noreply.github.com> Co-authored-by: SimplyLogan <47579821+loganuk@users.noreply.github.com> Co-authored-by: loganuk <fakeemail123@aol.com> Co-authored-by: Leland Kemble <70413276+lelandkemble@users.noreply.github.com> Co-authored-by: FalloutFalcon <86381784+FalloutFalcon@users.noreply.github.com> Co-authored-by: Roxy <75404941+TealSeer@users.noreply.github.com> Co-authored-by: Lucy <lucy@absolucy.moe> Co-authored-by: siliconOpossum <138069572+siliconOpossum@users.noreply.github.com> Co-authored-by: Isratosh <Isratosh@hotmail.com> Co-authored-by: TheRyeGuyWhoWillNowDie <70169560+TheRyeGuyWhoWillNowDie@users.noreply.github.com> Co-authored-by: Neocloudy <88008002+Neocloudy@users.noreply.github.com> Co-authored-by: Alexander V. <volas@ya.ru> Co-authored-by: ElGitificador <168473461+ElGitificador@users.noreply.github.com> Co-authored-by: Twaticus <46540570+Twaticus@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com> Co-authored-by: Cameron Lennox <killer65311@gmail.com> Co-authored-by: Tim <timothymtorres@gmail.com> Co-authored-by: Iamgoofball <iamgoofball@gmail.com> Co-authored-by: Layzu666 <121319428+Layzu666@users.noreply.github.com> Co-authored-by: Arturlang <24881678+Arturlang@users.noreply.github.com> Co-authored-by: _0Steven <42909981+00-Steven@users.noreply.github.com> Co-authored-by: mrmanlikesbt <99309552+mrmanlikesbt@users.noreply.github.com> Co-authored-by: Ben10Omintrix <138636438+Ben10Omintrix@users.noreply.github.com> Co-authored-by: John F. Kennedy <54908920+MacaroniCritter@users.noreply.github.com> Co-authored-by: Cursor <102828457+theselfish@users.noreply.github.com> Co-authored-by: Josh <josh.adam.powell@gmail.com> Co-authored-by: Josh Powell <josh.powell@softwire.com> Co-authored-by: Yobrocharlie <Charliemiller5617@gmail.com> Co-authored-by: Hardly3D <66234359+Hardly3D@users.noreply.github.com> Co-authored-by: shayoki <96078776+shayoki@users.noreply.github.com> Co-authored-by: LT3 <83487515+lessthnthree@users.noreply.github.com>
272 lines
9.2 KiB
Plaintext
272 lines
9.2 KiB
Plaintext
#define MANNEQUIN_WOOD "wood"
|
|
#define MANNEQUIN_PLASTIC "plastic"
|
|
#define MANNEQUIN_SKELETON "skeleton"
|
|
|
|
/// A mannequin! A structure that can display clothing on itself.
|
|
/obj/structure/mannequin
|
|
name = "mannequin"
|
|
desc = "Oh, so this is a dress-up game now."
|
|
icon = 'icons/mob/human/mannequin.dmi'
|
|
icon_state = "mannequin_wood_male"
|
|
density = TRUE
|
|
resistance_flags = FLAMMABLE
|
|
appearance_flags = KEEP_TOGETHER|TILE_BOUND|PIXEL_SCALE|LONG_GLIDE
|
|
mouse_drag_pointer = MOUSE_ACTIVE_POINTER
|
|
pixel_y = 3
|
|
base_pixel_y = 3
|
|
layer = ABOVE_MOB_LAYER
|
|
plane = ABOVE_GAME_PLANE
|
|
/// Which body type we use, male or female?
|
|
var/body_type
|
|
/// Material we're used of, wood or plastic?
|
|
var/material
|
|
/// String for the underwear we use.
|
|
var/underwear_name
|
|
/// String for the undershirt we use.
|
|
var/undershirt_name
|
|
/// String for the socks we use.
|
|
var/socks_name
|
|
/// Static list of slot flags we have clothing slots for.
|
|
var/static/list/slot_flags = list(
|
|
ITEM_SLOT_HEAD,
|
|
ITEM_SLOT_EYES,
|
|
ITEM_SLOT_EARS,
|
|
ITEM_SLOT_MASK,
|
|
ITEM_SLOT_NECK,
|
|
ITEM_SLOT_BACK,
|
|
ITEM_SLOT_BELT,
|
|
ITEM_SLOT_ID,
|
|
ITEM_SLOT_ICLOTHING,
|
|
ITEM_SLOT_OCLOTHING,
|
|
ITEM_SLOT_GLOVES,
|
|
ITEM_SLOT_FEET,
|
|
)
|
|
/// Assoc list of all item slots (turned to strings) to the items they hold.
|
|
var/list/worn_items = list()
|
|
///List of all clothing items the mannequin should be spawning in with on Initialize.
|
|
var/list/obj/item/clothing/starting_items = list()
|
|
|
|
/obj/structure/mannequin/Initialize(mapload)
|
|
. = ..()
|
|
for(var/slot_flag in slot_flags)
|
|
worn_items["[slot_flag]"] = null
|
|
for(var/obj/item/clothing/items as anything in starting_items)
|
|
if(initial(items.slot_flags) & slot_flag)
|
|
worn_items["[slot_flag]"] = new items(src)
|
|
starting_items -= items
|
|
break
|
|
if(starting_items.len)
|
|
CRASH("[src] had [starting_items.len] starting items fail to equip.")
|
|
if(!body_type)
|
|
body_type = pick(MALE, FEMALE)
|
|
if(!material)
|
|
material = pick(MANNEQUIN_WOOD, MANNEQUIN_PLASTIC)
|
|
icon_state = "mannequin_[material]_[body_type == FEMALE ? "female" : "male"]"
|
|
AddElement(/datum/element/strippable, GLOB.strippable_mannequin_items)
|
|
AddElement(/datum/element/simple_rotation, ROTATION_IGNORE_ANCHORED)
|
|
AddComponent(/datum/component/marionette)
|
|
update_appearance()
|
|
|
|
/obj/structure/mannequin/Destroy()
|
|
QDEL_LIST_ASSOC_VAL(worn_items)
|
|
return ..()
|
|
|
|
/obj/structure/mannequin/atom_destruction(damage_flag)
|
|
for(var/slot_flag in worn_items)
|
|
var/obj/item/worn_item = worn_items[slot_flag]
|
|
if(worn_item)
|
|
worn_item.forceMove(drop_location())
|
|
return ..()
|
|
|
|
/obj/structure/mannequin/Exited(atom/movable/gone, direction)
|
|
. = ..()
|
|
for(var/slot_flag in worn_items)
|
|
if(worn_items[slot_flag] == gone)
|
|
worn_items[slot_flag] = null
|
|
update_appearance()
|
|
|
|
/obj/structure/mannequin/wrench_act(mob/living/user, obj/item/tool)
|
|
. = ..()
|
|
default_unfasten_wrench(user, tool)
|
|
return ITEM_INTERACT_SUCCESS
|
|
|
|
/obj/structure/mannequin/update_overlays()
|
|
. = ..()
|
|
var/mutable_appearance/pedestal = mutable_appearance(icon, "pedestal_[material]")
|
|
pedestal.pixel_z = -3
|
|
. += pedestal
|
|
var/datum/sprite_accessory/clothing/underwear/underwear = SSaccessories.underwear_list[underwear_name]
|
|
var/mutable_appearance/underwear_overlay = underwear?.make_appearance(COLOR_WHITE, body_type, BODYSHAPE_HUMANOID)
|
|
if(underwear_overlay)
|
|
. += underwear_overlay
|
|
var/datum/sprite_accessory/clothing/undershirt/undershirt = SSaccessories.undershirt_list[undershirt_name]
|
|
var/mutable_appearance/undershirt_overlay = undershirt?.make_appearance(COLOR_WHITE, body_type, BODYSHAPE_HUMANOID)
|
|
if(undershirt_overlay)
|
|
. += undershirt_overlay
|
|
var/datum/sprite_accessory/clothing/socks/socks = SSaccessories.socks_list[socks_name]
|
|
var/mutable_appearance/socks_overlay = socks?.make_appearance(COLOR_WHITE, body_type, BODYSHAPE_HUMANOID)
|
|
if(socks_overlay)
|
|
. += socks_overlay
|
|
//SKYRAT EDIT ADDITION BEGIN - Underwear and Bra split
|
|
var/datum/sprite_accessory/clothing/bra/bra = SSaccessories.bra_list[bra_name]
|
|
if(bra)
|
|
. += mutable_appearance(bra.icon, bra.icon_state, -BODY_LAYER)
|
|
//SKYRAT EDIT END
|
|
for(var/slot_flag in worn_items)
|
|
var/obj/item/worn_item = worn_items[slot_flag]
|
|
if(!worn_item)
|
|
continue
|
|
var/default_icon = get_default_icon_by_slot(text2num(slot_flag))
|
|
var/default_layer = get_default_layer_by_slot(text2num(slot_flag))
|
|
var/female_icon = NO_FEMALE_UNIFORM
|
|
if(body_type == FEMALE && istype(worn_item, /obj/item/clothing/under))
|
|
var/obj/item/clothing/under/worn_jumpsuit = worn_item
|
|
female_icon = worn_jumpsuit.female_sprite_flags
|
|
. += worn_item.build_worn_icon(default_layer, default_icon, female_uniform = female_icon)
|
|
|
|
/obj/structure/mannequin/attack_hand_secondary(mob/user, list/modifiers)
|
|
. = ..()
|
|
if(. == SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN)
|
|
return
|
|
var/choice = tgui_input_list(user, "Underwear, Bra, Undershirt, or Socks?", "Changing", list("Underwear", "Bra", "Undershirt","Socks")) //SKYRAT EDIT ADDITION - Underwear and Bra split
|
|
if(!Adjacent(user))
|
|
return
|
|
switch(choice)
|
|
if("Underwear")
|
|
var/new_undies = tgui_input_list(user, "Select the mannequin's underwear", "Changing", SSaccessories.underwear_list)
|
|
if(new_undies)
|
|
underwear_name = new_undies
|
|
if("Undershirt")
|
|
var/new_undershirt = tgui_input_list(user, "Select the mannequin's undershirt", "Changing", SSaccessories.undershirt_list)
|
|
if(new_undershirt)
|
|
undershirt_name = new_undershirt
|
|
if("Socks")
|
|
var/new_socks = tgui_input_list(user, "Select the mannequin's socks", "Changing", SSaccessories.socks_list)
|
|
if(new_socks)
|
|
socks_name = new_socks
|
|
//SKYRAT EDIT ADDITION BEGIN - Underwear and Bra split
|
|
if("Bra")
|
|
var/new_bra = tgui_input_list(user, "Select the mannequin's bra", "Changing", SSaccessories.bra_list)
|
|
if(new_bra)
|
|
bra_name = new_bra
|
|
//SKYRAT EDIT END
|
|
update_appearance()
|
|
|
|
/obj/structure/mannequin/wood
|
|
material = MANNEQUIN_WOOD
|
|
custom_materials = list(/datum/material/wood = SHEET_MATERIAL_AMOUNT * 25)
|
|
|
|
/obj/structure/mannequin/plastic
|
|
material = MANNEQUIN_PLASTIC
|
|
custom_materials = list(/datum/material/plastic = SHEET_MATERIAL_AMOUNT * 25)
|
|
|
|
/obj/structure/mannequin/skeleton
|
|
name = "skeleton model"
|
|
desc = "Not to knock over."
|
|
material = MANNEQUIN_SKELETON
|
|
obj_flags = UNIQUE_RENAME
|
|
starting_items = list(
|
|
/obj/item/clothing/glasses/eyepatch,
|
|
/obj/item/clothing/suit/costume/hawaiian,
|
|
)
|
|
|
|
GLOBAL_LIST_INIT(strippable_mannequin_items, create_strippable_list(list(
|
|
/datum/strippable_item/mannequin_slot/head,
|
|
/datum/strippable_item/mannequin_slot/eyes,
|
|
/datum/strippable_item/mannequin_slot/ears,
|
|
/datum/strippable_item/mannequin_slot/mask,
|
|
/datum/strippable_item/mannequin_slot/neck,
|
|
/datum/strippable_item/mannequin_slot/back,
|
|
/datum/strippable_item/mannequin_slot/belt,
|
|
/datum/strippable_item/mannequin_slot/id,
|
|
/datum/strippable_item/mannequin_slot/uniform,
|
|
/datum/strippable_item/mannequin_slot/suit,
|
|
/datum/strippable_item/mannequin_slot/gloves,
|
|
/datum/strippable_item/mannequin_slot/feet,
|
|
)))
|
|
|
|
/datum/strippable_item/mannequin_slot
|
|
/// The ITEM_SLOT_* to equip to.
|
|
var/item_slot
|
|
|
|
/datum/strippable_item/mannequin_slot/get_item(atom/source)
|
|
var/obj/structure/mannequin/mannequin_source = source
|
|
return istype(mannequin_source) ? mannequin_source.worn_items["[item_slot]"] : null
|
|
|
|
/datum/strippable_item/mannequin_slot/try_equip(atom/source, obj/item/equipping, mob/user)
|
|
. = ..()
|
|
if(!.)
|
|
return FALSE
|
|
if(!(equipping.slot_flags & item_slot))
|
|
to_chat(user, span_warning("[equipping] won't fit!"))
|
|
return FALSE
|
|
return TRUE
|
|
|
|
/datum/strippable_item/mannequin_slot/finish_equip(atom/source, obj/item/equipping, mob/user)
|
|
var/obj/structure/mannequin/mannequin_source = source
|
|
if(!istype(mannequin_source))
|
|
return
|
|
if(!user.transferItemToLoc(equipping, mannequin_source) || QDELETED(equipping))
|
|
return
|
|
mannequin_source.worn_items["[item_slot]"] = equipping
|
|
mannequin_source.update_appearance()
|
|
|
|
/datum/strippable_item/mannequin_slot/finish_unequip(atom/source, mob/user)
|
|
var/obj/structure/mannequin/mannequin_source = source
|
|
if(!istype(mannequin_source))
|
|
return
|
|
var/obj/item/unequipped = mannequin_source.worn_items["[item_slot]"]
|
|
user.put_in_hands(unequipped)
|
|
|
|
/datum/strippable_item/mannequin_slot/head
|
|
key = STRIPPABLE_ITEM_HEAD
|
|
item_slot = ITEM_SLOT_HEAD
|
|
|
|
/datum/strippable_item/mannequin_slot/eyes
|
|
key = STRIPPABLE_ITEM_EYES
|
|
item_slot = ITEM_SLOT_EYES
|
|
|
|
/datum/strippable_item/mannequin_slot/ears
|
|
key = STRIPPABLE_ITEM_EARS
|
|
item_slot = ITEM_SLOT_EARS
|
|
|
|
/datum/strippable_item/mannequin_slot/mask
|
|
key = STRIPPABLE_ITEM_MASK
|
|
item_slot = ITEM_SLOT_MASK
|
|
|
|
/datum/strippable_item/mannequin_slot/neck
|
|
key = STRIPPABLE_ITEM_NECK
|
|
item_slot = ITEM_SLOT_NECK
|
|
|
|
/datum/strippable_item/mannequin_slot/back
|
|
key = STRIPPABLE_ITEM_BACK
|
|
item_slot = ITEM_SLOT_BACK
|
|
|
|
/datum/strippable_item/mannequin_slot/belt
|
|
key = STRIPPABLE_ITEM_BELT
|
|
item_slot = ITEM_SLOT_BELT
|
|
|
|
/datum/strippable_item/mannequin_slot/id
|
|
key = STRIPPABLE_ITEM_ID
|
|
item_slot = ITEM_SLOT_ID
|
|
|
|
/datum/strippable_item/mannequin_slot/uniform
|
|
key = STRIPPABLE_ITEM_JUMPSUIT
|
|
item_slot = ITEM_SLOT_ICLOTHING
|
|
|
|
/datum/strippable_item/mannequin_slot/suit
|
|
key = STRIPPABLE_ITEM_SUIT
|
|
item_slot = ITEM_SLOT_OCLOTHING
|
|
|
|
/datum/strippable_item/mannequin_slot/gloves
|
|
key = STRIPPABLE_ITEM_GLOVES
|
|
item_slot = ITEM_SLOT_GLOVES
|
|
|
|
/datum/strippable_item/mannequin_slot/feet
|
|
key = STRIPPABLE_ITEM_FEET
|
|
item_slot = ITEM_SLOT_FEET
|
|
|
|
#undef MANNEQUIN_WOOD
|
|
#undef MANNEQUIN_PLASTIC
|
|
#undef MANNEQUIN_SKELETON
|