Merge pull request #10101 from mwerezak/shards

Refactors obj flags and changes defined bitflag representation
This commit is contained in:
Chinsky
2015-08-20 19:47:58 +03:00
94 changed files with 1593 additions and 582 deletions
+2 -2
View File
@@ -32,7 +32,7 @@
if(internal)
if (!contents.Find(internal))
internal = null
if (!(wear_mask && (wear_mask.flags & AIRTIGHT)))
if (!(wear_mask && (wear_mask.item_flags & AIRTIGHT)))
internal = null
if(internal)
if (internals)
@@ -65,7 +65,7 @@
//Handle possble chem smoke effect
/mob/living/carbon/proc/handle_chemical_smoke(var/datum/gas_mixture/environment)
if(wear_mask && (wear_mask.flags & BLOCK_GAS_SMOKE_EFFECT))
if(wear_mask && (wear_mask.item_flags & BLOCK_GAS_SMOKE_EFFECT))
return
for(var/obj/effect/effect/smoke/chem/smoke in view(1, src))
@@ -110,7 +110,7 @@
return 1
/mob/living/carbon/human/proc/change_skin_color(var/red, var/green, var/blue)
if(red == r_skin && green == g_skin && blue == b_skin || !(species.flags & HAS_SKIN_COLOR))
if(red == r_skin && green == g_skin && blue == b_skin || !(species.appearance_flags & HAS_SKIN_COLOR))
return
r_skin = red
@@ -122,7 +122,7 @@
return 1
/mob/living/carbon/human/proc/change_skin_tone(var/tone)
if(s_tone == tone || !(species.flags & HAS_SKIN_TONE))
if(s_tone == tone || !(species.appearance_flags & HAS_SKIN_TONE))
return
s_tone = tone
@@ -141,13 +141,13 @@
var/datum/species/current_species = all_species[current_species_name]
if(check_whitelist && config.usealienwhitelist && !check_rights(R_ADMIN, 0, src)) //If we're using the whitelist, make sure to check it!
if(!(current_species.flags & CAN_JOIN))
if(!(current_species.spawn_flags & CAN_JOIN))
continue
if(whitelist.len && !(current_species_name in whitelist))
continue
if(blacklist.len && (current_species_name in blacklist))
continue
if((current_species.flags & IS_WHITELISTED) && !is_alien_whitelisted(src, current_species_name))
if((current_species.spawn_flags & IS_WHITELISTED) && !is_alien_whitelisted(src, current_species_name))
continue
valid_species += current_species_name
@@ -1225,10 +1225,10 @@
else
switch(target_zone)
if("head")
if(head && head.flags & THICKMATERIAL)
if(head && head.item_flags & THICKMATERIAL)
. = 0
else
if(wear_suit && wear_suit.flags & THICKMATERIAL)
if(wear_suit && wear_suit.item_flags & THICKMATERIAL)
. = 0
if(!. && error_msg && user)
if(!fail_msg)
@@ -1301,7 +1301,7 @@
return 0
/mob/living/carbon/human/slip(var/slipped_on, stun_duration=8)
if((species.flags & NO_SLIP) || (shoes && (shoes.flags & NOSLIP)))
if((species.flags & NO_SLIP) || (shoes && (shoes.item_flags & NOSLIP)))
return 0
..(slipped_on,stun_duration)
@@ -1369,6 +1369,6 @@
handle_regular_hud_updates()
/mob/living/carbon/human/Check_Shoegrip()
if(istype(shoes, /obj/item/clothing/shoes/magboots) && (shoes.flags & NOSLIP)) //magboots + dense_object = no floating
if(istype(shoes, /obj/item/clothing/shoes/magboots) && (shoes.item_flags & NOSLIP)) //magboots + dense_object = no floating
return 1
return 0
@@ -60,10 +60,10 @@
if(!check_has_mouth())
H << "<span class='danger'>They don't have a mouth, you cannot perform CPR!</span>"
return
if((H.head && (H.head.flags & HEADCOVERSMOUTH)) || (H.wear_mask && (H.wear_mask.flags & MASKCOVERSMOUTH)))
if((H.head && (H.head.body_parts_covered & FACE)) || (H.wear_mask && (H.wear_mask.body_parts_covered & FACE)))
H << "<span class='notice'>Remove your mask!</span>"
return 0
if((head && (head.flags & HEADCOVERSMOUTH)) || (wear_mask && (wear_mask.flags & MASKCOVERSMOUTH)))
if((head && (head.body_parts_covered & FACE)) || (wear_mask && (wear_mask.body_parts_covered & FACE)))
H << "<span class='notice'>Remove [src]'s mask!</span>"
return 0
@@ -144,7 +144,7 @@ emp_act
/mob/living/carbon/human/proc/check_mouth_coverage()
var/list/protective_gear = list(head, wear_mask, wear_suit, w_uniform)
for(var/obj/item/gear in protective_gear)
if(istype(gear) && (gear.body_parts_covered & FACE) && (gear.flags & (MASKCOVERSMOUTH|HEADCOVERSMOUTH)))
if(istype(gear) && (gear.body_parts_covered & FACE) && !(gear.item_flags & FLEXIBLEMATERIAL))
return gear
return null
@@ -97,7 +97,7 @@
prob_slip = 0 // Changing this to zero to make it line up with the comment, and also, make more sense.
//Do we have magboots or such on if so no slip
if(istype(shoes, /obj/item/clothing/shoes/magboots) && (shoes.flags & NOSLIP))
if(istype(shoes, /obj/item/clothing/shoes/magboots) && (shoes.item_flags & NOSLIP))
prob_slip = 0
//Check hands and mod slip
@@ -116,19 +116,12 @@ This saves us from having to call add_fingerprint() any time something is put in
update_inv_glasses()
else if (W == head)
head = null
var/update_hair = 0
if((W.flags & BLOCKHAIR) || (W.flags & BLOCKHEADHAIR))
update_hair = 1
else if(istype(W, /obj/item))
if(istype(W, /obj/item))
var/obj/item/I = W
if(I.flags_inv & HIDEMASK)
update_hair = 1
if(update_hair)
update_hair(0) //rebuild hair
update_inv_ears(0)
update_inv_wear_mask(0)
if(I.flags_inv & (HIDEMASK|BLOCKHAIR|BLOCKHEADHAIR))
update_hair(0) //rebuild hair
update_inv_ears(0)
update_inv_wear_mask(0)
update_inv_head()
else if (W == l_ear)
l_ear = null
@@ -144,9 +137,11 @@ This saves us from having to call add_fingerprint() any time something is put in
update_inv_belt()
else if (W == wear_mask)
wear_mask = null
if((W.flags & BLOCKHAIR) || (W.flags & BLOCKHEADHAIR))
update_hair(0) //rebuild hair
update_inv_ears(0)
if(istype(W, /obj/item))
var/obj/item/I = W
if(I.flags_inv & (BLOCKHAIR|BLOCKHEADHAIR))
update_hair(0) //rebuild hair
update_inv_ears(0)
if(internal)
if(internals)
internals.icon_state = "internal0"
@@ -205,7 +200,7 @@ This saves us from having to call add_fingerprint() any time something is put in
update_inv_back(redraw_mob)
if(slot_wear_mask)
src.wear_mask = W
if((wear_mask.flags & BLOCKHAIR) || (wear_mask.flags & BLOCKHEADHAIR))
if(wear_mask.flags_inv & (BLOCKHAIR|BLOCKHEADHAIR))
update_hair(redraw_mob) //rebuild hair
update_inv_ears(0)
W.equipped(src, slot)
@@ -261,7 +256,7 @@ This saves us from having to call add_fingerprint() any time something is put in
update_inv_gloves(redraw_mob)
if(slot_head)
src.head = W
if((head.flags & BLOCKHAIR) || (head.flags & BLOCKHEADHAIR) || (head.flags_inv & HIDEMASK))
if(head.flags_inv & (BLOCKHAIR|BLOCKHEADHAIR|HIDEMASK))
update_hair(redraw_mob) //rebuild hair
update_inv_ears(0)
update_inv_wear_mask(0)
@@ -328,17 +323,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)
+5 -5
View File
@@ -108,7 +108,7 @@
var/pressure_adjustment_coefficient = 1 // Assume no protection at first.
if(wear_suit && (wear_suit.flags & STOPPRESSUREDAMAGE) && head && (head.flags & STOPPRESSUREDAMAGE)) // Complete set of pressure-proof suit worn, assume fully sealed.
if(wear_suit && (wear_suit.item_flags & STOPPRESSUREDAMAGE) && head && (head.item_flags & STOPPRESSUREDAMAGE)) // Complete set of pressure-proof suit worn, assume fully sealed.
pressure_adjustment_coefficient = 0
// Handles breaches in your space suit. 10 suit damage equals a 100% loss of pressure protection.
@@ -303,11 +303,11 @@
/** breathing **/
/mob/living/carbon/human/handle_chemical_smoke(var/datum/gas_mixture/environment)
if(wear_mask && (wear_mask.flags & BLOCK_GAS_SMOKE_EFFECT))
if(wear_mask && (wear_mask.item_flags & BLOCK_GAS_SMOKE_EFFECT))
return
if(glasses && (glasses.flags & BLOCK_GAS_SMOKE_EFFECT))
if(glasses && (glasses.item_flags & BLOCK_GAS_SMOKE_EFFECT))
return
if(head && (head.flags & BLOCK_GAS_SMOKE_EFFECT))
if(head && (head.item_flags & BLOCK_GAS_SMOKE_EFFECT))
return
..()
@@ -328,7 +328,7 @@
if(!rig.offline && (rig.air_supply && internal == rig.air_supply))
rig_supply = rig.air_supply
if (!rig_supply && (!contents.Find(internal) || !((wear_mask && (wear_mask.flags & AIRTIGHT)) || (head && (head.flags & AIRTIGHT)))))
if (!rig_supply && (!contents.Find(internal) || !((wear_mask && (wear_mask.item_flags & AIRTIGHT)) || (head && (head.item_flags & AIRTIGHT)))))
internal = null
if(internal)
@@ -18,7 +18,8 @@
remains_type = /obj/effect/decal/cleanable/ash
death_message = "dissolves into ash..."
flags = IS_RESTRICTED | NO_BLOOD | NO_SCAN | NO_SLIP | NO_POISON
flags = NO_BLOOD | NO_SCAN | NO_SLIP | NO_POISON | NO_MINOR_CUT
spawn_flags = IS_RESTRICTED
/datum/species/shadow/handle_death(var/mob/living/carbon/human/H)
spawn(1)
@@ -31,7 +31,9 @@
poison_type = "oxygen"
siemens_coefficient = 0.2
flags = CAN_JOIN | IS_WHITELISTED | NO_SCAN | HAS_EYE_COLOR
flags = NO_SCAN | NO_MINOR_CUT
spawn_flags = CAN_JOIN | IS_WHITELISTED
appearance_flags = HAS_EYE_COLOR
blood_color = "#2299FC"
flesh_color = "#808D11"
@@ -103,6 +103,8 @@
var/siemens_coefficient = 1 // The lower, the thicker the skin and better the insulation.
var/darksight = 2 // Native darksight distance.
var/flags = 0 // Various specific features.
var/appearance_flags = 0 // Appearance/display related features.
var/spawn_flags = 0 // Flags that specify who can spawn as this species
var/slowdown = 0 // Passive movement speed malus (or boost, if negative)
var/primitive_form // Lesser form, if any (ie. monkey for humans)
var/greater_form // Greater form, if any, ie. human for monkeys.
@@ -7,7 +7,8 @@
language = "Sol Common" //todo?
unarmed_types = list(/datum/unarmed_attack/stomp, /datum/unarmed_attack/kick, /datum/unarmed_attack/punch)
flags = IS_RESTRICTED | NO_BREATHE | NO_PAIN | NO_BLOOD | NO_SCAN | NO_POISON
flags = NO_BREATHE | NO_PAIN | NO_BLOOD | NO_SCAN | NO_POISON | NO_MINOR_CUT
spawn_flags = IS_RESTRICTED
siemens_coefficient = 0
breath_type = null
@@ -32,7 +32,7 @@
brute_mod = 1.5
burn_mod = 1.5
flags = IS_RESTRICTED
spawn_flags = IS_RESTRICTED
bump_flag = MONKEY
swap_flags = MONKEY|SLIME|SIMPLE_ANIMAL
@@ -6,10 +6,11 @@
icobase = 'icons/mob/human_races/r_slime.dmi'
deform = 'icons/mob/human_races/r_slime.dmi'
language = "Sol Common" //todo?
language = null //todo?
unarmed_types = list(/datum/unarmed_attack/slime_glomp)
flags = IS_RESTRICTED | NO_SCAN | NO_SLIP | NO_BREATHE
siemens_coefficient = 3
flags = NO_SCAN | NO_SLIP | NO_BREATHE | NO_MINOR_CUT
spawn_flags = IS_RESTRICTED
siemens_coefficient = 3 //conductive
darksight = 3
blood_color = "#05FF9B"
@@ -11,7 +11,8 @@
num_alternate_languages = 2
secondary_langs = list("Sol Common")
flags = CAN_JOIN | HAS_SKIN_TONE | HAS_LIPS | HAS_UNDERWEAR | HAS_EYE_COLOR
spawn_flags = CAN_JOIN
appearance_flags = HAS_SKIN_TONE | HAS_LIPS | HAS_UNDERWEAR | HAS_EYE_COLOR
/datum/species/unathi
name = "Unathi"
@@ -41,7 +42,8 @@
heat_level_2 = 480 //Default 400
heat_level_3 = 1100 //Default 1000
flags = CAN_JOIN | IS_WHITELISTED | HAS_LIPS | HAS_UNDERWEAR | HAS_SKIN_COLOR | HAS_EYE_COLOR
spawn_flags = CAN_JOIN | IS_WHITELISTED
appearance_flags = HAS_LIPS | HAS_UNDERWEAR | HAS_SKIN_COLOR | HAS_EYE_COLOR
flesh_color = "#34AF10"
@@ -96,7 +98,8 @@
primitive_form = "Farwa"
flags = CAN_JOIN | IS_WHITELISTED | HAS_LIPS | HAS_UNDERWEAR | HAS_SKIN_COLOR | HAS_EYE_COLOR
spawn_flags = CAN_JOIN | IS_WHITELISTED
appearance_flags = HAS_LIPS | HAS_UNDERWEAR | HAS_SKIN_COLOR | HAS_EYE_COLOR
flesh_color = "#AFA59E"
base_color = "#333333"
@@ -129,7 +132,8 @@
num_alternate_languages = 2
secondary_langs = list("Skrellian")
flags = CAN_JOIN | IS_WHITELISTED | HAS_LIPS | HAS_UNDERWEAR | HAS_SKIN_COLOR
spawn_flags = CAN_JOIN | IS_WHITELISTED
appearance_flags = HAS_LIPS | HAS_UNDERWEAR | HAS_SKIN_COLOR
flesh_color = "#8CD7A3"
blood_color = "#1D2CBF"
@@ -202,7 +206,8 @@
body_temperature = T0C + 15 //make the plant people have a bit lower body temperature, why not
flags = CAN_JOIN | IS_WHITELISTED | NO_BREATHE | NO_SCAN | IS_PLANT | NO_BLOOD | NO_PAIN | NO_SLIP
flags = NO_BREATHE | NO_SCAN | IS_PLANT | NO_BLOOD | NO_PAIN | NO_SLIP | NO_MINOR_CUT
spawn_flags = CAN_JOIN | IS_WHITELISTED
blood_color = "#004400"
flesh_color = "#907E4A"
@@ -276,7 +281,8 @@
passive_temp_gain = 10 // This should cause IPCs to stabilize at ~80 C in a 20 C environment.
flags = CAN_JOIN | IS_WHITELISTED | NO_BREATHE | NO_SCAN | NO_BLOOD | NO_PAIN | NO_POISON
flags = NO_BREATHE | NO_SCAN | NO_BLOOD | NO_PAIN | NO_POISON
spawn_flags = CAN_JOIN | IS_WHITELISTED
blood_color = "#1F181F"
flesh_color = "#575757"
@@ -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 = PROXMOVE
body_parts_covered = FACE|EYES
throw_range = 5
@@ -126,15 +126,6 @@ var/const/MAX_ACTIVE_TIME = 400
L.visible_message("\red \b [src] leaps at [L]'s face!")
/* Tentatively removed since huggers can't be thrown anymore
if(ishuman(L))
var/mob/living/carbon/human/H = L
if(H.head && H.head.flags & HEADCOVERSMOUTH)
H.visible_message("\red \b [src] smashes against [H]'s [H.head]!")
Die()
return
*/
if(iscarbon(M))
var/mob/living/carbon/target = L
@@ -235,6 +226,6 @@ var/const/MAX_ACTIVE_TIME = 400
if(ishuman(C))
var/mob/living/carbon/human/H = C
if(H.head && H.head.flags & HEADCOVERSMOUTH)
if(H.head && (H.head.body_parts_covered & FACE) && !(H.head.item_flags & FLEXIBLEMATERIAL))
return 0
return 1
@@ -25,7 +25,8 @@
cold_level_2 = -1
cold_level_3 = -1
flags = IS_RESTRICTED | NO_BREATHE | NO_SCAN | NO_PAIN | NO_SLIP | NO_POISON
flags = NO_BREATHE | NO_SCAN | NO_PAIN | NO_SLIP | NO_POISON | NO_MINOR_CUT
spawn_flags = IS_RESTRICTED
reagent_tag = IS_XENOS
@@ -325,10 +325,10 @@ var/global/list/damage_icon_parts = list()
stand_icon.Blend(base_icon,ICON_OVERLAY)
//Underwear
if(underwear && species.flags & HAS_UNDERWEAR)
if(underwear && species.appearance_flags & HAS_UNDERWEAR)
stand_icon.Blend(new /icon('icons/mob/human.dmi', underwear), ICON_OVERLAY)
if(undershirt && species.flags & HAS_UNDERWEAR)
if(undershirt && species.appearance_flags & HAS_UNDERWEAR)
stand_icon.Blend(new /icon('icons/mob/human.dmi', undershirt), ICON_OVERLAY)
if(update_icons)
@@ -348,7 +348,7 @@ var/global/list/damage_icon_parts = list()
return
//masks and helmets can obscure our hair.
if( (head && (head.flags & BLOCKHAIR)) || (wear_mask && (wear_mask.flags & BLOCKHAIR)))
if( (head && (head.flags_inv & BLOCKHAIR)) || (wear_mask && (wear_mask.flags_inv & BLOCKHAIR)))
if(update_icons) update_icons()
return
@@ -364,7 +364,7 @@ var/global/list/damage_icon_parts = list()
face_standing.Blend(facial_s, ICON_OVERLAY)
if(h_style && !(head && (head.flags & BLOCKHEADHAIR)))
if(h_style && !(head && (head.flags_inv & BLOCKHEADHAIR)))
var/datum/sprite_accessory/hair_style = hair_styles_list[h_style]
if(hair_style && src.species.name in hair_style.species_allowed)
var/icon/hair_s = new/icon("icon" = hair_style.icon, "icon_state" = "[hair_style.icon_state]_s")
@@ -573,7 +573,7 @@ var/global/list/damage_icon_parts = list()
/mob/living/carbon/human/update_inv_ears(var/update_icons=1)
overlays_standing[EARS_LAYER] = null
if( (head && (head.flags & (BLOCKHAIR | BLOCKHEADHAIR))) || (wear_mask && (wear_mask.flags & (BLOCKHAIR | BLOCKHEADHAIR))))
if( (head && (head.flags_inv & (BLOCKHAIR | BLOCKHEADHAIR))) || (wear_mask && (wear_mask.flags_inv & (BLOCKHAIR | BLOCKHEADHAIR))))
if(update_icons) update_icons()
return
+1 -1
View File
@@ -346,7 +346,7 @@
var/damage_mod = 1
//presumably, if they are wearing a helmet that stops pressure effects, then it probably covers the throat as well
var/obj/item/clothing/head/helmet = get_equipped_item(slot_head)
if(istype(helmet) && (helmet.body_parts_covered & HEAD) && (helmet.flags & STOPPRESSUREDAMAGE))
if(istype(helmet) && (helmet.body_parts_covered & HEAD) && (helmet.item_flags & STOPPRESSUREDAMAGE))
//we don't do an armor_check here because this is not an impact effect like a weapon swung with momentum, that either penetrates or glances off.
damage_mod = 1.0 - (helmet.armor["melee"]/100)
+5 -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
+4 -4
View File
@@ -459,8 +459,8 @@
if(!Check_Dense_Object()) //Nothing to push off of so end here
update_floating(0)
return 0
update_floating(1)
update_floating(1)
if(restrained()) //Check to see if we can do things
return 0
@@ -486,10 +486,10 @@
if(istype(turf,/turf/simulated/floor)) // Floors don't count if they don't have gravity
var/area/A = turf.loc
if(istype(A) && A.has_gravity == 0)
if(istype(A) && A.has_gravity == 0)
if(shoegrip == null)
shoegrip = Check_Shoegrip() //Shoegrip is only ever checked when a zero-gravity floor is encountered to reduce load
if(!shoegrip)
if(!shoegrip)
continue
dense_object++
+3 -3
View File
@@ -149,7 +149,7 @@
return 0
var/datum/species/S = all_species[client.prefs.species]
if(!(S.flags & IS_WHITELISTED))
if(!(S.spawn_flags & IS_WHITELISTED))
src << alert("Your current species,[client.prefs.species], is not available for play on the station.")
return 0
@@ -173,7 +173,7 @@
return 0
var/datum/species/S = all_species[client.prefs.species]
if(!(S.flags & CAN_JOIN))
if(!(S.spawn_flags & CAN_JOIN))
src << alert("Your current species, [client.prefs.species], is not available for play on the station.")
return 0
@@ -487,7 +487,7 @@
proc/is_species_whitelisted(datum/species/S)
if(!S) return 1
return is_alien_whitelisted(src, S.name) || !config.usealienwhitelist || !(S.flags & IS_WHITELISTED)
return is_alien_whitelisted(src, S.name) || !config.usealienwhitelist || !(S.spawn_flags & IS_WHITELISTED)
/mob/new_player/get_species()
var/datum/species/chosen_species