[REFACTOR] Consolidates SLOT_FLAG and SLOT_HUD into one ITEM_SLOT flag (#26743)

* IT WORKS UP UNTIL THIS POINT

* Consolidates SLOT_FLAG and SLOT_HUD into one

* Remove cover_both_ears

* SLOT_HUD to ITEM_SLOT

* Remove clothing_trait changes for the time being

* Remove accidental copy-paste

* Re-add no-slip var

* More failure to copy-paste correctly

* Leftover flag

* Combine left and right slot flags where possible

* UNGOOF MY DEFINES, PHAND IS NOT A THING

* Minor spacing changes

* Some more fixes from merge

* Seperates ITEM SLOT AMOUNT into two defines

* ON SECOND THOUGHT LETS NOT DO THAT.

* Addresses Contra's review

* Thank you GREP

* Rename ITEM_SLOT_FEET to ITEM_SLOT_SHOES

* Added a comment to the bitmasks in clothing defines

* Rename ITEM_SLOT_TIE to ITEM_SLOT_ACCESSORY

* These are for a seperate PR.

* Magboot fixes

* Requested changes

* Re-add accidental removal

* Wrong flags

* Update code/__DEFINES/clothing_defines.dm

Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com>
Signed-off-by: Chap <erwin@lombok.demon.nl>

* Requested changes

* Merge fixes

* Fix double headset

* Fixes multiple accessories

---------

Signed-off-by: Chap <erwin@lombok.demon.nl>
Co-authored-by: Adrer <adrermail@gmail.com>
Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com>
This commit is contained in:
Chap
2024-11-13 13:02:29 +00:00
committed by GitHub
co-authored by Contrabang Adrer
parent c297dde150
commit d90a70ecda
232 changed files with 1231 additions and 1192 deletions
+26 -11
View File
@@ -61,9 +61,9 @@
/mob/proc/put_in_hand(obj/item/I, slot)
switch(slot)
if(SLOT_HUD_LEFT_HAND)
if(ITEM_SLOT_LEFT_HAND)
return put_in_l_hand(I)
if(SLOT_HUD_RIGHT_HAND)
if(ITEM_SLOT_RIGHT_HAND)
return put_in_r_hand(I)
//Puts the item into your l_hand if possible and calls all necessary triggers/updates. returns 1 on success.
@@ -75,7 +75,7 @@
l_hand = W
W.layer = ABOVE_HUD_LAYER //TODO: move to equipped?
W.plane = ABOVE_HUD_PLANE //TODO: move to equipped?
W.equipped(src, SLOT_HUD_LEFT_HAND)
W.equipped(src, ITEM_SLOT_LEFT_HAND)
if(pulling == W)
stop_pulling()
update_inv_l_hand()
@@ -91,7 +91,7 @@
r_hand = W
W.layer = ABOVE_HUD_LAYER
W.plane = ABOVE_HUD_PLANE
W.equipped(src,SLOT_HUD_RIGHT_HAND)
W.equipped(src,ITEM_SLOT_RIGHT_HAND)
if(pulling == W)
stop_pulling()
update_inv_r_hand()
@@ -277,17 +277,17 @@
S.handle_item_insertion(src, M)
return TRUE
S = M.get_item_by_slot(SLOT_HUD_WEAR_ID)
S = M.get_item_by_slot(ITEM_SLOT_ID)
if(istype(S) && S.can_be_inserted(src, TRUE)) //else we put in a wallet
S.handle_item_insertion(src, M)
return TRUE
S = M.get_item_by_slot(SLOT_HUD_BELT)
S = M.get_item_by_slot(ITEM_SLOT_BELT)
if(istype(S) && S.can_be_inserted(src, TRUE)) //else we put in belt
S.handle_item_insertion(src, M)
return TRUE
var/obj/item/O = M.get_item_by_slot(SLOT_HUD_BACK) //else we put in backpack
var/obj/item/O = M.get_item_by_slot(ITEM_SLOT_BACK) //else we put in backpack
if(istype(O, /obj/item/storage))
S = O
if(S.can_be_inserted(src, TRUE))
@@ -315,16 +315,31 @@
/mob/proc/get_item_by_slot(slot_id)
switch(slot_id)
if(SLOT_HUD_WEAR_MASK)
if(ITEM_SLOT_MASK)
return wear_mask
if(SLOT_HUD_BACK)
if(ITEM_SLOT_BACK)
return back
if(SLOT_HUD_LEFT_HAND)
if(ITEM_SLOT_LEFT_HAND)
return l_hand
if(SLOT_HUD_RIGHT_HAND)
if(ITEM_SLOT_RIGHT_HAND)
return r_hand
return null
/mob/proc/get_slot_by_item(obj/item/looking_for)
if(looking_for == wear_mask)
return ITEM_SLOT_MASK
if(looking_for == back)
return ITEM_SLOT_BACK
if(looking_for == l_hand)
return ITEM_SLOT_LEFT_HAND
if(looking_for == r_hand)
return ITEM_SLOT_RIGHT_HAND
return null
//search for a path in inventory and storage items in that inventory (backpack, belt, etc) and return it.
/mob/proc/find_item(path)
var/list/L = get_contents()
@@ -11,7 +11,7 @@
var/obj/item/W = get_active_hand()
if(!W)
switch(slot_id)
if(SLOT_HUD_OUTER_SUIT)
if(ITEM_SLOT_OUTER_SUIT)
if(wear_suit) wear_suit.attack_alien(src)
if(SLOT_HUD_HEAD)
if(ITEM_SLOT_HEAD)
if(head) head.attack_alien(src)
@@ -68,7 +68,7 @@
/mob/living/carbon/alien/humanoid/update_inv_wear_suit()
if(client && hud_used)
var/atom/movable/screen/inventory/inv = hud_used.inv_slots[SLOT_HUD_OUTER_SUIT]
var/atom/movable/screen/inventory/inv = hud_used.inv_slots[ITEM_SLOT_2_INDEX(ITEM_SLOT_OUTER_SUIT)]
inv.update_icon()
if(wear_suit)
@@ -138,7 +138,7 @@
"<span class='userdanger'>[src] tears [W] off of [target]'s face!</span>")
src.loc = target
target.equip_to_slot_if_possible(src, SLOT_HUD_WEAR_MASK, FALSE, TRUE)
target.equip_to_slot_if_possible(src, ITEM_SLOT_MASK, FALSE, TRUE)
if(!sterile)
M.KnockDown(impregnation_time + 2 SECONDS)
flags |= NODROP //You can't take it off until it dies... or figures out you're an IPC.
+22 -7
View File
@@ -766,22 +766,37 @@ GLOBAL_LIST_INIT(ventcrawl_machinery, list(/obj/machinery/atmospherics/unary/ven
/mob/living/carbon/get_item_by_slot(slot_id)
switch(slot_id)
if(SLOT_HUD_BACK)
if(ITEM_SLOT_BACK)
return back
if(SLOT_HUD_WEAR_MASK)
if(ITEM_SLOT_MASK)
return wear_mask
if(SLOT_HUD_OUTER_SUIT)
if(ITEM_SLOT_OUTER_SUIT)
return wear_suit
if(SLOT_HUD_LEFT_HAND)
if(ITEM_SLOT_LEFT_HAND)
return l_hand
if(SLOT_HUD_RIGHT_HAND)
if(ITEM_SLOT_RIGHT_HAND)
return r_hand
if(SLOT_HUD_HANDCUFFED)
if(ITEM_SLOT_HANDCUFFED)
return handcuffed
if(SLOT_HUD_LEGCUFFED)
if(ITEM_SLOT_LEGCUFFED)
return legcuffed
return null
/mob/living/carbon/get_slot_by_item(obj/item/looking_for)
if(looking_for == back)
return ITEM_SLOT_BACK
// if(back && (looking_for in back))
// return ITEM_SLOT_BACKPACK
if(looking_for == wear_mask)
return ITEM_SLOT_MASK
if(looking_for == head)
return ITEM_SLOT_HEAD
return ..()
//generates realistic-ish pulse output based on preset levels
/mob/living/carbon/proc/get_pulse()
var/temp = 0
@@ -1,10 +1,10 @@
/datum/strippable_item/mob_item_slot/head
key = STRIPPABLE_ITEM_HEAD
item_slot = SLOT_HUD_HEAD
item_slot = ITEM_SLOT_HEAD
/datum/strippable_item/mob_item_slot/back
key = STRIPPABLE_ITEM_BACK
item_slot = SLOT_HUD_BACK
item_slot = ITEM_SLOT_BACK
/datum/strippable_item/mob_item_slot/back/get_alternate_actions(atom/source, mob/user)
return get_strippable_alternate_action_internals(get_item(source), source)
@@ -16,7 +16,7 @@
/datum/strippable_item/mob_item_slot/mask
key = STRIPPABLE_ITEM_MASK
item_slot = SLOT_HUD_WEAR_MASK
item_slot = ITEM_SLOT_MASK
/datum/strippable_item/mob_item_slot/mask/get_body_action(atom/source, mob/user)
if(!ishuman(source))
@@ -84,7 +84,7 @@
/datum/strippable_item/mob_item_slot/handcuffs
key = STRIPPABLE_ITEM_HANDCUFFS
item_slot = SLOT_HUD_HANDCUFFED
item_slot = ITEM_SLOT_HANDCUFFED
/datum/strippable_item/mob_item_slot/handcuffs/should_show(atom/source, mob/user)
if(!iscarbon(source))
@@ -99,7 +99,7 @@
/datum/strippable_item/mob_item_slot/legcuffs
key = STRIPPABLE_ITEM_LEGCUFFS
item_slot = SLOT_HUD_LEGCUFFED
item_slot = ITEM_SLOT_LEGCUFFED
/datum/strippable_item/mob_item_slot/legcuffs/should_show(atom/source, mob/user)
if(!iscarbon(source))
@@ -173,8 +173,8 @@
/datum/strippable_item/hand/left
key = STRIPPABLE_ITEM_LHAND
which_hand = SLOT_HUD_LEFT_HAND
which_hand = ITEM_SLOT_LEFT_HAND
/datum/strippable_item/hand/right
key = STRIPPABLE_ITEM_RHAND
which_hand = SLOT_HUD_RIGHT_HAND
which_hand = ITEM_SLOT_RIGHT_HAND
@@ -35,9 +35,9 @@
/mob/living/carbon/proc/update_hands_hud()
if(!hud_used)
return
var/atom/movable/screen/inventory/R = hud_used.inv_slots[SLOT_HUD_RIGHT_HAND]
var/atom/movable/screen/inventory/R = hud_used.inv_slots[ITEM_SLOT_2_INDEX(ITEM_SLOT_RIGHT_HAND)]
R?.update_icon()
var/atom/movable/screen/inventory/L = hud_used.inv_slots[SLOT_HUD_LEFT_HAND]
var/atom/movable/screen/inventory/L = hud_used.inv_slots[ITEM_SLOT_2_INDEX(ITEM_SLOT_LEFT_HAND)]
L?.update_icon()
/mob/living/carbon/update_inv_r_hand(ignore_cuffs)
@@ -66,8 +66,8 @@
update_hud_wear_mask(wear_mask)
/mob/living/carbon/update_inv_back()
if(client && hud_used && hud_used.inv_slots[SLOT_HUD_BACK])
var/atom/movable/screen/inventory/inv = hud_used.inv_slots[SLOT_HUD_BACK]
if(client && hud_used && hud_used.inv_slots[ITEM_SLOT_2_INDEX(ITEM_SLOT_BACK)])
var/atom/movable/screen/inventory/inv = hud_used.inv_slots[ITEM_SLOT_2_INDEX(ITEM_SLOT_BACK)]
inv.update_icon()
if(back)
+1 -1
View File
@@ -208,7 +208,7 @@
var/just_sleeping = FALSE //We don't appear as dead upon casual examination, just sleeping
if(stat == DEAD || HAS_TRAIT(src, TRAIT_FAKEDEATH))
var/obj/item/clothing/glasses/E = get_item_by_slot(SLOT_HUD_GLASSES)
var/obj/item/clothing/glasses/E = get_item_by_slot(ITEM_SLOT_EYES)
var/are_we_in_weekend_at_bernies = E?.tint && istype(buckled, /obj/structure/chair) //Are we in a chair with our eyes obscured?
if(isliving(user) && are_we_in_weekend_at_bernies)
@@ -20,50 +20,50 @@
/mob/living/carbon/human/proc/has_organ_for_slot(slot)
switch(slot)
if(SLOT_HUD_BACK)
if(ITEM_SLOT_BACK)
return has_organ("chest")
if(SLOT_HUD_WEAR_MASK)
if(ITEM_SLOT_MASK)
return has_organ("head")
if(SLOT_HUD_HANDCUFFED)
if(ITEM_SLOT_HANDCUFFED)
return has_organ("l_hand") && has_organ("r_hand")
if(SLOT_HUD_LEGCUFFED)
if(ITEM_SLOT_LEGCUFFED)
return has_organ("l_leg") && has_organ("r_leg")
if(SLOT_HUD_LEFT_HAND)
if(ITEM_SLOT_LEFT_HAND)
return has_organ("l_hand")
if(SLOT_HUD_RIGHT_HAND)
if(ITEM_SLOT_RIGHT_HAND)
return has_organ("r_hand")
if(SLOT_HUD_BELT)
if(ITEM_SLOT_BELT)
return has_organ("chest")
if(SLOT_HUD_WEAR_ID)
if(ITEM_SLOT_ID)
// the only relevant check for this is the uniform check
return TRUE
if(SLOT_HUD_WEAR_PDA)
if(ITEM_SLOT_PDA)
return TRUE
if(SLOT_HUD_LEFT_EAR)
if(ITEM_SLOT_LEFT_EAR)
return has_organ("head")
if(SLOT_HUD_RIGHT_EAR)
if(ITEM_SLOT_RIGHT_EAR)
return has_organ("head")
if(SLOT_HUD_GLASSES)
if(ITEM_SLOT_EYES)
return has_organ("head")
if(SLOT_HUD_GLOVES)
if(ITEM_SLOT_GLOVES)
return has_organ("l_hand") && has_organ("r_hand")
if(SLOT_HUD_HEAD)
if(ITEM_SLOT_HEAD)
return has_organ("head")
if(SLOT_HUD_SHOES)
if(ITEM_SLOT_SHOES)
return has_organ("r_foot") && has_organ("l_foot")
if(SLOT_HUD_OUTER_SUIT)
if(ITEM_SLOT_OUTER_SUIT)
return has_organ("chest")
if(SLOT_HUD_JUMPSUIT)
if(ITEM_SLOT_JUMPSUIT)
return has_organ("chest")
if(SLOT_HUD_LEFT_STORE)
if(ITEM_SLOT_LEFT_POCKET)
return has_organ("chest")
if(SLOT_HUD_RIGHT_STORE)
if(ITEM_SLOT_RIGHT_POCKET)
return has_organ("chest")
if(SLOT_HUD_SUIT_STORE)
if(ITEM_SLOT_SUIT_STORE)
return has_organ("chest")
if(SLOT_HUD_IN_BACKPACK)
if(ITEM_SLOT_IN_BACKPACK)
return TRUE
if(SLOT_HUD_TIE)
if(ITEM_SLOT_ACCESSORY)
return TRUE
/mob/living/carbon/human/unEquip(obj/item/I, force, silent = FALSE)
@@ -187,7 +187,6 @@
src.r_hand = null
update_inv_r_hand()
I.screen_loc = null
if(client)
client.screen -= I
if(length(observers))
@@ -201,10 +200,10 @@
I.plane = ABOVE_HUD_PLANE
switch(slot)
if(SLOT_HUD_BACK)
if(ITEM_SLOT_BACK)
back = I
update_inv_back()
if(SLOT_HUD_WEAR_MASK)
if(ITEM_SLOT_MASK)
wear_mask = I
if((wear_mask.flags & BLOCKHAIR) || (wear_mask.flags & BLOCKHEADHAIR))
update_hair() //rebuild hair
@@ -215,48 +214,48 @@
wear_mask_update(I, toggle_off = TRUE)
update_misc_effects()
update_inv_wear_mask()
if(SLOT_HUD_HANDCUFFED)
if(ITEM_SLOT_HANDCUFFED)
handcuffed = I
update_inv_handcuffed()
if(SLOT_HUD_LEGCUFFED)
if(ITEM_SLOT_LEGCUFFED)
legcuffed = I
update_inv_legcuffed()
if(SLOT_HUD_LEFT_HAND)
if(ITEM_SLOT_LEFT_HAND)
l_hand = I
update_inv_l_hand()
if(SLOT_HUD_RIGHT_HAND)
if(ITEM_SLOT_RIGHT_HAND)
r_hand = I
update_inv_r_hand()
if(SLOT_HUD_BELT)
if(ITEM_SLOT_BELT)
belt = I
update_inv_belt()
if(SLOT_HUD_WEAR_ID)
if(ITEM_SLOT_ID)
wear_id = I
if(length(hud_list))
sec_hud_set_ID()
update_inv_wear_id()
if(SLOT_HUD_WEAR_PDA)
if(ITEM_SLOT_PDA)
wear_pda = I
update_inv_wear_pda()
if(SLOT_HUD_LEFT_EAR)
if(ITEM_SLOT_LEFT_EAR)
l_ear = I
if(l_ear.slot_flags & SLOT_FLAG_TWOEARS)
var/obj/item/clothing/ears/offear/O = new(I)
O.forceMove(src)
r_ear = O
O.layer = ABOVE_HUD_LAYER
O.plane = ABOVE_HUD_PLANE
// if(l_ear.slot_flags & ITEM_SLOT_LEFT_EAR) CHAP-TODO: ACTUALLY FIX OFFEARS OR REMOVE THEM COMPLETELY
// var/obj/item/clothing/ears/offear/O = new(I)
// O.forceMove(src)
// r_ear = O
// O.layer = ABOVE_HUD_LAYER
// O.plane = ABOVE_HUD_PLANE
update_inv_ears()
if(SLOT_HUD_RIGHT_EAR)
if(ITEM_SLOT_RIGHT_EAR)
r_ear = I
if(r_ear.slot_flags & SLOT_FLAG_TWOEARS)
var/obj/item/clothing/ears/offear/O = new(I)
O.forceMove(src)
l_ear = O
O.layer = ABOVE_HUD_LAYER
O.plane = ABOVE_HUD_PLANE
// if(r_ear.slot_flags & ITEM_SLOT_RIGHT_EAR)
// var/obj/item/clothing/ears/offear/O = new(I)
// O.forceMove(src)
// l_ear = O
// O.layer = ABOVE_HUD_LAYER
// O.plane = ABOVE_HUD_PLANE
update_inv_ears()
if(SLOT_HUD_GLASSES)
if(ITEM_SLOT_EYES)
glasses = I
var/obj/item/clothing/glasses/G = I
if(G.tint)
@@ -267,10 +266,10 @@
update_sight()
update_inv_glasses()
update_client_colour()
if(SLOT_HUD_GLOVES)
if(ITEM_SLOT_GLOVES)
gloves = I
update_inv_gloves()
if(SLOT_HUD_HEAD)
if(ITEM_SLOT_HEAD)
head = I
if((head.flags & BLOCKHAIR) || (head.flags & BLOCKHEADHAIR))
update_hair() //rebuild hair
@@ -284,27 +283,27 @@
// this calls update_inv_head() on its own
update_misc_effects()
head_update(I)
if(SLOT_HUD_SHOES)
if(ITEM_SLOT_SHOES)
shoes = I
update_inv_shoes()
if(SLOT_HUD_OUTER_SUIT)
if(ITEM_SLOT_OUTER_SUIT)
wear_suit = I
if(wear_suit.flags_inv & HIDESHOES)
update_inv_shoes()
update_inv_wear_suit()
if(SLOT_HUD_JUMPSUIT)
if(ITEM_SLOT_JUMPSUIT)
w_uniform = I
update_inv_w_uniform()
if(SLOT_HUD_LEFT_STORE)
if(ITEM_SLOT_LEFT_POCKET)
l_store = I
update_inv_pockets()
if(SLOT_HUD_RIGHT_STORE)
if(ITEM_SLOT_RIGHT_POCKET)
r_store = I
update_inv_pockets()
if(SLOT_HUD_SUIT_STORE)
if(ITEM_SLOT_SUIT_STORE)
s_store = I
update_inv_s_store()
if(SLOT_HUD_IN_BACKPACK)
if(ITEM_SLOT_IN_BACKPACK)
if(get_active_hand() == I)
unEquip(I)
if(ismodcontrol(back))
@@ -313,12 +312,14 @@
I.forceMove(C.bag)
else
I.forceMove(back)
if(SLOT_HUD_TIE)
if(ITEM_SLOT_ACCESSORY)
var/obj/item/clothing/under/uniform = src.w_uniform
uniform.attackby(I, src)
else
to_chat(src, "<span class='warning'>You are trying to equip this item to an unsupported inventory slot. Report this to a coder!</span>")
I.screen_loc = null
/mob/living/carbon/human/put_in_hands(obj/item/I)
if(!I)
return FALSE
@@ -337,48 +338,90 @@
// Return the item currently in the slot ID
/mob/living/carbon/human/get_item_by_slot(slot_id)
switch(slot_id)
if(SLOT_HUD_BACK)
if(ITEM_SLOT_BACK)
return back
if(SLOT_HUD_WEAR_MASK)
if(ITEM_SLOT_MASK)
return wear_mask
if(SLOT_HUD_HANDCUFFED)
if(ITEM_SLOT_HANDCUFFED)
return handcuffed
if(SLOT_HUD_LEGCUFFED)
if(ITEM_SLOT_LEGCUFFED)
return legcuffed
if(SLOT_HUD_LEFT_HAND)
if(ITEM_SLOT_LEFT_HAND)
return l_hand
if(SLOT_HUD_RIGHT_HAND)
if(ITEM_SLOT_RIGHT_HAND)
return r_hand
if(SLOT_HUD_BELT)
if(ITEM_SLOT_BELT)
return belt
if(SLOT_HUD_WEAR_ID)
if(ITEM_SLOT_ID)
return wear_id
if(SLOT_HUD_WEAR_PDA)
if(ITEM_SLOT_PDA)
return wear_pda
if(SLOT_HUD_LEFT_EAR)
if(ITEM_SLOT_LEFT_EAR)
return l_ear
if(SLOT_HUD_RIGHT_EAR)
if(ITEM_SLOT_RIGHT_EAR)
return r_ear
if(SLOT_HUD_GLASSES)
if(ITEM_SLOT_EYES)
return glasses
if(SLOT_HUD_GLOVES)
if(ITEM_SLOT_GLOVES)
return gloves
if(SLOT_HUD_HEAD)
if(ITEM_SLOT_HEAD)
return head
if(SLOT_HUD_SHOES)
if(ITEM_SLOT_SHOES)
return shoes
if(SLOT_HUD_OUTER_SUIT)
if(ITEM_SLOT_OUTER_SUIT)
return wear_suit
if(SLOT_HUD_JUMPSUIT)
if(ITEM_SLOT_JUMPSUIT)
return w_uniform
if(SLOT_HUD_LEFT_STORE)
if(ITEM_SLOT_LEFT_POCKET)
return l_store
if(SLOT_HUD_RIGHT_STORE)
if(ITEM_SLOT_RIGHT_POCKET)
return r_store
if(SLOT_HUD_SUIT_STORE)
if(ITEM_SLOT_SUIT_STORE)
return s_store
return null
/mob/living/carbon/human/get_slot_by_item(obj/item/looking_for)
if(looking_for == belt)
return ITEM_SLOT_BELT
if(looking_for == wear_id)
return ITEM_SLOT_ID
if(looking_for == l_ear)
return ITEM_SLOT_LEFT_EAR
if(looking_for == r_ear)
return ITEM_SLOT_RIGHT_EAR
if(looking_for == glasses)
return ITEM_SLOT_EYES
if(looking_for == gloves)
return ITEM_SLOT_GLOVES
if(looking_for == head)
return ITEM_SLOT_HEAD
if(looking_for == shoes)
return ITEM_SLOT_SHOES
if(looking_for == wear_suit)
return ITEM_SLOT_OUTER_SUIT
if(looking_for == w_uniform)
return ITEM_SLOT_JUMPSUIT
if(looking_for == r_store)
return ITEM_SLOT_BOTH_POCKETS
if(looking_for == l_store)
return ITEM_SLOT_BOTH_POCKETS
// if(looking_for == s_store)
// return ITEM_SLOT_SUIT_STORE
return ..()
/mob/living/carbon/human/get_all_slots()
. = get_body_slots() | get_head_slots()
@@ -844,30 +844,34 @@
fail_msg = "There is no exposed flesh or thin material [target_zone == "head" ? "on [p_their()] head" : "on [p_their()] body"] to inject into."
to_chat(user, "<span class='alert'>[fail_msg]</span>")
///
/**
* Gets the obscured ITEM_SLOTs on a human
*
* Returns:
* * A bitfield containing the ITEM_SLOTS bitflags that are obscured.
*/
/mob/living/carbon/human/proc/check_obscured_slots()
var/list/obscured = list()
var/obscured = NONE
if(wear_suit)
if(wear_suit.flags_inv & HIDEGLOVES)
obscured |= SLOT_HUD_GLOVES
obscured |= ITEM_SLOT_GLOVES
if(wear_suit.flags_inv & HIDEJUMPSUIT)
obscured |= SLOT_HUD_JUMPSUIT
obscured |= ITEM_SLOT_JUMPSUIT
if(wear_suit.flags_inv & HIDESHOES)
obscured |= SLOT_HUD_SHOES
obscured |= ITEM_SLOT_SHOES
if(head)
if(head.flags_inv & HIDEMASK)
obscured |= SLOT_HUD_WEAR_MASK
obscured |= ITEM_SLOT_MASK
if(head.flags_inv & HIDEEYES)
obscured |= SLOT_HUD_GLASSES
obscured |= ITEM_SLOT_EYES
if(head.flags_inv & HIDEEARS)
obscured |= SLOT_HUD_RIGHT_EAR
obscured |= SLOT_HUD_LEFT_EAR
obscured |= ITEM_SLOT_BOTH_EARS
if(length(obscured) > 0)
if(obscured)
return obscured
else
return null
/mob/living/carbon/human/proc/check_has_mouth()
// Todo, check stomach organ when implemented.
@@ -877,9 +881,8 @@
return TRUE
/mob/living/carbon/human/proc/get_visible_gender()
var/list/obscured = check_obscured_slots()
var/skipface = (wear_mask && (wear_mask.flags_inv & HIDEFACE)) || (head && (head.flags_inv & HIDEFACE))
if((SLOT_HUD_JUMPSUIT in obscured) && skipface)
if(skipface && (check_obscured_slots() & ITEM_SLOT_JUMPSUIT))
return PLURAL
return gender
@@ -1107,7 +1110,7 @@
if(!(dna.species.bodyflags & HAS_SKIN_TONE))
s_tone = 0
var/list/thing_to_check = list(SLOT_HUD_WEAR_MASK, SLOT_HUD_HEAD, SLOT_HUD_SHOES, SLOT_HUD_GLOVES, SLOT_HUD_LEFT_EAR, SLOT_HUD_RIGHT_EAR, SLOT_HUD_GLASSES, SLOT_HUD_LEFT_HAND, SLOT_HUD_RIGHT_HAND)
var/list/thing_to_check = list(ITEM_SLOT_MASK, ITEM_SLOT_HEAD, ITEM_SLOT_SHOES, ITEM_SLOT_GLOVES, ITEM_SLOT_LEFT_EAR, ITEM_SLOT_RIGHT_EAR, ITEM_SLOT_EYES, ITEM_SLOT_LEFT_HAND, ITEM_SLOT_RIGHT_HAND)
var/list/kept_items[0]
var/list/item_flags[0]
for(var/thing in thing_to_check)
@@ -1777,8 +1780,8 @@ Eyes need to have significantly high darksight to shine unless the mob has the X
organs_list[O.name] = O.serialize()
// Equipment
equip_list.len = SLOT_HUD_AMOUNT
for(var/i = 1, i < SLOT_HUD_AMOUNT, i++)
equip_list.len = ITEM_SLOT_AMOUNT
for(var/i = 1, i < ITEM_SLOT_AMOUNT, i++)
var/obj/item/thing = get_item_by_slot(i)
if(thing != null)
equip_list[i] = thing.serialize()
@@ -1837,16 +1840,16 @@ Eyes need to have significantly high darksight to shine unless the mob has the X
// #1: Jumpsuit
// #2: Outer suit
// #3+: Everything else
if(islist(equip_list[SLOT_HUD_JUMPSUIT]))
var/obj/item/clothing/C = list_to_object(equip_list[SLOT_HUD_JUMPSUIT], T)
equip_to_slot_if_possible(C, SLOT_HUD_JUMPSUIT)
if(islist(equip_list[ITEM_SLOT_JUMPSUIT]))
var/obj/item/clothing/C = list_to_object(equip_list[ITEM_SLOT_JUMPSUIT], T)
equip_to_slot_if_possible(C, ITEM_SLOT_JUMPSUIT)
if(islist(equip_list[SLOT_HUD_OUTER_SUIT]))
var/obj/item/clothing/C = list_to_object(equip_list[SLOT_HUD_OUTER_SUIT], T)
equip_to_slot_if_possible(C, SLOT_HUD_OUTER_SUIT)
if(islist(equip_list[ITEM_SLOT_OUTER_SUIT]))
var/obj/item/clothing/C = list_to_object(equip_list[ITEM_SLOT_OUTER_SUIT], T)
equip_to_slot_if_possible(C, ITEM_SLOT_OUTER_SUIT)
for(var/i = 1, i < SLOT_HUD_AMOUNT, i++)
if(i == SLOT_HUD_JUMPSUIT || i == SLOT_HUD_OUTER_SUIT)
for(var/i = 1, i < ITEM_SLOT_AMOUNT, i++)
if(i == ITEM_SLOT_JUMPSUIT || i == ITEM_SLOT_OUTER_SUIT)
continue
if(islist(equip_list[i]))
var/obj/item/clothing/C = list_to_object(equip_list[i], T)
@@ -26,11 +26,11 @@ GLOBAL_LIST_INIT(strippable_human_items, create_strippable_list(list(
/datum/strippable_item/mob_item_slot/eyes
key = STRIPPABLE_ITEM_EYES
item_slot = SLOT_HUD_GLASSES
item_slot = ITEM_SLOT_EYES
/datum/strippable_item/mob_item_slot/jumpsuit
key = STRIPPABLE_ITEM_JUMPSUIT
item_slot = SLOT_HUD_JUMPSUIT
item_slot = ITEM_SLOT_JUMPSUIT
/datum/strippable_item/mob_item_slot/jumpsuit/get_alternate_actions(atom/source, mob/user)
var/list/multiple_options = list()
@@ -74,27 +74,27 @@ GLOBAL_LIST_INIT(strippable_human_items, create_strippable_list(list(
/datum/strippable_item/mob_item_slot/left_ear
key = STRIPPABLE_ITEM_L_EAR
item_slot = SLOT_HUD_LEFT_EAR
item_slot = ITEM_SLOT_LEFT_EAR
/datum/strippable_item/mob_item_slot/right_ear
key = STRIPPABLE_ITEM_R_EAR
item_slot = SLOT_HUD_RIGHT_EAR
item_slot = ITEM_SLOT_RIGHT_EAR
/datum/strippable_item/mob_item_slot/suit
key = STRIPPABLE_ITEM_SUIT
item_slot = SLOT_HUD_OUTER_SUIT
item_slot = ITEM_SLOT_OUTER_SUIT
/datum/strippable_item/mob_item_slot/gloves
key = STRIPPABLE_ITEM_GLOVES
item_slot = SLOT_HUD_GLOVES
item_slot = ITEM_SLOT_GLOVES
/datum/strippable_item/mob_item_slot/feet
key = STRIPPABLE_ITEM_FEET
item_slot = SLOT_HUD_SHOES
item_slot = ITEM_SLOT_SHOES
/datum/strippable_item/mob_item_slot/suit_storage
key = STRIPPABLE_ITEM_SUIT_STORAGE
item_slot = SLOT_HUD_SUIT_STORE
item_slot = ITEM_SLOT_SUIT_STORE
/datum/strippable_item/mob_item_slot/suit_storage/get_alternate_actions(atom/source, mob/user)
return get_strippable_alternate_action_internals(get_item(source), source)
@@ -106,11 +106,11 @@ GLOBAL_LIST_INIT(strippable_human_items, create_strippable_list(list(
/datum/strippable_item/mob_item_slot/id
key = STRIPPABLE_ITEM_ID
item_slot = SLOT_HUD_WEAR_ID
item_slot = ITEM_SLOT_ID
/datum/strippable_item/mob_item_slot/pda
key = STRIPPABLE_ITEM_PDA
item_slot = SLOT_HUD_WEAR_PDA
item_slot = ITEM_SLOT_PDA
/datum/strippable_item/mob_item_slot/pda/get_obscuring(atom/source)
return isnull(get_item(source)) \
@@ -119,7 +119,7 @@ GLOBAL_LIST_INIT(strippable_human_items, create_strippable_list(list(
/datum/strippable_item/mob_item_slot/belt
key = STRIPPABLE_ITEM_BELT
item_slot = SLOT_HUD_BELT
item_slot = ITEM_SLOT_BELT
/datum/strippable_item/mob_item_slot/belt/get_alternate_actions(atom/source, mob/user)
return get_strippable_alternate_action_internals(get_item(source), source)
@@ -168,12 +168,12 @@ GLOBAL_LIST_INIT(strippable_human_items, create_strippable_list(list(
/datum/strippable_item/mob_item_slot/pocket/left
key = STRIPPABLE_ITEM_LPOCKET
item_slot = SLOT_HUD_LEFT_STORE
item_slot = ITEM_SLOT_LEFT_POCKET
pocket_side = "left"
/datum/strippable_item/mob_item_slot/pocket/right
key = STRIPPABLE_ITEM_RPOCKET
item_slot = SLOT_HUD_RIGHT_STORE
item_slot = ITEM_SLOT_RIGHT_POCKET
pocket_side = "right"
/proc/get_strippable_alternate_action_internals(obj/item/item, atom/source)
@@ -574,7 +574,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
/mob/living/carbon/human/update_inv_w_uniform()
remove_overlay(UNIFORM_LAYER)
if(client && hud_used)
var/atom/movable/screen/inventory/inv = hud_used.inv_slots[SLOT_HUD_JUMPSUIT]
var/atom/movable/screen/inventory/inv = hud_used.inv_slots[ITEM_SLOT_2_INDEX(ITEM_SLOT_JUMPSUIT)]
if(inv)
inv.update_icon()
@@ -648,7 +648,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
/mob/living/carbon/human/update_inv_wear_id()
remove_overlay(ID_LAYER)
if(client && hud_used)
var/atom/movable/screen/inventory/inv = hud_used.inv_slots[SLOT_HUD_WEAR_ID]
var/atom/movable/screen/inventory/inv = hud_used.inv_slots[ITEM_SLOT_2_INDEX(ITEM_SLOT_ID)]
if(inv)
inv.update_icon()
@@ -664,7 +664,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
remove_overlay(L_HAND_BLOOD_LAYER)
remove_overlay(R_HAND_BLOOD_LAYER)
if(client && hud_used)
var/atom/movable/screen/inventory/inv = hud_used.inv_slots[SLOT_HUD_GLOVES]
var/atom/movable/screen/inventory/inv = hud_used.inv_slots[ITEM_SLOT_2_INDEX(ITEM_SLOT_GLOVES)]
if(inv)
inv.update_icon()
@@ -708,7 +708,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
remove_overlay(OVER_MASK_LAYER)
if(client && hud_used)
var/atom/movable/screen/inventory/inv = hud_used.inv_slots[SLOT_HUD_GLASSES]
var/atom/movable/screen/inventory/inv = hud_used.inv_slots[ITEM_SLOT_2_INDEX(ITEM_SLOT_EYES)]
if(inv)
inv.update_icon()
@@ -745,8 +745,8 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
remove_overlay(RIGHT_EAR_LAYER)
if(client && hud_used)
var/atom/movable/screen/inventory/left_ear_inv = hud_used.inv_slots[SLOT_HUD_LEFT_EAR]
var/atom/movable/screen/inventory/right_ear_inv = hud_used.inv_slots[SLOT_HUD_RIGHT_EAR]
var/atom/movable/screen/inventory/left_ear_inv = hud_used.inv_slots[ITEM_SLOT_2_INDEX(ITEM_SLOT_LEFT_EAR)]
var/atom/movable/screen/inventory/right_ear_inv = hud_used.inv_slots[ITEM_SLOT_2_INDEX(ITEM_SLOT_RIGHT_EAR)]
if(left_ear_inv)
left_ear_inv.update_icon()
if(right_ear_inv)
@@ -786,7 +786,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
remove_overlay(L_FOOT_BLOOD_LAYER)
remove_overlay(R_FOOT_BLOOD_LAYER)
if(client && hud_used)
var/atom/movable/screen/inventory/inv = hud_used.inv_slots[SLOT_HUD_SHOES]
var/atom/movable/screen/inventory/inv = hud_used.inv_slots[ITEM_SLOT_2_INDEX(ITEM_SLOT_SHOES)]
if(inv)
inv.update_icon()
@@ -826,7 +826,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
/mob/living/carbon/human/update_inv_s_store()
remove_overlay(SUIT_STORE_LAYER)
if(client && hud_used)
var/atom/movable/screen/inventory/inv = hud_used.inv_slots[SLOT_HUD_SUIT_STORE]
var/atom/movable/screen/inventory/inv = hud_used.inv_slots[ITEM_SLOT_2_INDEX(ITEM_SLOT_SUIT_STORE)]
if(inv)
inv.update_icon()
@@ -846,7 +846,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
..()
remove_overlay(HEAD_LAYER)
if(client && hud_used)
var/atom/movable/screen/inventory/inv = hud_used.inv_slots[SLOT_HUD_HEAD]
var/atom/movable/screen/inventory/inv = hud_used.inv_slots[ITEM_SLOT_2_INDEX(ITEM_SLOT_HEAD)]
if(inv)
inv.update_icon()
@@ -900,7 +900,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
- /obj/item/claymore/..
*/
if(client && hud_used)
var/atom/movable/screen/inventory/inv = hud_used.inv_slots[SLOT_HUD_BELT]
var/atom/movable/screen/inventory/inv = hud_used.inv_slots[ITEM_SLOT_2_INDEX(ITEM_SLOT_BELT)]
if(inv)
inv.update_icon()
@@ -939,7 +939,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
/mob/living/carbon/human/update_inv_wear_suit()
remove_overlay(SUIT_LAYER)
if(client && hud_used)
var/atom/movable/screen/inventory/inv = hud_used.inv_slots[SLOT_HUD_OUTER_SUIT]
var/atom/movable/screen/inventory/inv = hud_used.inv_slots[ITEM_SLOT_2_INDEX(ITEM_SLOT_OUTER_SUIT)]
if(inv)
inv.update_icon()
@@ -982,11 +982,11 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
if(client && hud_used)
var/atom/movable/screen/inventory/inv
inv = hud_used.inv_slots[SLOT_HUD_LEFT_STORE]
inv = hud_used.inv_slots[ITEM_SLOT_2_INDEX(ITEM_SLOT_LEFT_POCKET)]
if(inv)
inv.update_icon()
inv = hud_used.inv_slots[SLOT_HUD_RIGHT_STORE]
inv = hud_used.inv_slots[ITEM_SLOT_2_INDEX(ITEM_SLOT_RIGHT_POCKET)]
if(inv)
inv.update_icon()
@@ -1006,7 +1006,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
/mob/living/carbon/human/update_inv_wear_pda()
if(client && hud_used)
var/atom/movable/screen/inventory/inv = hud_used.inv_slots[SLOT_HUD_WEAR_PDA]
var/atom/movable/screen/inventory/inv = hud_used.inv_slots[ITEM_SLOT_2_INDEX(ITEM_SLOT_PDA)]
if(inv)
inv.update_icon()
@@ -1017,12 +1017,12 @@ GLOBAL_LIST_EMPTY(damage_icon_parts)
..()
remove_overlay(FACEMASK_LAYER)
if(client && hud_used)
var/atom/movable/screen/inventory/inv = hud_used.inv_slots[SLOT_HUD_WEAR_MASK]
var/atom/movable/screen/inventory/inv = hud_used.inv_slots[ITEM_SLOT_2_INDEX(ITEM_SLOT_MASK)]
if(inv)
inv.update_icon()
if(wear_mask && (istype(wear_mask, /obj/item/clothing/mask) || istype(wear_mask, /obj/item/clothing/accessory)))
update_hud_wear_mask(wear_mask)
if(!(SLOT_HUD_WEAR_MASK in check_obscured_slots()))
if(!(check_obscured_slots() & ITEM_SLOT_MASK))
var/obj/item/organ/external/head/head_organ = get_organ("head")
if(!istype(head_organ))
return // Nothing to update here
+2 -2
View File
@@ -13,7 +13,7 @@
. = ..()
name = "Pun Pun"
real_name = name
equip_to_slot(new /obj/item/clothing/under/punpun(src), SLOT_HUD_JUMPSUIT)
equip_to_slot(new /obj/item/clothing/under/punpun(src), ITEM_SLOT_JUMPSUIT)
/mob/living/carbon/human/monkey/teeny/Initialize(mapload)
. = ..()
@@ -40,7 +40,7 @@
update_transform()
real_name = name
equip_to_slot_or_del(new headwear(src), SLOT_HUD_HEAD)
equip_to_slot_or_del(new headwear(src), ITEM_SLOT_HEAD)
RegisterSignal(src, list(COMSIG_HUMAN_ATTACKED, COMSIG_HOSTILE_ATTACKINGTARGET), PROC_REF(ouch))
for(var/trait in list(TRAIT_RESISTHEAT, TRAIT_NOBREATH, TRAIT_RESISTCOLD, TRAIT_RESISTHIGHPRESSURE, TRAIT_RESISTLOWPRESSURE))
@@ -91,7 +91,7 @@
var/exotic_blood
var/own_species_blood = FALSE // Can it only use blood from it's species?
var/skinned_type
var/list/no_equip = list() // slots the race can't equip stuff to
var/no_equip // bitflags of slots the race can't equip stuff to
var/nojumpsuit = 0 // this is sorta... weird. it basically lets you equip stuff that usually needs jumpsuits without one, like belts and pockets and ids
var/can_craft = TRUE // Can this mob using crafting or not?
@@ -358,7 +358,11 @@
#undef SLOWDOWN_MULTIPLIER
/datum/species/proc/on_species_gain(mob/living/carbon/human/H) //Handles anything not already covered by basic species assignment.
for(var/slot_id in no_equip)
for(var/slot_id in GLOB.bitflags) // Iterate through all bitflags
if(slot_id > ITEM_SLOT_AMOUNT_FLAG) // If the slot_id bitflag is larger than the largest ITEM_SLOT flag we're done
break
if(!(slot_id & no_equip)) // If the slot_id bitflag isn't in the no_equip flag, check the next bitflag
continue
var/obj/item/thing = H.get_item_by_slot(slot_id)
if(thing && (!thing.species_exception || !is_type_in_list(src, thing.species_exception)))
H.unEquip(thing)
@@ -747,7 +751,7 @@
return copy
/datum/species/proc/can_equip(obj/item/I, slot, disable_warning = FALSE, mob/living/carbon/human/H)
if(slot in no_equip)
if(slot & no_equip)
if(!I.species_exception || !is_type_in_list(src, I.species_exception))
return FALSE
@@ -755,21 +759,21 @@
return FALSE
switch(slot)
if(SLOT_HUD_LEFT_HAND)
if(ITEM_SLOT_LEFT_HAND)
return !H.l_hand && !H.incapacitated()
if(SLOT_HUD_RIGHT_HAND)
if(ITEM_SLOT_RIGHT_HAND)
return !H.r_hand && !H.incapacitated()
if(SLOT_HUD_WEAR_MASK)
return !H.wear_mask && (I.slot_flags & SLOT_FLAG_MASK)
if(SLOT_HUD_BACK)
return !H.back && (I.slot_flags & SLOT_FLAG_BACK)
if(SLOT_HUD_OUTER_SUIT)
return !H.wear_suit && (I.slot_flags & SLOT_FLAG_OCLOTHING)
if(SLOT_HUD_GLOVES)
return !H.gloves && (I.slot_flags & SLOT_FLAG_GLOVES)
if(SLOT_HUD_SHOES)
return !H.shoes && (I.slot_flags & SLOT_FLAG_FEET)
if(SLOT_HUD_BELT)
if(ITEM_SLOT_MASK)
return !H.wear_mask && (I.slot_flags & ITEM_SLOT_MASK)
if(ITEM_SLOT_BACK)
return !H.back && (I.slot_flags & ITEM_SLOT_BACK)
if(ITEM_SLOT_OUTER_SUIT)
return !H.wear_suit && (I.slot_flags & ITEM_SLOT_OUTER_SUIT)
if(ITEM_SLOT_GLOVES)
return !H.gloves && (I.slot_flags & ITEM_SLOT_GLOVES)
if(ITEM_SLOT_SHOES)
return !H.shoes && (I.slot_flags & ITEM_SLOT_SHOES)
if(ITEM_SLOT_BELT)
if(H.belt)
return FALSE
var/obj/item/organ/external/O = H.get_organ(BODY_ZONE_CHEST)
@@ -778,20 +782,20 @@
if(!disable_warning)
to_chat(H, "<span class='alert'>You need a jumpsuit before you can attach this [I.name].</span>")
return FALSE
if(!(I.slot_flags & SLOT_FLAG_BELT))
if(!(I.slot_flags & ITEM_SLOT_BELT))
return
return TRUE
if(SLOT_HUD_GLASSES)
return !H.glasses && (I.slot_flags & SLOT_FLAG_EYES)
if(SLOT_HUD_HEAD)
return !H.head && (I.slot_flags & SLOT_FLAG_HEAD)
if(SLOT_HUD_LEFT_EAR)
return !H.l_ear && (I.slot_flags & SLOT_FLAG_EARS) && !((I.slot_flags & SLOT_FLAG_TWOEARS) && H.r_ear)
if(SLOT_HUD_RIGHT_EAR)
return !H.r_ear && (I.slot_flags & SLOT_FLAG_EARS) && !((I.slot_flags & SLOT_FLAG_TWOEARS) && H.l_ear)
if(SLOT_HUD_JUMPSUIT)
return !H.w_uniform && (I.slot_flags & SLOT_FLAG_ICLOTHING)
if(SLOT_HUD_WEAR_ID)
if(ITEM_SLOT_EYES)
return !H.glasses && (I.slot_flags & ITEM_SLOT_EYES)
if(ITEM_SLOT_HEAD)
return !H.head && (I.slot_flags & ITEM_SLOT_HEAD)
if(ITEM_SLOT_LEFT_EAR)
return !H.l_ear && (I.slot_flags & ITEM_SLOT_LEFT_EAR)
if(ITEM_SLOT_RIGHT_EAR)
return !H.r_ear && (I.slot_flags & ITEM_SLOT_RIGHT_EAR)
if(ITEM_SLOT_JUMPSUIT)
return !H.w_uniform && (I.slot_flags & ITEM_SLOT_JUMPSUIT)
if(ITEM_SLOT_ID)
if(H.wear_id)
return FALSE
var/obj/item/organ/external/O = H.get_organ(BODY_ZONE_CHEST)
@@ -800,10 +804,10 @@
if(!disable_warning)
to_chat(H, "<span class='alert'>You need a jumpsuit before you can attach this [I.name].</span>")
return FALSE
if(!(I.slot_flags & SLOT_FLAG_ID))
if(!(I.slot_flags & ITEM_SLOT_ID))
return FALSE
return TRUE
if(SLOT_HUD_WEAR_PDA)
if(ITEM_SLOT_PDA)
if(H.wear_pda)
return FALSE
var/obj/item/organ/external/O = H.get_organ(BODY_ZONE_CHEST)
@@ -812,10 +816,10 @@
if(!disable_warning)
to_chat(H, "<span class='alert'>You need a jumpsuit before you can attach this [I.name].</span>")
return FALSE
if(!(I.slot_flags & SLOT_FLAG_PDA))
if(!(I.slot_flags & ITEM_SLOT_PDA))
return FALSE
return TRUE
if(SLOT_HUD_LEFT_STORE)
if(ITEM_SLOT_LEFT_POCKET)
if(I.flags & NODROP) //Pockets aren't visible, so you can't move NODROP items into them.
return FALSE
if(H.l_store)
@@ -826,9 +830,9 @@
if(!disable_warning)
to_chat(H, "<span class='alert'>You need a jumpsuit before you can attach this [I.name].</span>")
return FALSE
if(I.w_class <= WEIGHT_CLASS_SMALL || (I.slot_flags & SLOT_FLAG_POCKET))
if(I.w_class <= WEIGHT_CLASS_SMALL || (I.slot_flags & ITEM_SLOT_BOTH_POCKETS))
return TRUE
if(SLOT_HUD_RIGHT_STORE)
if(ITEM_SLOT_RIGHT_POCKET)
if(I.flags & NODROP)
return FALSE
if(H.r_store)
@@ -839,10 +843,10 @@
if(!disable_warning)
to_chat(H, "<span class='alert'>You need a jumpsuit before you can attach this [I.name].</span>")
return FALSE
if(I.w_class <= WEIGHT_CLASS_SMALL || (I.slot_flags & SLOT_FLAG_POCKET))
if(I.w_class <= WEIGHT_CLASS_SMALL || (I.slot_flags & ITEM_SLOT_BOTH_POCKETS))
return TRUE
return FALSE
if(SLOT_HUD_SUIT_STORE)
if(ITEM_SLOT_SUIT_STORE)
if(I.flags & NODROP) //Suit storage NODROP items drop if you take a suit off, this is to prevent people exploiting this.
return FALSE
if(H.s_store)
@@ -862,11 +866,11 @@
if(istype(I, /obj/item/pda) || is_pen(I) || is_type_in_list(I, H.wear_suit.allowed))
return TRUE
return FALSE
if(SLOT_HUD_HANDCUFFED)
if(ITEM_SLOT_HANDCUFFED)
return !H.handcuffed && istype(I, /obj/item/restraints/handcuffs)
if(SLOT_HUD_LEGCUFFED)
if(ITEM_SLOT_LEGCUFFED)
return !H.legcuffed && istype(I, /obj/item/restraints/legcuffs)
if(SLOT_HUD_IN_BACKPACK)
if(ITEM_SLOT_IN_BACKPACK)
if(H.back && istype(H.back, /obj/item/storage/backpack))
var/obj/item/storage/backpack/B = H.back
if(length(B.contents) < B.storage_slots && I.w_class <= B.max_w_class)
@@ -878,7 +882,7 @@
if(length(B.contents) < B.storage_slots && I.w_class <= B.max_w_class)
return TRUE
return FALSE
if(SLOT_HUD_TIE)
if(ITEM_SLOT_ACCESSORY)
if(!istype(I, /obj/item/clothing/accessory))
return FALSE
var/obj/item/clothing/under/uniform = H.w_uniform
@@ -890,7 +894,7 @@
if(!disable_warning)
to_chat(H, "<span class='warning'>You already have an accessory of this type attached to your [uniform].</span>")
return FALSE
if(!(I.slot_flags & SLOT_FLAG_TIE))
if(!(I.slot_flags & ITEM_SLOT_ACCESSORY))
return FALSE
return TRUE
@@ -15,7 +15,7 @@
punchdamagelow = 5
punchdamagehigh = 14
punchstunthreshold = 11 //about 40% chance to stun
no_equip = list(SLOT_HUD_WEAR_MASK, SLOT_HUD_OUTER_SUIT, SLOT_HUD_GLOVES, SLOT_HUD_SHOES, SLOT_HUD_JUMPSUIT, SLOT_HUD_SUIT_STORE)
no_equip = ITEM_SLOT_MASK | ITEM_SLOT_OUTER_SUIT | ITEM_SLOT_GLOVES | ITEM_SLOT_SHOES | ITEM_SLOT_JUMPSUIT | ITEM_SLOT_SUIT_STORE
nojumpsuit = TRUE
dietflags = DIET_OMNI //golems can eat anything because they are magic or something
@@ -572,8 +572,8 @@
..()
last_banana = world.time
last_honk = world.time
H.equip_to_slot_or_del(new /obj/item/reagent_containers/drinks/bottle/bottleofbanana(H), SLOT_HUD_RIGHT_STORE)
H.equip_to_slot_or_del(new /obj/item/bikehorn(H), SLOT_HUD_LEFT_STORE)
H.equip_to_slot_or_del(new /obj/item/reagent_containers/drinks/bottle/bottleofbanana(H), ITEM_SLOT_RIGHT_POCKET)
H.equip_to_slot_or_del(new /obj/item/bikehorn(H), ITEM_SLOT_LEFT_POCKET)
H.AddElement(/datum/element/waddling)
/datum/species/golem/bananium/on_species_loss(mob/living/carbon/C)
@@ -650,9 +650,9 @@
/datum/species/golem/tranquillite/on_species_gain(mob/living/carbon/human/H)
..()
H.equip_to_slot_or_del(new /obj/item/clothing/head/beret(H), SLOT_HUD_HEAD)
H.equip_to_slot_or_del(new /obj/item/reagent_containers/drinks/bottle/bottleofnothing(H), SLOT_HUD_RIGHT_STORE)
H.equip_to_slot_or_del(new /obj/item/cane(H), SLOT_HUD_LEFT_HAND)
H.equip_to_slot_or_del(new /obj/item/clothing/head/beret(H), ITEM_SLOT_HEAD)
H.equip_to_slot_or_del(new /obj/item/reagent_containers/drinks/bottle/bottleofnothing(H), ITEM_SLOT_RIGHT_POCKET)
H.equip_to_slot_or_del(new /obj/item/cane(H), ITEM_SLOT_LEFT_HAND)
if(H.mind)
H.mind.AddSpell(new /datum/spell/aoe/conjure/build/mime_wall(null))
H.mind.AddSpell(new /datum/spell/mime/speak(null))
@@ -13,7 +13,7 @@
species_traits = list(NOT_SELECTABLE)
skinned_type = /obj/item/stack/sheet/animalhide/monkey
greater_form = /datum/species/human
no_equip = list(SLOT_HUD_BELT, SLOT_HUD_WEAR_ID, SLOT_HUD_LEFT_EAR, SLOT_HUD_RIGHT_EAR, SLOT_HUD_GLASSES, SLOT_HUD_GLOVES, SLOT_HUD_SHOES, SLOT_HUD_OUTER_SUIT, SLOT_HUD_JUMPSUIT, SLOT_HUD_LEFT_STORE, SLOT_HUD_RIGHT_STORE, SLOT_HUD_SUIT_STORE, SLOT_HUD_WEAR_PDA)
no_equip = ITEM_SLOT_BELT | ITEM_SLOT_ID | ITEM_SLOT_LEFT_EAR | ITEM_SLOT_RIGHT_EAR | ITEM_SLOT_EYES | ITEM_SLOT_GLOVES | ITEM_SLOT_SHOES | ITEM_SLOT_OUTER_SUIT | ITEM_SLOT_JUMPSUIT | ITEM_SLOT_LEFT_POCKET | ITEM_SLOT_RIGHT_POCKET | ITEM_SLOT_SUIT_STORE | ITEM_SLOT_PDA
inherent_factions = list("jungle", "monkey")
can_craft = FALSE
is_small = 1
@@ -189,7 +189,7 @@
if(!H.mind || !H.mind.assigned_role || H.mind.assigned_role != "Clown" && H.mind.assigned_role != "Mime")
H.unEquip(H.wear_mask)
H.equip_or_collect(new /obj/item/clothing/mask/breath(H), SLOT_HUD_WEAR_MASK)
H.equip_or_collect(new /obj/item/clothing/mask/breath(H), ITEM_SLOT_MASK)
var/tank_pref = H.client && H.client.prefs ? H.client.prefs.active_character.speciesprefs : null
var/obj/item/tank/internal_tank
if(tank_pref) //Diseasel, here you go
@@ -198,7 +198,7 @@
internal_tank = new /obj/item/tank/internals/plasmaman/belt/full(H)
if(!H.equip_to_appropriate_slot(internal_tank) && !H.put_in_any_hand_if_possible(internal_tank))
H.unEquip(H.l_hand)
H.equip_or_collect(internal_tank, SLOT_HUD_LEFT_HAND)
H.equip_or_collect(internal_tank, ITEM_SLOT_LEFT_HAND)
to_chat(H, "<span class='boldannounceooc'>Could not find an empty slot for internals! Please report this as a bug.</span>")
stack_trace("Failed to equip plasmaman with a tank, with the job [J.type]")
H.internal = internal_tank
@@ -79,7 +79,7 @@
if(!H.mind || !H.mind.assigned_role || H.mind.assigned_role != "Clown" && H.mind.assigned_role != "Mime")
H.unEquip(H.wear_mask)
H.equip_or_collect(new /obj/item/clothing/mask/breath/vox/respirator(H), SLOT_HUD_WEAR_MASK)
H.equip_or_collect(new /obj/item/clothing/mask/breath/vox/respirator(H), ITEM_SLOT_MASK)
var/tank_pref = H.client && H.client.prefs ? H.client.prefs.active_character.speciesprefs : null
var/obj/item/tank/internal_tank
if(tank_pref)//Diseasel, here you go
@@ -89,7 +89,7 @@
if(!H.equip_to_appropriate_slot(internal_tank))
if(!H.put_in_any_hand_if_possible(internal_tank))
H.unEquip(H.l_hand)
H.equip_or_collect(internal_tank, SLOT_HUD_LEFT_HAND)
H.equip_or_collect(internal_tank, ITEM_SLOT_LEFT_HAND)
to_chat(H, "<span class='boldannounceooc'>Could not find an empty slot for internals! Please report this as a bug</span>")
H.internal = internal_tank
to_chat(H, "<span class='notice'>You are now running on nitrogen internals from [internal_tank]. Your species finds oxygen toxic, so you must breathe nitrogen only.</span>")
+28 -28
View File
@@ -16,7 +16,7 @@
H.rename_character(H.real_name, name)
for(var/obj/item/W in H.get_all_slots())
H.unEquip(W)
H.equip_to_slot_or_del(new /obj/item/radio/headset(H), SLOT_HUD_LEFT_EAR)
H.equip_to_slot_or_del(new /obj/item/radio/headset(H), ITEM_SLOT_LEFT_EAR)
/datum/superheroes/proc/fixflags(mob/living/carbon/human/H)
for(var/obj/item/W in H.get_all_slots())
@@ -52,7 +52,7 @@
W.SetOwnerInfo(H)
W.UpdateName()
W.flags |= NODROP
H.equip_to_slot_or_del(W, SLOT_HUD_WEAR_ID)
H.equip_to_slot_or_del(W, ITEM_SLOT_ID)
H.regenerate_icons()
to_chat(H, desc)
@@ -67,12 +67,12 @@
/datum/superheroes/owlman/equip(mob/living/carbon/human/H)
..()
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/black/greytide(H), SLOT_HUD_SHOES)
H.equip_to_slot_or_del(new /obj/item/clothing/under/costume/owl(H), SLOT_HUD_JUMPSUIT)
H.equip_to_slot_or_del(new /obj/item/clothing/suit/toggle/owlwings(H), SLOT_HUD_OUTER_SUIT)
H.equip_to_slot_or_del(new /obj/item/clothing/mask/gas/owl_mask/super_hero(H), SLOT_HUD_WEAR_MASK)
H.equip_to_slot_or_del(new /obj/item/storage/belt/bluespace/owlman(H), SLOT_HUD_BELT)
H.equip_to_slot_or_del(new /obj/item/clothing/glasses/night(H), SLOT_HUD_GLASSES)
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/black/greytide(H), ITEM_SLOT_SHOES)
H.equip_to_slot_or_del(new /obj/item/clothing/under/costume/owl(H), ITEM_SLOT_JUMPSUIT)
H.equip_to_slot_or_del(new /obj/item/clothing/suit/toggle/owlwings(H), ITEM_SLOT_OUTER_SUIT)
H.equip_to_slot_or_del(new /obj/item/clothing/mask/gas/owl_mask/super_hero(H), ITEM_SLOT_MASK)
H.equip_to_slot_or_del(new /obj/item/storage/belt/bluespace/owlman(H), ITEM_SLOT_BELT)
H.equip_to_slot_or_del(new /obj/item/clothing/glasses/night(H), ITEM_SLOT_EYES)
/datum/superheroes/griffin
@@ -86,10 +86,10 @@
/datum/superheroes/griffin/equip(mob/living/carbon/human/H)
..()
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/griffin(H), SLOT_HUD_SHOES)
H.equip_to_slot_or_del(new /obj/item/clothing/under/costume/griffin(H), SLOT_HUD_JUMPSUIT)
H.equip_to_slot_or_del(new /obj/item/clothing/suit/toggle/owlwings/griffinwings(H), SLOT_HUD_OUTER_SUIT)
H.equip_to_slot_or_del(new /obj/item/clothing/head/griffin/(H), SLOT_HUD_HEAD)
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/griffin(H), ITEM_SLOT_SHOES)
H.equip_to_slot_or_del(new /obj/item/clothing/under/costume/griffin(H), ITEM_SLOT_JUMPSUIT)
H.equip_to_slot_or_del(new /obj/item/clothing/suit/toggle/owlwings/griffinwings(H), ITEM_SLOT_OUTER_SUIT)
H.equip_to_slot_or_del(new /obj/item/clothing/head/griffin/(H), ITEM_SLOT_HEAD)
var/obj/item/bio_chip/freedom/L = new/obj/item/bio_chip/freedom(H)
L.implant(H)
@@ -106,12 +106,12 @@
/datum/superheroes/lightnian/equip(mob/living/carbon/human/H)
..()
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/orange(H), SLOT_HUD_SHOES)
H.equip_to_slot_or_del(new /obj/item/clothing/under/color/brown(H), SLOT_HUD_JUMPSUIT)
H.equip_to_slot_or_del(new /obj/item/clothing/suit/corgisuit/super_hero(H), SLOT_HUD_OUTER_SUIT)
H.equip_to_slot_or_del(new /obj/item/clothing/head/corgi/super_hero(H), SLOT_HUD_HEAD)
H.equip_to_slot_or_del(new /obj/item/clothing/gloves/color/yellow(H), SLOT_HUD_GLOVES)
H.equip_to_slot_or_del(new /obj/item/bedsheet/orange(H), SLOT_HUD_BACK)
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/orange(H), ITEM_SLOT_SHOES)
H.equip_to_slot_or_del(new /obj/item/clothing/under/color/brown(H), ITEM_SLOT_JUMPSUIT)
H.equip_to_slot_or_del(new /obj/item/clothing/suit/corgisuit/super_hero(H), ITEM_SLOT_OUTER_SUIT)
H.equip_to_slot_or_del(new /obj/item/clothing/head/corgi/super_hero(H), ITEM_SLOT_HEAD)
H.equip_to_slot_or_del(new /obj/item/clothing/gloves/color/yellow(H), ITEM_SLOT_GLOVES)
H.equip_to_slot_or_del(new /obj/item/bedsheet/orange(H), ITEM_SLOT_BACK)
/datum/superheroes/electro
@@ -125,11 +125,11 @@
/datum/superheroes/electro/equip(mob/living/carbon/human/H)
..()
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/black/greytide(H), SLOT_HUD_SHOES)
H.equip_to_slot_or_del(new /obj/item/clothing/under/color/grey(H), SLOT_HUD_JUMPSUIT)
H.equip_to_slot_or_del(new /obj/item/clothing/suit/corgisuit/super_hero/en(H), SLOT_HUD_OUTER_SUIT)
H.equip_to_slot_or_del(new /obj/item/clothing/head/corgi/super_hero/en(H), SLOT_HUD_HEAD)
H.equip_to_slot_or_del(new /obj/item/bedsheet/cult(H), SLOT_HUD_BACK)
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/black/greytide(H), ITEM_SLOT_SHOES)
H.equip_to_slot_or_del(new /obj/item/clothing/under/color/grey(H), ITEM_SLOT_JUMPSUIT)
H.equip_to_slot_or_del(new /obj/item/clothing/suit/corgisuit/super_hero/en(H), ITEM_SLOT_OUTER_SUIT)
H.equip_to_slot_or_del(new /obj/item/clothing/head/corgi/super_hero/en(H), ITEM_SLOT_HEAD)
H.equip_to_slot_or_del(new /obj/item/bedsheet/cult(H), ITEM_SLOT_BACK)
@@ -223,10 +223,10 @@
for(var/obj/item/W in target.get_all_slots())
target.unEquip(W)
target.rename_character(target.real_name, "Generic Henchman ([rand(1, 1000)])")
target.equip_to_slot_or_del(new /obj/item/clothing/under/color/grey/greytide(target), SLOT_HUD_JUMPSUIT)
target.equip_to_slot_or_del(new /obj/item/clothing/shoes/black/greytide(target), SLOT_HUD_SHOES)
target.equip_to_slot_or_del(new /obj/item/storage/toolbox/mechanical/greytide(target), SLOT_HUD_LEFT_HAND)
target.equip_to_slot_or_del(new /obj/item/radio/headset(target), SLOT_HUD_LEFT_EAR)
target.equip_to_slot_or_del(new /obj/item/clothing/under/color/grey/greytide(target), ITEM_SLOT_JUMPSUIT)
target.equip_to_slot_or_del(new /obj/item/clothing/shoes/black/greytide(target), ITEM_SLOT_SHOES)
target.equip_to_slot_or_del(new /obj/item/storage/toolbox/mechanical/greytide(target), ITEM_SLOT_LEFT_HAND)
target.equip_to_slot_or_del(new /obj/item/radio/headset(target), ITEM_SLOT_LEFT_EAR)
var/obj/item/card/id/syndicate/W = new(target)
W.icon_state = "lifetimeid"
W.access = list(ACCESS_MAINT_TUNNELS)
@@ -235,5 +235,5 @@
W.flags |= NODROP
W.SetOwnerInfo(target)
W.UpdateName()
target.equip_to_slot_or_del(W, SLOT_HUD_WEAR_ID)
target.equip_to_slot_or_del(W, ITEM_SLOT_ID)
target.regenerate_icons()
@@ -264,7 +264,7 @@
icon_state = "herald_cloak"
item_state = "herald_cloak"
item_color = "herald_cloak"
slot_flags = SLOT_FLAG_TIE
slot_flags = ITEM_SLOT_ACCESSORY
allow_duplicates = FALSE
actions_types = list(/datum/action/item_action/accessory/herald)
@@ -206,7 +206,7 @@
icon_state = "hope"
item_state = "hope"
item_color = "hope"
slot_flags = SLOT_FLAG_TIE
slot_flags = ITEM_SLOT_ACCESSORY
allow_duplicates = FALSE
resistance_flags = FIRE_PROOF
@@ -474,14 +474,14 @@
/mob/living/simple_animal/get_item_by_slot(slot_id)
switch(slot_id)
if(SLOT_HUD_COLLAR)
if(ITEM_SLOT_COLLAR)
return pcollar
. = ..()
/mob/living/simple_animal/can_equip(obj/item/I, slot, disable_warning = 0)
// . = ..() // Do not call parent. We do not want animals using their hand slots.
switch(slot)
if(SLOT_HUD_COLLAR)
if(ITEM_SLOT_COLLAR)
if(pcollar)
return FALSE
if(!can_collar)
@@ -501,7 +501,7 @@
W.plane = ABOVE_HUD_PLANE
switch(slot)
if(SLOT_HUD_COLLAR)
if(ITEM_SLOT_COLLAR)
add_collar(W)
/mob/living/simple_animal/unEquip(obj/item/I, force, silent = FALSE)
+54 -54
View File
@@ -241,9 +241,9 @@
src:update_fhair()
/mob/proc/put_in_any_hand_if_possible(obj/item/W as obj, del_on_fail = 0, disable_warning = 1)
if(equip_to_slot_if_possible(W, SLOT_HUD_LEFT_HAND, del_on_fail, disable_warning))
if(equip_to_slot_if_possible(W, ITEM_SLOT_LEFT_HAND, del_on_fail, disable_warning))
return 1
else if(equip_to_slot_if_possible(W, SLOT_HUD_RIGHT_HAND, del_on_fail, disable_warning))
else if(equip_to_slot_if_possible(W, ITEM_SLOT_RIGHT_HAND, del_on_fail, disable_warning))
return 1
return 0
@@ -303,23 +303,23 @@
//The list of slots by priority. equip_to_appropriate_slot() uses this list. Doesn't matter if a mob type doesn't have a slot.
GLOBAL_LIST_INIT(slot_equipment_priority, list( \
SLOT_HUD_BACK,\
SLOT_HUD_WEAR_PDA,\
SLOT_HUD_WEAR_ID,\
SLOT_HUD_JUMPSUIT,\
SLOT_HUD_OUTER_SUIT,\
SLOT_HUD_WEAR_MASK,\
SLOT_HUD_HEAD,\
SLOT_HUD_SHOES,\
SLOT_HUD_GLOVES,\
SLOT_HUD_LEFT_EAR,\
SLOT_HUD_RIGHT_EAR,\
SLOT_HUD_GLASSES,\
SLOT_HUD_BELT,\
SLOT_HUD_SUIT_STORE,\
SLOT_HUD_TIE,\
SLOT_HUD_LEFT_STORE,\
SLOT_HUD_RIGHT_STORE\
ITEM_SLOT_BACK,\
ITEM_SLOT_PDA,\
ITEM_SLOT_ID,\
ITEM_SLOT_JUMPSUIT,\
ITEM_SLOT_OUTER_SUIT,\
ITEM_SLOT_MASK,\
ITEM_SLOT_HEAD,\
ITEM_SLOT_SHOES,\
ITEM_SLOT_GLOVES,\
ITEM_SLOT_LEFT_EAR,\
ITEM_SLOT_RIGHT_EAR,\
ITEM_SLOT_EYES,\
ITEM_SLOT_BELT,\
ITEM_SLOT_SUIT_STORE,\
ITEM_SLOT_ACCESSORY,\
ITEM_SLOT_LEFT_POCKET,\
ITEM_SLOT_RIGHT_POCKET\
))
//puts the item "W" into an appropriate slot in a human's inventory
@@ -328,7 +328,7 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
if(!istype(W)) return 0
for(var/slot in GLOB.slot_equipment_priority)
if(isstorage(W) && slot == SLOT_HUD_HEAD) // Storage items should be put on the belt before the head
if(isstorage(W) && slot == ITEM_SLOT_HEAD) // Storage items should be put on the belt before the head
continue
if(equip_to_slot_if_possible(W, slot, FALSE, TRUE)) //del_on_fail = 0; disable_warning = 0
return 1
@@ -352,22 +352,22 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
var/mob/living/carbon/human/H = M
switch(slot)
if(SLOT_HUD_LEFT_HAND)
if(ITEM_SLOT_LEFT_HAND)
if(H.l_hand)
return 0
return 1
if(SLOT_HUD_RIGHT_HAND)
if(ITEM_SLOT_RIGHT_HAND)
if(H.r_hand)
return 0
return 1
if(SLOT_HUD_WEAR_MASK)
if(!(slot_flags & SLOT_FLAG_MASK))
if(ITEM_SLOT_MASK)
if(!(slot_flags & ITEM_SLOT_MASK))
return 0
if(H.wear_mask)
return 0
return 1
if(SLOT_HUD_BACK)
if(!(slot_flags & SLOT_FLAG_BACK))
if(ITEM_SLOT_BACK)
if(!(slot_flags & ITEM_SLOT_BACK))
return 0
if(H.back)
if(!(H.back.flags & NODROP))
@@ -375,8 +375,8 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
else
return 0
return 1
if(SLOT_HUD_OUTER_SUIT)
if(!(slot_flags & SLOT_FLAG_OCLOTHING))
if(ITEM_SLOT_OUTER_SUIT)
if(!(slot_flags & ITEM_SLOT_OUTER_SUIT))
return 0
if(H.wear_suit)
if(!(H.wear_suit.flags & NODROP))
@@ -384,8 +384,8 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
else
return 0
return 1
if(SLOT_HUD_GLOVES)
if(!(slot_flags & SLOT_FLAG_GLOVES))
if(ITEM_SLOT_GLOVES)
if(!(slot_flags & ITEM_SLOT_GLOVES))
return 0
if(H.gloves)
if(!(H.gloves.flags & NODROP))
@@ -393,8 +393,8 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
else
return 0
return 1
if(SLOT_HUD_SHOES)
if(!(slot_flags & SLOT_FLAG_FEET))
if(ITEM_SLOT_SHOES)
if(!(slot_flags & ITEM_SLOT_SHOES))
return 0
if(H.shoes)
if(!(H.shoes.flags & NODROP))
@@ -402,12 +402,12 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
else
return 0
return 1
if(SLOT_HUD_BELT)
if(ITEM_SLOT_BELT)
if(!H.w_uniform)
if(!disable_warning)
to_chat(H, "<span class='warning'>You need a jumpsuit before you can attach this [name].</span>")
return 0
if(!(slot_flags & SLOT_FLAG_BELT))
if(!(slot_flags & ITEM_SLOT_BELT))
return 0
if(H.belt)
if(!(H.belt.flags & NODROP))
@@ -415,8 +415,8 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
else
return 0
return 1
if(SLOT_HUD_GLASSES)
if(!(slot_flags & SLOT_FLAG_EYES))
if(ITEM_SLOT_EYES)
if(!(slot_flags & ITEM_SLOT_EYES))
return 0
if(H.glasses)
if(!(H.glasses.flags & NODROP))
@@ -424,8 +424,8 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
else
return 0
return 1
if(SLOT_HUD_HEAD)
if(!(slot_flags & SLOT_FLAG_HEAD))
if(ITEM_SLOT_HEAD)
if(!(slot_flags & ITEM_SLOT_HEAD))
return 0
if(H.head)
if(!(H.head.flags & NODROP))
@@ -433,8 +433,8 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
else
return 0
return 1
if(SLOT_HUD_LEFT_EAR)
if(!(slot_flags & SLOT_HUD_LEFT_EAR))
if(ITEM_SLOT_LEFT_EAR)
if(!(slot_flags & ITEM_SLOT_LEFT_EAR))
return 0
if(H.l_ear)
if(!(H.l_ear.flags & NODROP))
@@ -442,8 +442,8 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
else
return 0
return 1
if(SLOT_HUD_RIGHT_EAR)
if(!(slot_flags & SLOT_HUD_RIGHT_EAR))
if(ITEM_SLOT_RIGHT_EAR)
if(!(slot_flags & ITEM_SLOT_RIGHT_EAR))
return 0
if(H.r_ear)
if(!(H.r_ear.flags & NODROP))
@@ -451,8 +451,8 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
else
return 0
return 1
if(SLOT_HUD_JUMPSUIT)
if(!(slot_flags & SLOT_FLAG_ICLOTHING))
if(ITEM_SLOT_JUMPSUIT)
if(!(slot_flags & ITEM_SLOT_JUMPSUIT))
return 0
if(H.w_uniform)
if(!(H.w_uniform.flags & NODROP))
@@ -460,12 +460,12 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
else
return 0
return 1
if(SLOT_HUD_WEAR_ID)
if(ITEM_SLOT_ID)
if(!H.w_uniform)
if(!disable_warning)
to_chat(H, "<span class='warning'>You need a jumpsuit before you can attach this [name].</span>")
return 0
if(!(slot_flags & SLOT_FLAG_ID))
if(!(slot_flags & ITEM_SLOT_ID))
return 0
if(H.wear_id)
if(!(H.wear_id.flags & NODROP))
@@ -473,26 +473,26 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
else
return 0
return 1
if(SLOT_HUD_LEFT_STORE)
if(ITEM_SLOT_LEFT_POCKET)
if(H.l_store)
return 0
if(!H.w_uniform)
if(!disable_warning)
to_chat(H, "<span class='warning'>You need a jumpsuit before you can attach this [name].</span>")
return 0
if(w_class <= WEIGHT_CLASS_SMALL || (slot_flags & SLOT_FLAG_POCKET))
if(w_class <= WEIGHT_CLASS_SMALL || (slot_flags & ITEM_SLOT_BOTH_POCKETS))
return 1
if(SLOT_HUD_RIGHT_STORE)
if(ITEM_SLOT_RIGHT_POCKET)
if(H.r_store)
return 0
if(!H.w_uniform)
if(!disable_warning)
to_chat(H, "<span class='warning'>You need a jumpsuit before you can attach this [name].</span>")
return 0
if(w_class <= WEIGHT_CLASS_SMALL || (slot_flags & SLOT_FLAG_POCKET))
if(w_class <= WEIGHT_CLASS_SMALL || (slot_flags & ITEM_SLOT_BOTH_POCKETS))
return 1
return 0
if(SLOT_HUD_SUIT_STORE)
if(ITEM_SLOT_SUIT_STORE)
if(!H.wear_suit)
if(!disable_warning)
to_chat(H, "<span class='warning'>You need a suit before you can attach this [name].</span>")
@@ -514,15 +514,15 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
else
return 1
return 0
if(SLOT_HUD_HANDCUFFED)
if(ITEM_SLOT_HANDCUFFED)
if(H.handcuffed)
return 0
return istype(src, /obj/item/restraints/handcuffs)
if(SLOT_HUD_LEGCUFFED)
if(ITEM_SLOT_LEGCUFFED)
if(H.legcuffed)
return 0
return istype(src, /obj/item/restraints/legcuffs)
if(SLOT_HUD_IN_BACKPACK)
if(ITEM_SLOT_IN_BACKPACK)
if(H.back && istype(H.back, /obj/item/storage/backpack))
var/obj/item/storage/backpack/B = H.back
if(length(B.contents) < B.storage_slots && w_class <= B.max_w_class)
+2 -2
View File
@@ -3,7 +3,7 @@
name = "holder"
desc = "You shouldn't ever see this."
icon = 'icons/obj/objects.dmi'
slot_flags = SLOT_FLAG_HEAD|SLOT_FLAG_EARS
slot_flags = ITEM_SLOT_HEAD|ITEM_SLOT_BOTH_EARS
/obj/item/holder/New()
..()
@@ -98,7 +98,7 @@
name = "nian caterpillar"
desc = "It's a tiny little itty bitty critter."
icon_state = "mothroach"
slot_flags = SLOT_FLAG_HEAD
slot_flags = ITEM_SLOT_HEAD
/obj/item/holder/drone/emagged
name = "maintenance drone"