Hardsuit Helmets can now be used as internals masks. Rejoice, CE mains.

Also reworks internals code a little to be much more friendly. Any head or mask item with the flag should now function as an internals mask if it has the ALLOWSINTERNALS flag.
This commit is contained in:
Chayse Ramsay
2019-07-28 17:31:59 +01:00
parent 39dea966ae
commit 5055cd73b9
14 changed files with 62 additions and 37 deletions
@@ -15,7 +15,7 @@
icon_state = "facehugger"
item_state = "facehugger"
w_class = WEIGHT_CLASS_TINY //note: can be picked up by aliens unlike most other items of w_class below 4
clothing_flags = MASKINTERNALS
clothing_flags = ALLOWINTERNALS
throw_range = 5
tint = 3
flags_cover = MASKCOVERSEYES | MASKCOVERSMOUTH
+2 -2
View File
@@ -238,7 +238,7 @@
if(href_list["internal"])
var/slot = text2num(href_list["internal"])
var/obj/item/ITEM = get_item_by_slot(slot)
if(ITEM && istype(ITEM, /obj/item/tank) && wear_mask && (wear_mask.clothing_flags & MASKINTERNALS))
if(ITEM && istype(ITEM, /obj/item/tank) && wear_mask && (wear_mask.clothing_flags & ALLOWINTERNALS))
visible_message("<span class='danger'>[usr] tries to [internal ? "close" : "open"] the valve on [src]'s [ITEM.name].</span>", \
"<span class='userdanger'>[usr] tries to [internal ? "close" : "open"] the valve on [src]'s [ITEM.name].</span>")
if(do_mob(usr, src, POCKET_STRIP_DELAY))
@@ -246,7 +246,7 @@
internal = null
update_internals_hud_icon(0)
else if(ITEM && istype(ITEM, /obj/item/tank))
if((wear_mask && (wear_mask.clothing_flags & MASKINTERNALS)) || getorganslot(ORGAN_SLOT_BREATHING_TUBE))
if((wear_mask && (wear_mask.clothing_flags & ALLOWINTERNALS)) || getorganslot(ORGAN_SLOT_BREATHING_TUBE))
internal = ITEM
update_internals_hud_icon(1)
@@ -77,6 +77,12 @@
s_store,
)
/mob/living/carbon/human/proc/get_internal_slots()
return list(
head,
wear_mask,
)
//This is an UNSAFE proc. Use mob_can_equip() before calling this one! Or rather use equip_to_slot_if_possible() or advanced_equip_to_slot_if_possible()
/mob/living/carbon/human/equip_to_slot(obj/item/I, slot)
if(!..()) //a check failed or the item has already found its slot
+11 -1
View File
@@ -304,11 +304,21 @@
return
/mob/living/carbon/proc/get_breath_from_internal(volume_needed)
var/obj/item/clothing/check
var/internals = FALSE
var/internalslots = list(
head,
wear_mask,
)
for(check in internalslots)
if(CHECK_BITFIELD(check.clothing_flags, ALLOWINTERNALS))
internals = TRUE
if(internal)
if(internal.loc != src)
internal = null
update_internals_hud_icon(0)
else if ((!wear_mask || !(wear_mask.clothing_flags & MASKINTERNALS)) && !getorganslot(ORGAN_SLOT_BREATHING_TUBE))
else if (internals == FALSE && !getorganslot(ORGAN_SLOT_BREATHING_TUBE))
internal = null
update_internals_hud_icon(0)
else