Merge pull request #17941 from Cheridan/cleaning_vomit

Ends Flyman Starvation
This commit is contained in:
Joan Lung
2016-05-27 16:14:03 -04:00
3 changed files with 39 additions and 44 deletions

View File

@@ -535,23 +535,27 @@
add_abilities_to_panel()
/mob/living/carbon/proc/vomit(var/lost_nutrition = 10, var/blood = 0, var/stun = 1, var/distance = 0, var/message = 1)
if(src.is_muzzled())
if(message)
src << "<span class='warning'>The muzzle prevents you from vomiting!</span>"
return 0
if(stun)
Stun(4)
/mob/living/carbon/proc/vomit(var/lost_nutrition = 10, var/blood = 0, var/stun = 1, var/distance = 0, var/message = 1, var/toxic = 0)
if(nutrition < 100 && !blood)
if(message)
visible_message("<span class='warning'>[src] dry heaves!</span>", \
"<span class='userdanger'>You try to throw up, but there's nothing your stomach!</span>")
if(stun)
Weaken(10)
return 1
if(is_mouth_covered()) //make this add a blood/vomit overlay later it'll be hilarious
if(message)
visible_message("<span class='danger'>[src] throws up all over themself!</span>", \
"<span class='userdanger'>You throw up all over yourself!</span>")
distance = 0
else
if(message)
visible_message("<span class='danger'>[src] throws up!</span>", \
"<span class='userdanger'>You throw up!</span>")
visible_message("<span class='danger'>[src] throws up!</span>", "<span class='userdanger'>You throw up!</span>")
if(stun)
Stun(4)
playsound(get_turf(src), 'sound/effects/splat.ogg', 50, 1)
var/turf/T = get_turf(src)
for(var/i=0 to distance)
@@ -562,9 +566,8 @@
adjustBruteLoss(3)
else
if(T)
T.add_vomit_floor(src)
T.add_vomit_floor(src, 0)//toxic barf looks different
nutrition -= lost_nutrition
if(stun)
adjustToxLoss(-3)
T = get_step(T, dir)
if (is_blocked_turf(T))

View File

@@ -253,28 +253,17 @@
reagents.metabolize(src, can_overdose=1)
dna.species.handle_chemicals_in_body(src)
/mob/living/carbon/human/handle_random_events()
// Puke if toxloss is too high
//Puke if toxloss is too high
if(!stat)
if (getToxLoss() >= 45 && nutrition > 20)
if(getToxLoss() >= 45 && nutrition > 20)
lastpuke ++
if(lastpuke >= 25) // about 25 second delay I guess
Stun(5)
visible_message("<span class='danger'>[src] throws up!</span>", \
"<span class='userdanger'>[src] throws up!</span>")
playsound(loc, 'sound/effects/splat.ogg', 50, 1)
var/turf/location = loc
if (istype(location, /turf))
location.add_vomit_floor(src, 1)
nutrition -= 20
adjustToxLoss(-3)
// make it so you can only puke so fast
vomit(20, 0, 1, 0, 1, 1)
lastpuke = 0
/mob/living/carbon/human/has_smoke_protection()
if(wear_mask)
if(wear_mask.flags & BLOCK_GAS_SMOKE_EFFECT)
@@ -288,6 +277,8 @@
if(NOBREATH in dna.species.specflags)
. = 1
return .
/mob/living/carbon/human/proc/handle_embedded_objects()
for(var/X in bodyparts)
var/obj/item/bodypart/BP = X
@@ -304,6 +295,7 @@
if(!has_embedded_objects())
clear_alert("embeddedobject")
/mob/living/carbon/human/proc/handle_heart()
CHECK_DNA_AND_SPECIES(src)
var/needs_heart = (!(NOBLOOD in dna.species.specflags))

View File

@@ -397,9 +397,9 @@
/datum/species/fly/handle_chemicals(datum/reagent/chem, mob/living/carbon/human/H)
if(istype(chem,/datum/reagent/consumable))
var/datum/reagent/consumable/nutri_check = chem
if(nutri_check.nutriment_factor >0)
if(nutri_check.nutriment_factor > 0)
var/turf/pos = get_turf(H)
H.vomit()
H.vomit(0, 0, 0, 1, 1)
playsound(pos, 'sound/effects/splat.ogg', 50, 1)
H.visible_message("<span class='danger'>[H] vomits on the floor!</span>", \
"<span class='userdanger'>You throw up on the floor!</span>")