mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-29 08:08:49 +01:00
Stomach food reagents on vomit (#55002)
Missed check for stomach food reagents in stomach vomit code causing pain. Now vomit code checks that the reagents it has are not in the food reagents when applying damage. fixes #55000
This commit is contained in:
@@ -85,14 +85,24 @@
|
||||
if(!nutri)
|
||||
return
|
||||
|
||||
// remove the food reagent amount
|
||||
var/nutri_vol = nutri.volume
|
||||
var/amount_food = food_reagents[nutri.type]
|
||||
if(amount_food)
|
||||
nutri_vol = max(nutri_vol - amount_food, 0)
|
||||
|
||||
// found nutriment was stomach food reagent
|
||||
if(!(nutri_vol > 0))
|
||||
return
|
||||
|
||||
//The stomach is damage has nutriment but low on theshhold, lo prob of vomit
|
||||
if(prob(damage * 0.025 * nutri.volume * nutri.volume))
|
||||
if(prob(damage * 0.025 * nutri_vol * nutri_vol))
|
||||
body.vomit(damage)
|
||||
to_chat(body, "<span class='warning'>Your stomach reels in pain as you're incapable of holding down all that food!</span>")
|
||||
return
|
||||
|
||||
// the change of vomit is now high
|
||||
if(damage > high_threshold && prob(damage * 0.1 * nutri.volume * nutri.volume))
|
||||
if(damage > high_threshold && prob(damage * 0.1 * nutri_vol * nutri_vol))
|
||||
body.vomit(damage)
|
||||
to_chat(body, "<span class='warning'>Your stomach reels in pain as you're incapable of holding down all that food!</span>")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user