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:
@@ -33,7 +33,7 @@
|
||||
#define LAVAPROTECT (1<<0)
|
||||
#define STOPSPRESSUREDAMAGE (1<<1) //SUIT and HEAD items which stop pressure damage. To stop you taking all pressure damage you must have both a suit and head item with this flag.
|
||||
#define BLOCK_GAS_SMOKE_EFFECT (1<<2) // blocks the effect that chemical clouds would have on a mob --glasses, mask and helmets ONLY!
|
||||
#define MASKINTERNALS (1<<3) // mask allows internals
|
||||
#define ALLOWINTERNALS (1<<3) // mask allows internals
|
||||
#define NOSLIP (1<<4) //prevents from slipping on wet floors, in space etc
|
||||
#define THICKMATERIAL (1<<5) //prevents syringes, parapens and hypos if the external suit or helmet (if targeting head) has this flag. Example: space suits, biosuit, bombsuits, thick suits that cover your body.
|
||||
#define VOICEBOX_TOGGLABLE (1<<6) // The voicebox in this clothing can be toggled.
|
||||
|
||||
@@ -136,7 +136,7 @@ GLOBAL_LIST_INIT(bitfields, list(
|
||||
"LAVAPROTECT" = LAVAPROTECT,
|
||||
"STOPSPRESSUREDAMAGE" = STOPSPRESSUREDAMAGE,
|
||||
"BLOCK_GAS_SMOKE_EFFECT" = BLOCK_GAS_SMOKE_EFFECT,
|
||||
"MASKINTERNALS" = MASKINTERNALS,
|
||||
"ALLOWINTERNALS" = ALLOWINTERNALS,
|
||||
"NOSLIP" = NOSLIP,
|
||||
"THICKMATERIAL" = THICKMATERIAL,
|
||||
"VOICEBOX_TOGGLABLE" = VOICEBOX_TOGGLABLE,
|
||||
|
||||
@@ -280,7 +280,7 @@
|
||||
/obj/screen/internals/Click()
|
||||
if(!iscarbon(usr))
|
||||
return
|
||||
var/mob/living/carbon/C = usr
|
||||
var/mob/living/carbon/human/C = usr
|
||||
if(C.incapacitated())
|
||||
return
|
||||
|
||||
@@ -290,16 +290,19 @@
|
||||
icon_state = "internal0"
|
||||
else
|
||||
if(!C.getorganslot(ORGAN_SLOT_BREATHING_TUBE))
|
||||
if(!istype(C.wear_mask, /obj/item/clothing/mask))
|
||||
var/obj/item/clothing/check
|
||||
var/internals = FALSE
|
||||
|
||||
for(check in C.get_internal_slots())
|
||||
if(istype(check, /obj/item/clothing/mask))
|
||||
var/obj/item/clothing/mask/M = check
|
||||
if(M.mask_adjusted)
|
||||
M.adjustmask(C)
|
||||
if(CHECK_BITFIELD(check.clothing_flags, ALLOWINTERNALS))
|
||||
internals = TRUE
|
||||
if(!internals)
|
||||
to_chat(C, "<span class='warning'>You are not wearing an internals mask!</span>")
|
||||
return 1
|
||||
else
|
||||
var/obj/item/clothing/mask/M = C.wear_mask
|
||||
if(M.mask_adjusted) // if mask on face but pushed down
|
||||
M.adjustmask(C) // adjust it back
|
||||
if( !(M.clothing_flags & MASKINTERNALS) )
|
||||
to_chat(C, "<span class='warning'>You are not wearing an internals mask!</span>")
|
||||
return
|
||||
return
|
||||
|
||||
var/obj/item/I = C.is_holding_item_of_type(/obj/item/tank)
|
||||
if(I)
|
||||
|
||||
@@ -33,13 +33,19 @@
|
||||
H.update_internals_hud_icon(0)
|
||||
else
|
||||
if(!H.getorganslot(ORGAN_SLOT_BREATHING_TUBE))
|
||||
if(!H.wear_mask)
|
||||
to_chat(H, "<span class='warning'>You need a mask!</span>")
|
||||
return
|
||||
if(H.wear_mask.mask_adjusted)
|
||||
H.wear_mask.adjustmask(H)
|
||||
if(!(H.wear_mask.clothing_flags & MASKINTERNALS))
|
||||
to_chat(H, "<span class='warning'>[H.wear_mask] can't use [src]!</span>")
|
||||
var/obj/item/clothing/check
|
||||
var/internals = FALSE
|
||||
|
||||
for(check in H.get_internal_slots())
|
||||
if(istype(check, /obj/item/clothing/mask))
|
||||
var/obj/item/clothing/mask/M = check
|
||||
if(M.mask_adjusted)
|
||||
M.adjustmask(H)
|
||||
if(CHECK_BITFIELD(check.clothing_flags, ALLOWINTERNALS))
|
||||
internals = TRUE
|
||||
|
||||
if(!internals)
|
||||
to_chat(H, "<span class='warning'>You are not wearing an internals mask!</span>")
|
||||
return
|
||||
|
||||
if(H.internal)
|
||||
|
||||
@@ -437,7 +437,7 @@
|
||||
item_state = "gas_alt"
|
||||
resistance_flags = NONE
|
||||
armor = list("melee" = 5, "bullet" = 5, "laser" = 5, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 50)
|
||||
clothing_flags = BLOCK_GAS_SMOKE_EFFECT | MASKINTERNALS
|
||||
clothing_flags = BLOCK_GAS_SMOKE_EFFECT | ALLOWINTERNALS
|
||||
flags_inv = HIDEEARS|HIDEEYES|HIDEFACE|HIDEFACIALHAIR
|
||||
gas_transfer_coefficient = 0.01
|
||||
permeability_coefficient = 0.01
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
icon_state = "breath"
|
||||
item_state = "m_mask"
|
||||
body_parts_covered = 0
|
||||
clothing_flags = MASKINTERNALS
|
||||
visor_flags = MASKINTERNALS
|
||||
clothing_flags = ALLOWINTERNALS
|
||||
visor_flags = ALLOWINTERNALS
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
gas_transfer_coefficient = 0.1
|
||||
permeability_coefficient = 0.5
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
name = "gas mask"
|
||||
desc = "A face-covering mask that can be connected to an air supply. While good for concealing your identity, it isn't good for blocking gas flow." //More accurate
|
||||
icon_state = "gas_alt"
|
||||
clothing_flags = BLOCK_GAS_SMOKE_EFFECT | MASKINTERNALS
|
||||
clothing_flags = BLOCK_GAS_SMOKE_EFFECT | ALLOWINTERNALS
|
||||
flags_inv = HIDEEARS|HIDEEYES|HIDEFACE|HIDEFACIALHAIR|HIDESNOUT
|
||||
w_class = WEIGHT_CLASS_NORMAL
|
||||
item_state = "gas_alt"
|
||||
@@ -59,7 +59,7 @@
|
||||
/obj/item/clothing/mask/gas/clown_hat
|
||||
name = "clown wig and mask"
|
||||
desc = "A true prankster's facial attire. A clown is incomplete without his wig and mask."
|
||||
clothing_flags = MASKINTERNALS
|
||||
clothing_flags = ALLOWINTERNALS
|
||||
icon_state = "clown"
|
||||
item_state = "clown_hat"
|
||||
flags_cover = MASKCOVERSEYES
|
||||
@@ -91,7 +91,7 @@
|
||||
/obj/item/clothing/mask/gas/sexyclown
|
||||
name = "sexy-clown wig and mask"
|
||||
desc = "A feminine clown mask for the dabbling crossdressers or female entertainers."
|
||||
clothing_flags = MASKINTERNALS
|
||||
clothing_flags = ALLOWINTERNALS
|
||||
icon_state = "sexyclown"
|
||||
item_state = "sexyclown"
|
||||
flags_cover = MASKCOVERSEYES
|
||||
@@ -100,7 +100,7 @@
|
||||
/obj/item/clothing/mask/gas/mime
|
||||
name = "mime mask"
|
||||
desc = "The traditional mime's mask. It has an eerie facial posture."
|
||||
clothing_flags = MASKINTERNALS
|
||||
clothing_flags = ALLOWINTERNALS
|
||||
icon_state = "mime"
|
||||
item_state = "mime"
|
||||
flags_cover = MASKCOVERSEYES
|
||||
@@ -132,7 +132,7 @@
|
||||
/obj/item/clothing/mask/gas/monkeymask
|
||||
name = "monkey mask"
|
||||
desc = "A mask used when acting as a monkey."
|
||||
clothing_flags = MASKINTERNALS
|
||||
clothing_flags = ALLOWINTERNALS
|
||||
icon_state = "monkeymask"
|
||||
item_state = "monkeymask"
|
||||
flags_cover = MASKCOVERSEYES
|
||||
@@ -141,7 +141,7 @@
|
||||
/obj/item/clothing/mask/gas/sexymime
|
||||
name = "sexy mime mask"
|
||||
desc = "A traditional female mime's mask."
|
||||
clothing_flags = MASKINTERNALS
|
||||
clothing_flags = ALLOWINTERNALS
|
||||
icon_state = "sexymime"
|
||||
item_state = "sexymime"
|
||||
flags_cover = MASKCOVERSEYES
|
||||
@@ -162,7 +162,7 @@
|
||||
name = "owl mask"
|
||||
desc = "Twoooo!"
|
||||
icon_state = "owl"
|
||||
clothing_flags = MASKINTERNALS
|
||||
clothing_flags = ALLOWINTERNALS
|
||||
flags_cover = MASKCOVERSEYES
|
||||
resistance_flags = FLAMMABLE
|
||||
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
actions_types = list(/datum/action/item_action/halt, /datum/action/item_action/adjust)
|
||||
icon_state = "sechailer"
|
||||
item_state = "sechailer"
|
||||
clothing_flags = BLOCK_GAS_SMOKE_EFFECT | MASKINTERNALS
|
||||
clothing_flags = BLOCK_GAS_SMOKE_EFFECT | ALLOWINTERNALS
|
||||
flags_inv = HIDEFACIALHAIR|HIDEFACE
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
visor_flags = BLOCK_GAS_SMOKE_EFFECT | MASKINTERNALS
|
||||
visor_flags = BLOCK_GAS_SMOKE_EFFECT | ALLOWINTERNALS
|
||||
visor_flags_inv = HIDEFACE
|
||||
flags_cover = MASKCOVERSMOUTH
|
||||
visor_flags_cover = MASKCOVERSMOUTH
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
name = "space helmet"
|
||||
icon_state = "spaceold"
|
||||
desc = "A special helmet with solar UV shielding to protect your eyes from harmful rays."
|
||||
clothing_flags = STOPSPRESSUREDAMAGE | THICKMATERIAL
|
||||
clothing_flags = STOPSPRESSUREDAMAGE | THICKMATERIAL | BLOCK_GAS_SMOKE_EFFECT | ALLOWINTERNALS
|
||||
item_state = "spaceold"
|
||||
permeability_coefficient = 0.01
|
||||
armor = list("melee" = 0, "bullet" = 0, "laser" = 0,"energy" = 0, "bomb" = 0, "bio" = 100, "rad" = 50, "fire" = 80, "acid" = 70)
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
name = "explorer gas mask"
|
||||
desc = "A military-grade gas mask that can be connected to an air supply."
|
||||
icon_state = "gas_mining"
|
||||
visor_flags = BLOCK_GAS_SMOKE_EFFECT | MASKINTERNALS
|
||||
visor_flags = BLOCK_GAS_SMOKE_EFFECT | ALLOWINTERNALS
|
||||
visor_flags_inv = HIDEFACIALHAIR
|
||||
visor_flags_cover = MASKCOVERSMOUTH
|
||||
actions_types = list(/datum/action/item_action/adjust)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user