Removes *COVERSEYES

Removes (HEAD|MASK|GLASSES)COVERSEYES flags, in favour of using
body_parts_covered.
This commit is contained in:
mwerezak
2015-07-10 22:12:24 -04:00
committed by HarpyEagle
parent d3a40f4269
commit b80c01ffbe
26 changed files with 74 additions and 77 deletions

View File

@@ -97,14 +97,14 @@ obj/var/contaminated = 0
if(!wear_mask)
burn_eyes()
else
if(!(wear_mask.flags & MASKCOVERSEYES))
if(!(wear_mask.body_parts_covered & EYES))
burn_eyes()
else
if(!(head.flags & HEADCOVERSEYES))
if(!(head.body_parts_covered & EYES))
if(!wear_mask)
burn_eyes()
else
if(!(wear_mask.flags & MASKCOVERSEYES))
if(!(wear_mask.body_parts_covered & EYES))
burn_eyes()
//Genetic Corruption
@@ -135,7 +135,7 @@ obj/var/contaminated = 0
if(vsc.plc.PHORONGUARD_ONLY)
if(head.flags & PHORONGUARD)
return 1
else if(head.flags & HEADCOVERSEYES)
else if(head.body_parts_covered & EYES)
return 1
return 0

View File

@@ -36,9 +36,6 @@
#define PROXMOVE 0x200 // Does this object require proximity checking in Enter()?
//Use these flags to indicate if an item obscures the specified slots from view, whereas body_parts_covered seems to be used to indicate what body parts the item protects.
#define GLASSESCOVERSEYES 0x200
#define MASKCOVERSEYES 0x200 // Get rid of some of the other retardation in these flags.
#define HEADCOVERSEYES 0x200 // Feel free to reallocate these numbers for other purposes.
#define MASKCOVERSMOUTH 0x400 // On other items, these are just for mask/head.
#define HEADCOVERSMOUTH 0x400

View File

@@ -35,8 +35,7 @@
icon_state = "culthood"
desc = "A hood worn by the followers of Nar-Sie."
flags_inv = HIDEFACE
flags = HEADCOVERSEYES
body_parts_covered = HEAD|EYES
body_parts_covered = HEAD
armor = list(melee = 30, bullet = 10, laser = 5,energy = 5, bomb = 0, bio = 0, rad = 0)
cold_protection = HEAD
min_cold_protection_temperature = SPACE_HELMET_MIN_COLD_PROTECTION_TEMPERATURE
@@ -50,7 +49,7 @@
icon_state = "magus"
desc = "A helm worn by the followers of Nar-Sie."
flags_inv = HIDEFACE
flags = HEADCOVERSEYES | HEADCOVERSMOUTH | BLOCKHAIR
flags = HEADCOVERSMOUTH | BLOCKHAIR
body_parts_covered = HEAD|FACE|EYES
/obj/item/clothing/head/culthood/alt

View File

@@ -418,14 +418,12 @@ var/list/global/slot_flags_enumeration = list(
/obj/item/proc/eyestab(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
var/mob/living/carbon/human/H = M
if(istype(H) && ( \
(H.head && H.head.flags & HEADCOVERSEYES) || \
(H.wear_mask && H.wear_mask.flags & MASKCOVERSEYES) || \
(H.glasses && H.glasses.flags & GLASSESCOVERSEYES) \
))
// you can't stab someone in the eyes wearing a mask!
user << "<span class='warning'>You're going to need to remove the eye covering first.</span>"
return
if(istype(H))
for(var/obj/item/protection in list(H.head, H.wear_mask, H.glasses))
if(protection && (protection.body_parts_covered & EYES))
// you can't stab someone in the eyes wearing a mask!
user << "<span class='warning'>You're going to need to remove the eye covering first.</span>"
return
if(!M.has_eyes())
user << "<span class='warning'>You cannot locate any eyes on [M]!</span>"

View File

@@ -51,7 +51,7 @@
var/mob/living/carbon/human/H = M //mob has protective eyewear
if(istype(H))
for(var/obj/item/clothing/C in list(H.head,H.wear_mask,H.glasses))
if(istype(C) && C.flags & (HEADCOVERSEYES|MASKCOVERSEYES|GLASSESCOVERSEYES))
if(istype(C) && (C.body_parts_covered & EYES))
user << "<span class='warning'>You're going to need to remove [C.name] first.</span>"
return

View File

@@ -73,7 +73,14 @@
return
if(istype(M, /mob/living/carbon/human) && ((H.head && H.head.flags & HEADCOVERSEYES) || (H.wear_mask && H.wear_mask.flags & MASKCOVERSEYES) || (H.glasses && H.glasses.flags & GLASSESCOVERSEYES)))
var/protected = 0
for(var/slot in list(slot_head, slot_wear_mask, slot_glasses))
var/obj/item/protection = M.get_equipped_item(slot)
if(istype(protection) && (protection.body_parts_covered & FACE))
protected = 1
break
if(protected)
M << "<span class='warning'>You get slammed in the face with the tray, against your mask!</span>"
if(prob(33))
src.add_blood(H)

View File

@@ -170,7 +170,7 @@ BLIND // can't see anything
name = "glasses"
icon = 'icons/obj/clothing/glasses.dmi'
w_class = 2.0
flags = GLASSESCOVERSEYES
body_parts_covered = EYES
slot_flags = SLOT_EYES
var/vision_flags = 0
var/darkness_view = 0//Base human is 2

View File

@@ -3,7 +3,6 @@
name = "glasses"
icon = 'icons/obj/clothing/glasses.dmi'
//w_class = 2.0
//flags = GLASSESCOVERSEYES
//slot_flags = SLOT_EYES
//var/vision_flags = 0
//var/darkness_view = 0//Base human is 2
@@ -13,7 +12,6 @@
var/active = 1
var/activation_sound = 'sound/items/goggles_charge.ogg'
var/obj/screen/overlay = null
body_parts_covered = EYES
/obj/item/clothing/glasses/attack_self(mob/user)
if(toggleable)
@@ -159,14 +157,12 @@
if(usr.canmove && !usr.stat && !usr.restrained())
if(src.up)
src.up = !src.up
src.flags |= GLASSESCOVERSEYES
flags_inv |= HIDEEYES
body_parts_covered |= EYES
icon_state = initial(icon_state)
usr << "You flip \the [src] down to protect your eyes."
else
src.up = !src.up
src.flags &= ~HEADCOVERSEYES
flags_inv &= ~HIDEEYES
body_parts_covered &= ~EYES
icon_state = "[initial(icon_state)]up"

View File

@@ -1,7 +1,7 @@
/obj/item/clothing/glasses/hud
name = "HUD"
desc = "A heads-up display that provides important info in (almost) real time."
flags = null //doesn't protect eyes because it's a monocle, duh
flags = 0 //doesn't protect eyes because it's a monocle, duh
origin_tech = list(TECH_MAGNET = 3, TECH_BIO = 2)
var/list/icon/current = list() //the current hud icons

View File

@@ -6,7 +6,8 @@
slot_l_hand_str = "helmet",
slot_r_hand_str = "helmet",
)
flags = HEADCOVERSEYES | THICKMATERIAL
flags = THICKMATERIAL
body_parts_covered = HEAD
armor = list(melee = 50, bullet = 15, laser = 50,energy = 10, bomb = 25, bio = 0, rad = 0)
flags_inv = HIDEEARS|HIDEEYES
cold_protection = HEAD
@@ -20,7 +21,7 @@
name = "riot helmet"
desc = "It's a helmet specifically designed to protect against close range attacks."
icon_state = "riot"
flags = HEADCOVERSEYES
body_parts_covered = HEAD|FACE|EYES //face shield
armor = list(melee = 82, bullet = 15, laser = 5,energy = 5, bomb = 5, bio = 2, rad = 0)
flags_inv = HIDEEARS
siemens_coefficient = 0.7
@@ -29,7 +30,6 @@
name = "\improper SWAT helmet"
desc = "They're often used by highly trained Swat Members."
icon_state = "swat"
flags = HEADCOVERSEYES
armor = list(melee = 80, bullet = 60, laser = 50,energy = 25, bomb = 50, bio = 10, rad = 0)
flags_inv = HIDEEARS|HIDEEYES
cold_protection = HEAD
@@ -40,7 +40,6 @@
name = "\improper Thunderdome helmet"
desc = "<i>'Let the battle commence!'</i>"
icon_state = "thunderdome"
flags = HEADCOVERSEYES
armor = list(melee = 80, bullet = 60, laser = 50,energy = 10, bomb = 25, bio = 10, rad = 0)
cold_protection = HEAD
min_cold_protection_temperature = SPACE_HELMET_MIN_COLD_PROTECTION_TEMPERATURE
@@ -50,15 +49,15 @@
name = "gladiator helmet"
desc = "Ave, Imperator, morituri te salutant."
icon_state = "gladiator"
flags = HEADCOVERSEYES|HEADCOVERSMOUTH|BLOCKHAIR
flags = HEADCOVERSMOUTH|BLOCKHAIR
flags_inv = HIDEMASK|HIDEEARS|HIDEEYES
body_parts_covered = HEAD|FACE
siemens_coefficient = 1
/obj/item/clothing/head/helmet/tactical
name = "tactical helmet"
desc = "An armored helmet capable of being fitted with a multitude of attachments."
icon_state = "swathelm"
flags = HEADCOVERSEYES
sprite_sheets = list(
"Tajara" = 'icons/mob/species/tajaran/helmet.dmi',
"Unathi" = 'icons/mob/species/unathi/helmet.dmi',
@@ -72,9 +71,9 @@
name = "Augment Array"
desc = "A helmet with optical and cranial augments coupled to it."
icon_state = "v62"
flags = HEADCOVERSEYES
armor = list(melee = 80, bullet = 60, laser = 50,energy = 25, bomb = 50, bio = 10, rad = 0)
flags_inv = HIDEEARS|HIDEEYES
body_parts_covered = HEAD|EYES
cold_protection = HEAD
min_cold_protection_temperature = SPACE_HELMET_MIN_COLD_PROTECTION_TEMPERATURE
siemens_coefficient = 0.5

View File

@@ -38,15 +38,15 @@
name = "chaplain's hood"
desc = "It's hood that covers the head. It keeps you warm during the space winters."
icon_state = "chaplain_hood"
flags = HEADCOVERSEYES|BLOCKHAIR
body_parts_covered = HEAD|EYES
flags = BLOCKHAIR
body_parts_covered = HEAD
//Chaplain
/obj/item/clothing/head/nun_hood
name = "nun hood"
desc = "Maximum piety in this star system."
icon_state = "nun_hood"
flags = HEADCOVERSEYES|BLOCKHAIR
flags = BLOCKHAIR
body_parts_covered = HEAD
//Mime

View File

@@ -56,7 +56,7 @@
name = "hastur's hood"
desc = "It's unspeakably stylish"
icon_state = "hasturhood"
flags = HEADCOVERSEYES|BLOCKHAIR
flags = BLOCKHAIR
body_parts_covered = HEAD|FACE|EYES
/obj/item/clothing/head/nursehat
@@ -84,7 +84,7 @@
desc = "A large, featureless white orb mean to be worn on your head. How do you even see out of this thing?"
icon_state = "cueball"
item_state = "cueball"
flags = HEADCOVERSEYES|HEADCOVERSMOUTH|BLOCKHAIR
flags = HEADCOVERSMOUTH|BLOCKHAIR
flags_inv = 0
body_parts_covered = HEAD|FACE|EYES
@@ -101,7 +101,7 @@
desc = "A helmet made out of a box."
icon_state = "cardborg_h"
item_state = "cardborg_h"
flags = HEADCOVERSEYES | HEADCOVERSMOUTH
flags = HEADCOVERSMOUTH
flags_inv = HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE
body_parts_covered = HEAD|FACE|EYES
@@ -109,7 +109,8 @@
name = "justice hat"
desc = "fight for what's righteous!"
icon_state = "justicered"
flags = HEADCOVERSEYES|HEADCOVERSMOUTH|BLOCKHAIR
flags = HEADCOVERSMOUTH|BLOCKHAIR
body_parts_covered = HEAD|EYES
/obj/item/clothing/head/justice/blue
icon_state = "justiceblue"

View File

@@ -19,7 +19,7 @@
slot_l_hand_str = "welding",
slot_r_hand_str = "welding",
)
flags = HEADCOVERSEYES | HEADCOVERSMOUTH
flags = HEADCOVERSMOUTH
matter = list(DEFAULT_WALL_MATERIAL = 3000, "glass" = 1000)
var/up = 0
armor = list(melee = 10, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0)
@@ -44,14 +44,16 @@
if(usr.canmove && !usr.stat && !usr.restrained())
if(src.up)
src.up = !src.up
src.flags |= (HEADCOVERSEYES | HEADCOVERSMOUTH)
src.flags |= (HEADCOVERSMOUTH)
flags_inv |= (HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE)
body_parts_covered |= (EYES|FACE)
icon_state = base_state
usr << "You flip the [src] down to protect your eyes."
else
src.up = !src.up
src.flags &= ~(HEADCOVERSEYES | HEADCOVERSMOUTH)
src.flags &= ~(HEADCOVERSMOUTH)
flags_inv &= ~(HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE)
body_parts_covered &= ~(EYES|FACE)
icon_state = "[base_state]up"
usr << "You push the [src] up out of your face."
update_clothing_icon() //so our mob-overlays
@@ -66,9 +68,8 @@
desc = "It's tasty looking!"
icon_state = "cake0"
item_state = "cake0"
flags = HEADCOVERSEYES
var/onfire = 0
body_parts_covered = HEAD|EYES
body_parts_covered = HEAD
/obj/item/clothing/head/cakehat/process()
if(!onfire)
@@ -124,9 +125,9 @@
name = "carved pumpkin"
desc = "A jack o' lantern! Believed to ward off evil spirits."
icon_state = "hardhat0_pumpkin"//Could stand to be renamed
flags = HEADCOVERSEYES | HEADCOVERSMOUTH | BLOCKHAIR
flags = HEADCOVERSMOUTH | BLOCKHAIR
flags_inv = HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE
body_parts_covered = HEAD|EYES
body_parts_covered = HEAD|FACE|EYES
brightness_on = 2
light_overlay = "helmet_light"
w_class = 3
@@ -155,4 +156,4 @@
desc = "You can hear the distant sounds of rhythmic electronica."
icon_state = "richard"
body_parts_covered = HEAD|FACE
flags = HEADCOVERSEYES|HEADCOVERSMOUTH|BLOCKHAIR
flags = HEADCOVERSMOUTH|BLOCKHAIR

View File

@@ -2,7 +2,7 @@
name = "gas mask"
desc = "A face-covering mask that can be connected to an air supply. Filters harmful gases from the air."
icon_state = "gas_alt"
flags = MASKCOVERSMOUTH | MASKCOVERSEYES | BLOCK_GAS_SMOKE_EFFECT | AIRTIGHT
flags = MASKCOVERSMOUTH | BLOCK_GAS_SMOKE_EFFECT | AIRTIGHT
flags_inv = HIDEEARS|HIDEEYES|HIDEFACE
body_parts_covered = FACE|EYES
w_class = 3.0

View File

@@ -45,7 +45,7 @@
/obj/item/clothing/head/helmet/space/vox
armor = list(melee = 60, bullet = 50, laser = 30, energy = 15, bomb = 30, bio = 30, rad = 30)
siemens_coefficient = 0.6
flags = HEADCOVERSEYES|STOPPRESSUREDAMAGE
flags = STOPPRESSUREDAMAGE
species_restricted = list("Vox")
sprite_sheets = list("Vox" = 'icons/mob/species/vox/head.dmi')

View File

@@ -4,7 +4,7 @@
icon_state = "capspace"
item_state = "capspace"
desc = "A special helmet designed for work in a hazardous, low-pressure environment. Only for the most fashionable of military figureheads."
flags = HEADCOVERSEYES | BLOCKHAIR | STOPPRESSUREDAMAGE
flags = BLOCKHAIR | STOPPRESSUREDAMAGE
flags_inv = HIDEFACE
permeability_coefficient = 0.01
armor = list(melee = 65, bullet = 50, laser = 50,energy = 25, bomb = 50, bio = 100, rad = 50)

View File

@@ -37,7 +37,7 @@
slot_r_hand_str = "syndicate-helm-black-red",
)
armor = list(melee = 65, bullet = 55, laser = 35,energy = 20, bomb = 30, bio = 100, rad = 60)
flags = HEADCOVERSEYES | BLOCKHAIR | HEADCOVERSMOUTH | STOPPRESSUREDAMAGE | THICKMATERIAL
flags = BLOCKHAIR | HEADCOVERSMOUTH | STOPPRESSUREDAMAGE | THICKMATERIAL
siemens_coefficient = 0.6
//how is this a space helmet?
@@ -46,7 +46,7 @@
desc = "An armored beret commonly used by special operations officers."
icon_state = "beret_badge"
armor = list(melee = 65, bullet = 55, laser = 35,energy = 20, bomb = 30, bio = 30, rad = 30)
flags = HEADCOVERSEYES | BLOCKHAIR | STOPPRESSUREDAMAGE
flags = BLOCKHAIR | STOPPRESSUREDAMAGE
siemens_coefficient = 0.9
//Space santa outfit suit
@@ -55,7 +55,7 @@
desc = "Ho ho ho. Merrry X-mas!"
icon_state = "santahat"
item_state = "santahat"
flags = HEADCOVERSEYES | BLOCKHAIR | STOPPRESSUREDAMAGE
flags = BLOCKHAIR | STOPPRESSUREDAMAGE
body_parts_covered = HEAD
/obj/item/clothing/suit/space/santa
@@ -74,7 +74,7 @@
icon_state = "pirate"
item_state = "pirate"
armor = list(melee = 60, bullet = 50, laser = 30,energy = 15, bomb = 30, bio = 30, rad = 30)
flags = HEADCOVERSEYES | BLOCKHAIR | STOPPRESSUREDAMAGE
flags = BLOCKHAIR | STOPPRESSUREDAMAGE
body_parts_covered = 0
siemens_coefficient = 0.9

View File

@@ -4,7 +4,7 @@
/obj/item/clothing/head/helmet/space/rig
name = "helmet"
flags = HEADCOVERSEYES | BLOCKHAIR | HEADCOVERSMOUTH | THICKMATERIAL
flags = BLOCKHAIR | HEADCOVERSMOUTH | THICKMATERIAL
flags_inv = HIDEEARS|HIDEEYES|HIDEFACE
body_parts_covered = HEAD|FACE|EYES
heat_protection = HEAD|FACE|EYES

View File

@@ -6,7 +6,7 @@
name = "Space helmet"
icon_state = "space"
desc = "A special helmet designed for work in a hazardous, low-pressure environment."
flags = HEADCOVERSEYES | BLOCKHAIR | HEADCOVERSMOUTH | STOPPRESSUREDAMAGE | THICKMATERIAL | AIRTIGHT
flags = BLOCKHAIR | HEADCOVERSMOUTH | STOPPRESSUREDAMAGE | THICKMATERIAL | AIRTIGHT
item_state_slots = list(
slot_l_hand_str = "s_helmet",
slot_r_hand_str = "s_helmet",

View File

@@ -8,7 +8,7 @@
)
desc = "A hood that protects the head and face from biological comtaminants."
permeability_coefficient = 0.01
flags = HEADCOVERSEYES|HEADCOVERSMOUTH|BLOCKHAIR
flags = HEADCOVERSMOUTH|BLOCKHAIR
armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 100, rad = 20)
flags_inv = HIDEMASK|HIDEEARS|HIDEEYES
body_parts_covered = HEAD|FACE|EYES

View File

@@ -47,7 +47,7 @@
name = "bomb hood"
desc = "Use in case of bomb."
icon_state = "bombsuit"
flags = HEADCOVERSEYES|HEADCOVERSMOUTH|BLOCKHAIR
flags = HEADCOVERSMOUTH|BLOCKHAIR
armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 100, bio = 0, rad = 0)
flags_inv = HIDEMASK|HIDEEARS|HIDEEYES
body_parts_covered = HEAD|FACE|EYES
@@ -86,7 +86,7 @@
name = "Radiation Hood"
icon_state = "rad"
desc = "A hood with radiation protective properties. Label: Made with lead, do not eat insulation"
flags = HEADCOVERSEYES|HEADCOVERSMOUTH|BLOCKHAIR
flags = HEADCOVERSMOUTH|BLOCKHAIR
body_parts_covered = HEAD|FACE|EYES
armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 60, rad = 100)

View File

@@ -328,17 +328,16 @@ This saves us from having to call add_fingerprint() any time something is put in
switch(slot)
if(slot_wear_mask)
covering = src.head
check_flags = HEADCOVERSMOUTH
check_flags = FACE
if(slot_glasses)
covering = src.head
check_flags = HEADCOVERSEYES
check_flags = EYES
if(slot_gloves, slot_w_uniform)
covering = src.wear_suit
if(covering)
if((covering.body_parts_covered & I.body_parts_covered) || (covering.flags & check_flags))
user << "<span class='warning'>\The [covering] is in the way.</span>"
return 0
if(covering && (covering.body_parts_covered & (I.body_parts_covered|check_flags)))
user << "<span class='warning'>\The [covering] is in the way.</span>"
return 0
return 1
/mob/living/carbon/human/get_equipped_item(var/slot)

View File

@@ -15,7 +15,7 @@ var/const/MAX_ACTIVE_TIME = 400
icon_state = "facehugger"
item_state = "facehugger"
w_class = 3 //note: can be picked up by aliens unlike most other items of w_class below 4
flags = MASKCOVERSMOUTH | MASKCOVERSEYES | AIRTIGHT | PROXMOVE
flags = MASKCOVERSMOUTH | AIRTIGHT | PROXMOVE
body_parts_covered = FACE|EYES
throw_range = 5

View File

@@ -359,11 +359,11 @@
if(state < GRAB_NECK)
assailant << "<span class='warning'>You require a better grab to do this.</span>"
return
if((affecting:head && affecting:head.flags & HEADCOVERSEYES) || \
(affecting:wear_mask && affecting:wear_mask.flags & MASKCOVERSEYES) || \
(affecting:glasses && affecting:glasses.flags & GLASSESCOVERSEYES))
assailant << "<span class='danger'>You're going to need to remove the eye covering first.</span>"
return
for(var/slot in list(slot_wear_mask, slot_head, slot_glasses))
var/obj/item/protection = affecting.get_equipped_item(slot)
if(istype(protection) && (protection.body_parts_covered & EYES))
assailant << "<span class='danger'>You're going to need to remove the eye covering first.</span>"
return
if(!affecting.has_eyes())
assailant << "<span class='danger'>You cannot locate any eyes on [affecting]!</span>"
return

View File

@@ -271,20 +271,20 @@
if(H.species && (H.species.flags & NO_PAIN))
return
if(H.head)
if(H.head.flags & MASKCOVERSEYES)
if(H.head.body_parts_covered & EYES)
eyes_covered = 1
safe_thing = H.head
if(H.head.flags & MASKCOVERSMOUTH)
mouth_covered = 1
safe_thing = H.head
if(H.wear_mask)
if(!eyes_covered && H.wear_mask.flags & MASKCOVERSEYES)
if(!eyes_covered && H.wear_mask.body_parts_covered & EYES)
eyes_covered = 1
safe_thing = H.wear_mask
if(!mouth_covered && H.wear_mask.flags & MASKCOVERSMOUTH)
mouth_covered = 1
safe_thing = H.wear_mask
if(H.glasses)
if(H.glasses && H.glasses.body_parts_covered & EYES)
if(!eyes_covered)
eyes_covered = 1
if(!safe_thing)

View File

@@ -40,10 +40,10 @@
var/obj/item/safe_thing = null
if(victim.wear_mask)
if (victim.wear_mask.flags & MASKCOVERSEYES)
if (victim.wear_mask.body_parts_covered & EYES)
safe_thing = victim.wear_mask
if(victim.head)
if (victim.head.flags & MASKCOVERSEYES)
if (victim.head.body_parts_covered & EYES)
safe_thing = victim.head
if(victim.glasses)
if (!safe_thing)