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
@@ -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
-1
View File
@@ -344,7 +344,6 @@
item_state = "sword0"
var/active = 0.0
w_class = 2.0
flags = NOSHIELD
attack_verb = list("attacked", "struck", "hit")
attack_self(mob/user as mob)
@@ -61,7 +61,6 @@
throw_speed = 1
throw_range = 3
w_class = 4
flags = NOSHIELD
slot_flags = SLOT_BACK
origin_tech = "materials=2;combat=2"
attack_verb = list("chopped", "sliced", "cut", "reaped")
@@ -61,8 +61,14 @@
return ..()
/obj/item/weapon/material/shard/Crossed(AM as mob|obj)
..()
if(ismob(AM))
var/mob/M = AM
if(M.buckled) //wheelchairs, office chairs, rollerbeds
return
M << "<span class='danger'>You step on \the [src]!</span>"
playsound(src.loc, 'sound/effects/glass_step.ogg', 50, 1) // not sure how to handle metal shards with sounds
if(ishuman(M))
@@ -71,18 +77,24 @@
if(H.species.siemens_coefficient<0.5) //Thick skin.
return
if( !H.shoes && ( !H.wear_suit || !(H.wear_suit.body_parts_covered & FEET) ) )
var/obj/item/organ/external/affecting = H.get_organ(pick("l_foot", "r_foot"))
if(!affecting)
if( H.shoes || ( H.wear_suit && (H.wear_suit.body_parts_covered & FEET) ) )
return
var/list/check = list("l_foot", "r_foot")
while(check.len)
var/picked = pick(check)
var/obj/item/organ/external/affecting = H.get_organ(picked)
if(affecting)
if(affecting.status & ORGAN_ROBOT)
return
if(affecting.take_damage(5, 0))
H.UpdateDamageIcon()
H.updatehealth()
if(!(H.species.flags & NO_PAIN))
H.Weaken(3)
return
if(affecting.status & ORGAN_ROBOT)
return
if(affecting.take_damage(5, 0))
H.UpdateDamageIcon()
H.updatehealth()
if(!(H.species && (H.species.flags & NO_PAIN)))
H.Weaken(3)
..()
check -= picked
return
// Preset types - left here for the code that uses them
/obj/item/weapon/material/shard/shrapnel/New(loc)
@@ -187,7 +187,6 @@
force_wielded = 30
wieldsound = 'sound/weapons/saberon.ogg'
unwieldsound = 'sound/weapons/saberoff.ogg'
flags = NOSHIELD
origin_tech = list(TECH_MAGNET = 3, TECH_ILLEGAL = 4)
attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")
sharp = 1
@@ -228,7 +227,6 @@
throw_speed = 3
edge = 1
sharp = 1
flags = NOSHIELD
hitsound = 'sound/weapons/bladeslice.ogg'
attack_verb = list("attacked", "poked", "jabbed", "torn", "gored")
default_material = "glass"
@@ -74,7 +74,7 @@
throw_speed = 1
throw_range = 5
w_class = 3
flags = CONDUCT | NOSHIELD | NOBLOODY
flags = CONDUCT | NOBLOODY
origin_tech = list(TECH_MAGNET = 3, TECH_COMBAT = 4)
attack_verb = list("attacked", "chopped", "cleaved", "torn", "cut")
sharp = 1
@@ -110,7 +110,7 @@
throw_speed = 1
throw_range = 5
w_class = 2
flags = NOSHIELD | NOBLOODY
flags = NOBLOODY
origin_tech = list(TECH_MAGNET = 3, TECH_ILLEGAL = 4)
sharp = 1
edge = 1
@@ -181,7 +181,7 @@
throw_speed = 1
throw_range = 1
w_class = 4.0//So you can't hide it in your pocket or some such.
flags = NOSHIELD | NOBLOODY
flags = NOBLOODY
attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")
var/mob/living/creator
var/datum/effect/effect/system/spark_spread/spark_system
@@ -144,11 +144,11 @@
mask_check = 1
if(mask_check)
if(location.wear_mask && (location.wear_mask.flags & AIRTIGHT))
if(location.wear_mask && (location.wear_mask.item_flags & AIRTIGHT))
data["maskConnected"] = 1
else if(istype(location, /mob/living/carbon/human))
var/mob/living/carbon/human/H = location
if(H.head && (H.head.flags & AIRTIGHT))
if(H.head && (H.head.item_flags & AIRTIGHT))
data["maskConnected"] = 1
// update the ui if it exists, returns null if no ui is passed/found
@@ -192,11 +192,11 @@
else
var/can_open_valve
if(location.wear_mask && (location.wear_mask.flags & AIRTIGHT))
if(location.wear_mask && (location.wear_mask.item_flags & AIRTIGHT))
can_open_valve = 1
else if(istype(location,/mob/living/carbon/human))
var/mob/living/carbon/human/H = location
if(H.head && (H.head.flags & AIRTIGHT))
if(H.head && (H.head.item_flags & AIRTIGHT))
can_open_valve = 1
if(can_open_valve)
+8 -1
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)