mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-29 08:08:49 +01:00
no_dresscode variable but this time it doesn't override important slots (#2468)
* once again but better this time * Makes it so that equipping them has no sound * Update code/modules/mob/mob.dm Co-authored-by: Azarak <azarak10@gmail.com> Co-authored-by: Azarak <azarak10@gmail.com>
This commit is contained in:
@@ -481,6 +481,10 @@ SUBSYSTEM_DEF(job)
|
||||
to_chat(M, "<b>You are the [rank].</b>")
|
||||
var/list/packed_items //SKYRAT CHANGE ADDITION - CUSTOMIZATION
|
||||
if(job)
|
||||
//SKYRAT EDIT ADDITION BEGIN - CUSTOMIZATION
|
||||
if (M.client && job.no_dresscode && job.loadout)
|
||||
packed_items = M.client.prefs.equip_preference_loadout(living_mob,FALSE,job,blacklist=job.blacklist_dresscode_slots,initial=TRUE)
|
||||
//SKYRAT EDIT ADDITION END
|
||||
var/new_mob = job.equip(living_mob, null, null, joined_late , null, M.client)//silicons override this proc to return a mob
|
||||
if(ismob(new_mob))
|
||||
living_mob = new_mob
|
||||
@@ -513,9 +517,9 @@ SUBSYSTEM_DEF(job)
|
||||
if(job && living_mob)
|
||||
job.after_spawn(living_mob, M, joined_late) // note: this happens before the mob has a key! M will always have a client, H might not.
|
||||
//SKYRAT CHANGE ADDITION BEGIN - CUSTOMIZATION
|
||||
if(job.loadout)
|
||||
if(!job.no_dresscode && job.loadout)
|
||||
if(M.client)
|
||||
packed_items = M.client.prefs.equip_preference_loadout(living_mob, FALSE, job)
|
||||
packed_items = M.client.prefs.equip_preference_loadout(living_mob, FALSE, job,initial=TRUE)
|
||||
if(packed_items)
|
||||
M.client.prefs.add_packed_items(living_mob, packed_items)
|
||||
//SKYRAT CHANGE ADDITION END
|
||||
|
||||
+10
-2
@@ -366,7 +366,8 @@
|
||||
*
|
||||
* returns 0 if it cannot, 1 if successful
|
||||
*/
|
||||
/mob/proc/equip_to_appropriate_slot(obj/item/W, qdel_on_fail = FALSE)
|
||||
///mob/proc/equip_to_appropriate_slot(obj/item/W, qdel_on_fail = FALSE) (original) SKYRAT EDIT CHANGE - CUSTOMIZATION
|
||||
/mob/proc/equip_to_appropriate_slot(obj/item/W, qdel_on_fail = FALSE, blacklist, initial)
|
||||
if(!istype(W))
|
||||
return FALSE
|
||||
var/slot_priority = W.slot_equipment_priority
|
||||
@@ -382,9 +383,16 @@
|
||||
ITEM_SLOT_LPOCKET, ITEM_SLOT_RPOCKET,\
|
||||
ITEM_SLOT_DEX_STORAGE\
|
||||
)
|
||||
|
||||
//SKYRAT EDIT CHANGE BEGIN - CUSTOMIZATION
|
||||
/*
|
||||
for(var/slot in slot_priority)
|
||||
if(equip_to_slot_if_possible(W, slot, FALSE, TRUE, TRUE, FALSE, FALSE)) //qdel_on_fail = FALSE; disable_warning = TRUE; redraw_mob = TRUE;
|
||||
*/
|
||||
if (blacklist)
|
||||
slot_priority -= blacklist
|
||||
for(var/slot in slot_priority)
|
||||
if(equip_to_slot_if_possible(W, slot, FALSE, TRUE, TRUE, FALSE, initial)) //qdel_on_fail = FALSE; disable_warning = TRUE; redraw_mob = TRUE;
|
||||
//SKYRAT EDIT CHANGE END
|
||||
return TRUE
|
||||
|
||||
if(qdel_on_fail)
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
var/loadout = TRUE
|
||||
//List of banned quirks in their names(dont blame me, that's how they're stored), players can't join as the job if they have the quirk. Associative for the purposes of performance
|
||||
var/list/banned_quirks
|
||||
///A list of slots that can't have loadout items assigned to them if no_dresscode is applied, used for important items such as ID, PDA, backpack and headset
|
||||
var/list/blacklist_dresscode_slots
|
||||
//Whitelist of allowed species for this job. If not specified then all roundstart races can be used. Associative with TRUE
|
||||
var/list/species_whitelist
|
||||
//Blacklist of species for this job.
|
||||
@@ -31,6 +33,7 @@
|
||||
|
||||
/datum/job/assistant
|
||||
no_dresscode = TRUE
|
||||
blacklist_dresscode_slots = list(ITEM_SLOT_EARS,ITEM_SLOT_BELT,ITEM_SLOT_ID,ITEM_SLOT_BACK) //headset, PDA, ID, backpack are important items
|
||||
|
||||
/datum/job/officer
|
||||
banned_quirks = list(SEC_RESTRICTED_QUIRKS)
|
||||
|
||||
+6
-4
@@ -165,7 +165,7 @@
|
||||
parent.show_character_previews(new /mutable_appearance(mannequin))
|
||||
unset_busy_human_dummy(DUMMY_HUMAN_SLOT_PREFERENCES)
|
||||
|
||||
/datum/preferences/proc/equip_preference_loadout(mob/living/carbon/human/H, just_preview = FALSE, datum/job/choosen_job)
|
||||
/datum/preferences/proc/equip_preference_loadout(mob/living/carbon/human/H, just_preview = FALSE, datum/job/choosen_job, blacklist, initial)
|
||||
if(!ishuman(H))
|
||||
return
|
||||
var/list/items_to_pack = list()
|
||||
@@ -175,20 +175,22 @@
|
||||
//Skip the item if the job doesn't match, but only if that not used for the preview
|
||||
if(!just_preview && (choosen_job && LI.restricted_roles && !(choosen_job.title in LI.restricted_roles)))
|
||||
continue
|
||||
if(!H.equip_to_appropriate_slot(ITEM))
|
||||
if(!H.equip_to_appropriate_slot(ITEM,blacklist=blacklist,initial=initial))
|
||||
if(!just_preview)
|
||||
items_to_pack += ITEM
|
||||
//Here we stick it into a bag, if possible
|
||||
if(!H.equip_to_slot_if_possible(ITEM, ITEM_SLOT_BACKPACK, disable_warning = TRUE, bypass_equip_delay_self = TRUE))
|
||||
if(!H.equip_to_slot_if_possible(ITEM, ITEM_SLOT_BACKPACK, disable_warning = TRUE, bypass_equip_delay_self = TRUE, initial=initial))
|
||||
//Otherwise - on the ground
|
||||
ITEM.forceMove(get_turf(H))
|
||||
else
|
||||
qdel(ITEM)
|
||||
return items_to_pack
|
||||
|
||||
|
||||
|
||||
//This needs to be a seperate proc because the character could not have the proper backpack during the moment of loadout equip
|
||||
/datum/preferences/proc/add_packed_items(mob/living/carbon/human/H, list/packed_items, del_on_fail = TRUE)
|
||||
//Here we stick loadout items that couldn't be equipped into a bag.
|
||||
//Here we stick loadout items that couldn't be equipped into a bag.
|
||||
var/obj/item/back_item = H.back
|
||||
for(var/item in packed_items)
|
||||
var/obj/item/ITEM = item
|
||||
|
||||
Reference in New Issue
Block a user