Remove SpeciesCanConsume() proc, replaced by iscarbon checks.

Remove alloweat var from masks, remove MASKCOVERSMOUTH flag from mime and clown masks so you can still eat through them.

Some adjustments in surgery checks for bodyparts covered.
Fixes a runtime in weapon/energy attack_verb.

Humans can now CPR monkeys.
Slight changes to CPR code.
Fixes runtime with drones trying to do CPR.

Rewrites /obj/item/weapon/reagent_containers/proc/canconsume to be less shitty.

Adds an is_mouth_covered() proc to carbons to check for mask and headgear with MASKCOVERSMOUTH or HEADCOVERSMOUTH, with argument to restrict the check to only mask or only head.
This commit is contained in:
phil235
2015-04-11 22:16:42 +02:00
parent 6996897b65
commit 5f169e8e47
15 changed files with 74 additions and 76 deletions
@@ -138,9 +138,6 @@
/mob/living/carbon/alien/IsAdvancedToolUser()
return has_fine_manipulation
/mob/living/carbon/alien/SpeciesCanConsume()
return 1 // Aliens can eat, and they can be fed food/drink
/mob/living/carbon/alien/Stat()
..()
@@ -123,7 +123,7 @@ var/const/MAX_ACTIVE_TIME = 400
if(ishuman(L))
var/mob/living/carbon/human/H = L
if(H.head && H.head.flags & HEADCOVERSMOUTH)
if(H.is_mouth_covered(head_only = 1))
H.visible_message("<span class='danger'>[src] smashes against [H]'s [H.head]!</span>", \
"<span class='userdanger'>[src] smashes against [H]'s [H.head]!</span>")
Die()
@@ -239,7 +239,7 @@ var/const/MAX_ACTIVE_TIME = 400
var/mob/living/carbon/C = M
if(ishuman(C))
var/mob/living/carbon/human/H = C
if(H.head && H.head.flags & HEADCOVERSMOUTH)
if(H.is_mouth_covered(head_only = 1))
return 0
return 1
return 0
+4
View File
@@ -490,3 +490,7 @@ var/const/GALOSHES_DONT_HELP = 8
update_inv_legcuffed(0)
else
src << "<span class='warning'>You fail to break [I]!</span>"
/mob/living/carbon/proc/is_mouth_covered(head_only = 0, mask_only = 0)
if( (!mask_only && head && (head.flags & HEADCOVERSMOUTH)) || (!head_only && wear_mask && (wear_mask.flags & MASKCOVERSMOUTH)) )
return 1
+28 -1
View File
@@ -671,7 +671,6 @@
..()
/mob/living/carbon/human/help_shake_act(mob/living/carbon/M)
if(!istype(M))
return
@@ -730,6 +729,34 @@
..()
/mob/living/carbon/human/proc/do_cpr(mob/living/carbon/C)
if(C.stat == DEAD)
src << "<span class='warning'>[C.name] is dead!</span>"
return
if(is_mouth_covered())
src << "<span class='notice'>Remove your mask!</span>"
return 0
if(C.is_mouth_covered())
src << "<span class='notice'>Remove their mask!</span>"
return 0
if(C.cpr_time < world.time + 30)
add_logs(src, C, "CPRed")
visible_message("<span class='notice'>[src] is trying to perform CPR on [C.name]!</span>", \
"<span class='notice'>You try to perform CPR on [C.name]. Hold still!</span>")
if(!do_mob(src, C))
src << "<span class='warning'>You fail to perform CPR on [C]!</span>"
return 0
if(C.health <= config.health_threshold_crit)
C.cpr_time = world.time
var/suff = min(C.getOxyLoss(), 7)
C.adjustOxyLoss(-suff)
C.updatehealth()
visible_message("<span class='notice'>[src] performs CPR on [C.name]!</span>")
C << "<span class='unconscious'>You feel a breath of fresh air enter your lungs. It feels good.</span>"
/mob/living/carbon/human/generateStaticOverlay()
var/image/staticOverlay = image(icon('icons/effects/effects.dmi', "static"), loc = src)
staticOverlay.override = 1
@@ -125,9 +125,6 @@
/mob/living/carbon/human/IsAdvancedToolUser()
return 1//Humans can use guns and such
/mob/living/carbon/human/SpeciesCanConsume()
return 1 // Humans can eat, drink, and be forced to do so
/mob/living/carbon/human/InCritical()
return (health <= config.health_threshold_crit && stat == UNCONSCIOUS)
@@ -703,6 +703,8 @@
//////////////////
/datum/species/proc/spec_attack_hand(var/mob/living/carbon/human/M, var/mob/living/carbon/human/H)
if(!istype(M)) //sanity check for drones.
return
if((M != H) && H.check_shields(0, M.name))
add_logs(M, H, "attempted to touch")
H.visible_message("<span class='warning'>[M] attempted to touch [H]!</span>")
@@ -715,29 +717,8 @@
if(H != M)
add_logs(M, H, "shaked")
return 1
//CPR
if((M.head && (M.head.flags & HEADCOVERSMOUTH)) || (M.wear_mask && (M.wear_mask.flags & MASKCOVERSMOUTH)))
M << "<span class='notice'>Remove your mask!</span>"
return 0
if((H.head && (H.head.flags & HEADCOVERSMOUTH)) || (H.wear_mask && (H.wear_mask.flags & MASKCOVERSMOUTH)))
M << "<span class='notice'>Remove their mask!</span>"
return 0
if(H.cpr_time < world.time + 30)
add_logs(M, H, "CPRed")
M.visible_message("<span class='notice'>[M] is trying to perform CPR on [H]!</span>", \
"<span class='notice'>You try to perform CPR on [H]. Hold still!</span>")
if(!do_mob(M, H))
M << "<span class='warning'>You fail to perform CPR on [H]!</span>"
return 0
if((H.health >= -99 && H.health <= 0))
H.cpr_time = world.time
var/suff = min(H.getOxyLoss(), 7)
H.adjustOxyLoss(-suff)
H.updatehealth()
M.visible_message("[M] performs CPR on [H]!")
H << "<span class='unconscious'>You feel a breath of fresh air enter your lungs. It feels good.</span>"
else
M.do_cpr(H)
if("grab")
H.grabbedby(M)
@@ -241,10 +241,6 @@
return threatcount
/mob/living/carbon/monkey/SpeciesCanConsume()
return 1 // Monkeys can eat, drink, and be forced to do so
/mob/living/carbon/monkey/acid_act(var/acidpwr, var/toxpwr, var/acid_volume)
if(wear_mask)
if(!wear_mask.unacidable)
@@ -255,3 +251,10 @@
return
take_organ_damage(min(6*toxpwr, acid_volume * toxpwr))
/mob/living/carbon/monkey/help_shake_act(mob/living/carbon/M)
if(health < 0 && ishuman(M))
var/mob/living/carbon/human/H = M
H.do_cpr(src)
else
..()
-3
View File
@@ -838,9 +838,6 @@ var/list/slot_equipment_priority = list( \
/mob/proc/activate_hand(var/selhand)
return
/mob/proc/SpeciesCanConsume()
return 0
/mob/proc/Jitter(amount)
jitteriness = max(jitteriness,amount,0)