Files
VOREStation/code/datums/outfits/outfit.dm
T
Kashargul 72628d226c More globals (#19247)
* More globals

* planets

* .

* .

* Update jukebox.dm

* Fix timer callback syntax in jukebox.dm

* .
2026-03-15 02:54:17 -04:00

190 lines
5.2 KiB
Plaintext

GLOBAL_LIST_EMPTY(outfits_decls)
GLOBAL_LIST_EMPTY(outfits_decls_by_type)
GLOBAL_DATUM_INIT(outfits_decls_root, /datum/decl/hierarchy/outfit, new) // Rewuires the above lists
/proc/outfit_by_type(var/outfit_type)
return GLOB.outfits_decls_by_type[outfit_type]
/proc/outfits()
return GLOB.outfits_decls
/datum/decl/hierarchy/outfit
name = "Naked"
var/uniform = null
var/suit = null
var/back = null
var/belt = null
var/gloves = null
var/shoes = null
var/head = null
var/mask = null
var/l_ear = null
var/r_ear = null
var/glasses = null
var/id = null
var/l_pocket = null
var/r_pocket = null
var/suit_store = null
var/r_hand = null
var/l_hand = null
// In the list(path=count,otherpath=count) format
var/list/uniform_accessories = list() // webbing, armbands etc - fits in slot_tie
var/list/backpack_contents = list()
var/id_type
var/id_desc
var/id_slot
var/pda_type
var/pda_slot
var/id_pda_assignment
var/headset = /obj/item/radio/headset
var/headset_alt = /obj/item/radio/headset/alt
var/headset_earbud = /obj/item/radio/headset/earbud
var/backpack = /obj/item/storage/backpack
var/satchel_one = /obj/item/storage/backpack/satchel/norm
var/satchel_two = /obj/item/storage/backpack/satchel
var/messenger_bag = /obj/item/storage/backpack/messenger
var/sports_bag = /obj/item/storage/backpack/sport
var/satchel_three = /obj/item/storage/backpack/satchel/strapless
var/flags // Specific flags
var/undress = 1 //Does the outfit undress the mob upon equp?
/datum/decl/hierarchy/outfit/New()
..()
if(is_hidden_category())
return
GLOB.outfits_decls_by_type[type] = src
dd_insertObjectList(GLOB.outfits_decls, src)
/datum/decl/hierarchy/outfit/proc/pre_equip(mob/living/carbon/human/H)
switch(H.headset)
if(1) l_ear = headset
if(2) l_ear = headset_alt
if(3) l_ear = headset_earbud
if(flags & OUTFIT_HAS_BACKPACK)
switch(H.backbag)
if(2) back = backpack
if(3) back = satchel_one
if(4) back = satchel_two
if(5) back = messenger_bag
if(6) back = sports_bag
if(7) back = satchel_three
else back = null
/datum/decl/hierarchy/outfit/proc/post_equip(mob/living/carbon/human/H)
if(flags & OUTFIT_HAS_JETPACK)
var/obj/item/tank/jetpack/J = locate(/obj/item/tank/jetpack) in H
if(!J)
return
J.toggle()
J.toggle_valve()
/datum/decl/hierarchy/outfit/proc/equip(mob/living/carbon/human/H, var/rank, var/assignment)
equip_base(H)
rank = rank || id_pda_assignment
assignment = id_pda_assignment || assignment || rank
var/obj/item/card/id/W = equip_id(H, rank, assignment)
if(W)
rank = W.rank
assignment = W.assignment
equip_pda(H, rank, assignment)
for(var/path in backpack_contents)
var/number = backpack_contents[path]
for(var/i=0,i<number,i++)
H.equip_to_slot_or_del(new path(H), slot_in_backpack)
post_equip(H)
if(W) // We set ID info last to ensure the ID photo is as correct as possible.
H.set_id_info(W)
return 1
/datum/decl/hierarchy/outfit/proc/equip_base(mob/living/carbon/human/H)
pre_equip(H)
//Start with uniform,suit,backpack for additional slots
if(uniform)
H.equip_to_slot_or_del(new uniform(H),slot_w_uniform)
if(suit)
if(!(H.client?.prefs?.no_jacket))
H.equip_to_slot_or_del(new suit(H),slot_wear_suit)
if(back)
H.equip_to_slot_or_del(new back(H),slot_back)
if(belt)
H.equip_to_slot_or_del(new belt(H),slot_belt)
if(gloves)
H.equip_to_slot_or_del(new gloves(H),slot_gloves)
if(shoes)
if(!(H.client?.prefs?.shoe_hater)) //RS ADD
H.equip_to_slot_or_del(new shoes(H),slot_shoes)
if(mask)
H.equip_to_slot_or_del(new mask(H),slot_wear_mask)
if(head)
H.equip_to_slot_or_del(new head(H),slot_head)
if(l_ear)
H.equip_to_slot_or_del(new l_ear(H),slot_l_ear)
if(r_ear)
H.equip_to_slot_or_del(new r_ear(H),slot_r_ear)
if(glasses)
H.equip_to_slot_or_del(new glasses(H),slot_glasses)
if(id)
H.equip_to_slot_or_del(new id(H),slot_wear_id)
if(l_pocket)
H.equip_to_slot_or_del(new l_pocket(H),slot_l_store)
if(r_pocket)
H.equip_to_slot_or_del(new r_pocket(H),slot_r_store)
if(suit_store)
H.equip_to_slot_or_del(new suit_store(H),slot_s_store)
if(l_hand)
H.put_in_l_hand(new l_hand(H))
if(r_hand)
H.put_in_r_hand(new r_hand(H))
for(var/path in uniform_accessories)
var/number = uniform_accessories[path]
for(var/i=0,i<number,i++)
H.equip_to_slot_or_del(new path(H), slot_tie)
if(H.species)
H.species.equip_survival_gear(H, flags&OUTFIT_EXTENDED_SURVIVAL, flags&OUTFIT_COMPREHENSIVE_SURVIVAL)
/datum/decl/hierarchy/outfit/proc/equip_id(mob/living/carbon/human/H, rank, assignment)
if(!id_slot || !id_type)
return
var/obj/item/card/id/W = new id_type(H)
if(id_desc)
W.desc = id_desc
if(rank)
W.rank = rank
if(assignment)
W.assignment = assignment
if(H.equip_to_slot_or_del(W, id_slot))
return W
/datum/decl/hierarchy/outfit/proc/equip_pda(mob/living/carbon/human/H, rank, assignment)
if(!pda_slot || !pda_type)
return
var/obj/item/pda/pda = new pda_type(H)
if(H.equip_to_slot_or_del(pda, pda_slot))
pda.owner = H.real_name
pda.ownjob = assignment
pda.ownrank = rank
pda.name = "PDA-[H.real_name] ([assignment])"
if(H.client?.prefs.ringtone) // if null we use the job default
pda.ttone = H.client.prefs.ringtone
return pda
/datum/decl/hierarchy/outfit/dd_SortValue()
return name