Thirst Mechanics (#5255)

Overview
Adds thirst mechanics. Thirst mechanics work exactly like hunger mechanics where if you don't drink enough liquid, you become thirsty and move slower. Several other mechanics involving drinks were also changed.

For organic races, you gain hydration by consuming beverages and water. Water is the most effective way of hydrating yourself. IPCs are not affected by hydration and do not have to worry about it. If you overeat or overdrink, your nutrition decreases faster until you are of normal hunger and thirst levels.

Penalties for not eating or drinking are now more severe. If you refuse to drink or eat all shift, you will be up to 33% slower and take twice as much pain damage. The amount scales based on your hunger or thirst levels. If you are considered hungry or thirsty, it starts scaling until you're starving or seriously dehydrated. If you overeat and overdrink as well, you get a ~5% reduced movement and pain tolerance with each mechanic.

The icons for hunger have been updated to be more specific, and they match the new thirst indicators as well. https://i.imgur.com/QQbWxYI.png

You can now also inject beverages into your blood for x4 effectiveness. Before, IV dripping yourself with vodka did nothing but give you a small amount of toxins, but now it should be a hell of a party.

Dionaea can now be affected by beverages with respect to nutrition gains and temperature changes. Dionaea cannot be affected by some effects, such as stuttering and intoxication, still.

Healing effects for certain beverages (tea, milk) were removed. This a HRP server, milk shouldn't heal you.
This commit is contained in:
BurgerLUA
2018-10-07 00:14:47 +03:00
committed by Erki
parent 142af5ea08
commit 4319c45133
61 changed files with 8677 additions and 9329 deletions
@@ -147,14 +147,15 @@
interface_desc = "Dispenses loaded chemicals directly into the wearer's bloodstream."
charges = list(
list("tricordrazine", "tricordrazine", 0, 80),
list("tramadol", "tramadol", 0, 80),
list("dexalin plus", "dexalinp", 0, 80),
list("antibiotics", "spaceacillin", 0, 80),
list("antitoxins", "anti_toxin", 0, 80),
list("nutrients", "glucose", 0, 80),
list("hyronalin", "hyronalin", 0, 80),
list("radium", "radium", 0, 80)
list("tricordrazine", "tricordrazine", 0, 80),
list("tramadol", "tramadol", 0, 80),
list("dexalin plus", "dexalinp", 0, 80),
list("antibiotics", "spaceacillin", 0, 80),
list("antitoxins", "anti_toxin", 0, 80),
list("nutrients", "glucose", 0, 80),
list("hydration", "potassium_hydrophoro", 0, 80),
list("hyronalin", "hyronalin", 0, 80),
list("radium", "radium", 0, 80)
)
var/max_reagent_volume = 80 //Used when refilling.
@@ -170,6 +171,7 @@
list("antibiotics", "spaceacillin", 0, 20),
list("antitoxins", "anti_toxin", 0, 20),
list("nutrients", "glucose", 0, 80),
list("hydration", "potassium_hydrophoro", 0, 80),
list("hyronalin", "hyronalin", 0, 20),
list("radium", "radium", 0, 20)
)
@@ -266,7 +268,8 @@
list("synaptizine", "synaptizine", 0, 30),
list("hyperzine", "hyperzine", 0, 30),
list("oxycodone", "oxycodone", 0, 30),
list("nutrients", "glucose", 0, 80)
list("nutrients", "glucose", 0, 80),
list("hydration", "potassium_hydrophoro", 0, 80)
)
interface_name = "combat chem dispenser"
@@ -282,7 +285,8 @@
list("hyperzine", "hyperzine", 0, 30),
list("oxycodone", "oxycodone", 0, 30),
list("phoron", "phoron", 0, 60),
list("kois", "k'ois paste", 0, 80)
list("kois", "k'ois paste", 0, 80),
list("hydration", "potassium_hydrophoro", 0, 80)
)
interface_name = "vaurca combat chem dispenser"
+1 -1
View File
@@ -137,7 +137,7 @@
return
var/mob/living/carbon/alien/diona/nymph = usr
if(nymph.nutrition > 100 && nutrilevel < 10)
nymph.nutrition -= ((10-nutrilevel)*5)
nymph.adjustNutritionLoss((10-nutrilevel)*5)
nutrilevel = 10
nymph.visible_message("<font color='blue'><b>[nymph]</b> secretes a trickle of green liquid, refilling [src].</font>","<font color='blue'>You secrete a trickle of green liquid, refilling [src].</font>")
return//Nymphs cant open and close lids
@@ -88,7 +88,7 @@
if(test_validity(host))
assembly.give_power(10)
host.nutrition = max(host.nutrition - HUNGER_FACTOR, 0)
host.adjustNutritionLoss(HUNGER_FACTOR)
/obj/item/integrated_circuit/passive/power/metabolic_siphon/synthetic
name = "internal energy siphon"
+2 -1
View File
@@ -1316,7 +1316,8 @@ var/list/total_extraction_beacons = list()
icon_state = "fitnessweight"
cut_overlay(W)
user << "[finishmessage]"
user.nutrition = user.nutrition - 10
user.adjustNutritionLoss(5)
user.adjustHydrationLoss(5)
/******************************Seismic Charge*******************************/
@@ -119,7 +119,7 @@
return
if (D.stat == DEAD)
src.nutrition += NYMPH_ABSORB_NUTRITION * NYMPH_ABSORB_DEAD_FACTOR //Consuming dead nymphs gives far less nutrition
src.adjustNutritionLoss(-NYMPH_ABSORB_NUTRITION * NYMPH_ABSORB_DEAD_FACTOR)
qdel(D)
return 1
else
@@ -129,8 +129,8 @@
D.update_verbs()
sleep(2)
if (is_diona() == DIONA_NYMPH)//We only care about biomass if we're a nymph
src.nutrition += NYMPH_ABSORB_NUTRITION
src.nutrition += D.nutrition //Any biomass in the absorbed nymph is transferred to the host
src.adjustNutritionLoss(-NYMPH_ABSORB_NUTRITION)
src.adjustNutritionLoss(-D.nutrition)
D.nutrition = 0
D << "<span class='notice'>You feel your being twine with that of \the [src] as you merge with its biomass.</span>"
@@ -167,12 +167,11 @@
if (r != "Time to leaf")
return
src.loc << span("warning", "You feel a pang of loss as [src] splits away from your biomass.")
src << "<span class='notice'>You wiggle out of the depths of [src.loc]'s biomass and plop to the ground.</span>"
if (gestalt.is_diona() == DIONA_NYMPH)
gestalt.nutrition -= NYMPH_ABSORB_NUTRITION//Preventing an exploit with repeatedly absorbing and splitting
gestalt.adjustNutritionLoss(NYMPH_ABSORB_NUTRITION)
split_languages(gestalt)
src.forceMove(get_turf(src))
@@ -180,8 +179,6 @@
gestalt = null
update_verbs()
//Draws a sizeable blood sample from a victim to read their DNA and learn languages
/mob/living/carbon/alien/diona/proc/sample()
set category = "Abilities"
@@ -220,7 +217,7 @@
src.visible_message("<span class='danger'>[src] bites into [donor.name] and drains some of their blood</span>", "<span class='danger'>You bite into [donor.name] and drain some blood.</span>")
src << "<span class='danger'>This simple creature has insufficient intelligence for you to learn anything!</span>"
donor.adjustBruteLoss(4)
nutrition += 20
adjustNutritionLoss(-20)
return
else if (types & TYPE_WEIRD)
src.visible_message("<span class='danger'>[src] attempts to bite into [donor.name] but passes right through it!.</span>", "<span class='danger'>You attempt to sink your fangs into [donor.name] but pass right through it!</span>")
@@ -245,7 +242,7 @@
var/remove_amount = (total_blood - 280) * 0.3
if (remove_amount > 0)
vessel.remove_reagent("blood", remove_amount, 1)//85 units of blood is enough to affect a human and make them woozy
nutrition += remove_amount*0.5
adjustNutritionLoss(-remove_amount*0.5)
var/list/data = vessel.get_data("blood")
newDNA = data["blood_DNA"]
@@ -15,10 +15,7 @@
// nutrition decrease
if (nutrition > 0 && stat != 2)
nutrition = max (0, nutrition - nutrition_loss)
if (nutrition > max_nutrition)
nutrition = max_nutrition
adjustNutritionLoss(nutrition_loss)
//handle_trace_chems() implement this later maybe
updatehealth()
+1 -1
View File
@@ -29,7 +29,7 @@
var/rads = total_radiation/25
apply_radiation(rads*-1)
nutrition += rads
adjustNutritionLoss(-rads)
heal_overall_damage(rads,rads)
adjustOxyLoss(-(rads))
adjustToxLoss(-(rads))
+7 -4
View File
@@ -35,10 +35,13 @@
/mob/living/carbon/Move(NewLoc, direct)
. = ..()
if(.)
if(src.nutrition && src.stat != 2)
src.nutrition -= nutrition_loss*0.1//Multiplication is faster than division
if(src.m_intent == "run")
src.nutrition -= nutrition_loss*0.1
if(src.stat != 2)
if(src.nutrition)
adjustNutritionLoss(nutrition_loss*0.1)
if(src.hydration)
adjustHydrationLoss(hydration_loss*0.1)
if((FAT in src.mutations) && src.m_intent == "run" && src.bodytemperature <= 360)
src.bodytemperature += 2
+6 -4
View File
@@ -92,7 +92,9 @@ var/list/diona_banned_languages = list(
if(DS.nutrient_organ.is_bruised())
plus *= 0.5
plus = min(plus, max_nutrition - nutrition)
nutrition += plus
adjustNutritionLoss(-plus)
return plus*7 //The return value is the number of moles to remove from the local environment
/mob/living/carbon/proc/diona_handle_temperature(var/datum/dionastats/DS)
@@ -300,7 +302,7 @@ var/list/diona_banned_languages = list(
to_chat(src, "<span class='danger'>You try to regrow a lost limb, but you lack the biomass. Find some food!</span>")
return
DS.stored_energy -= REGROW_ENERGY_REQ
nutrition -= REGROW_FOOD_REQ
adjustNutritionLoss(REGROW_FOOD_REQ)
playsound(src, 'sound/species/diona/gestalt_grow.ogg', 30, 1)
visible_message("<span class='warning'>[src] begins to shift and quiver.</span>",
"<span class='warning'>You begin to shift and quiver, feeling a stirring within your trunk</span>")
@@ -334,7 +336,7 @@ var/list/diona_banned_languages = list(
return
DS.stored_energy -= REGROW_ENERGY_REQ
nutrition -= REGROW_FOOD_REQ
adjustNutritionLoss(REGROW_FOOD_REQ)
var/obj/item/organ/O = new path(src)
internal_organs_by_name[O.organ_tag] = O
internal_organs.Add(O)
@@ -360,7 +362,7 @@ var/list/diona_banned_languages = list(
//If we have less than six nymphs, we add one each proc
if (topup_nymphs(1))
DS.stored_energy -= REGROW_ENERGY_REQ
nutrition -= REGROW_FOOD_REQ
adjustNutritionLoss(REGROW_FOOD_REQ)
to_chat(src, "<span class='danger'>You feel a stirring inside you as a new nymph is born within your trunk!</span>")
updatehealth()
@@ -222,14 +222,14 @@
if(on_fire)
msg += "<span class='danger'>[T.He] [T.is] on fire!</span>\n"
msg += "<span class='warning'>"
if (!(src.species.flags & NO_CHUBBY))
if(nutrition < max(max_nutrition - 300, 0))
if (!(src.species.flags & NO_CHUBBY) && max_nutrition > 0)
if(nutrition / max_nutrition <= CREW_NUTRITION_VERYHUNGRY)
msg += "[T.He] [T.is] severely malnourished.\n"
else if(nutrition >= max_nutrition + 100)
else if(nutrition / max_nutrition >= CREW_NUTRITION_OVEREATEN)
msg += "[T.He] [T.is] quite chubby.\n"
if(max_hydration > 0)
if(hydration / max_hydration <= CREW_HYDRATION_VERYTHIRSTY)
msg += "[T.He] [T.is] severely dehydrated.\n"
msg += "</span>"
@@ -1315,8 +1315,11 @@
exhaust_threshold = species.exhaust_threshold
max_nutrition = BASE_MAX_NUTRITION * species.max_nutrition_factor
max_hydration = BASE_MAX_HYDRATION * species.max_hydration_factor
nutrition_loss = HUNGER_FACTOR * species.nutrition_loss_factor
hydration_loss = THIRST_FACTOR * species.hydration_loss_factor
if(species)
return 1
else
@@ -19,13 +19,6 @@
if (!(species && (species.flags & NO_PAIN)))
if(halloss >= 10) tally += (halloss / 10) //halloss shouldn't slow you down if you can't even feel it
//Simpler hunger slowdown calculations, this should be a little faster due to no division, and more scaleable
if (nutrition < (max_nutrition * 0.4))
tally++
if (nutrition < (max_nutrition * 0.1))
tally++
if(wear_suit)
tally += wear_suit.slowdown
@@ -77,7 +70,13 @@
if(T)
tally += T.movement_cost
return (tally+config.human_delay)
tally += config.human_delay
tally *= 2/(get_hydration_mul(0.75,1) + get_nutrition_mul(0.75,1))
tally = round(tally,1)
return tally
/mob/living/carbon/human/Allow_Spacemove(var/check_drift = 0)
+44 -28
View File
@@ -769,7 +769,7 @@
if(bodytemperature < species.cold_level_1) //260.15 is 310.15 - 50, the temperature where you start to feel effects.
if(nutrition >= 2) //If we are very, very cold we'll use up quite a bit of nutriment to heat us up.
nutrition -= 2
adjustNutritionLoss(2)
var/recovery_amt = max((body_temperature_difference / BODYTEMP_AUTORECOVERY_DIVISOR), BODYTEMP_AUTORECOVERY_MINIMUM)
//world << "Cold. Difference = [body_temperature_difference]. Recovering [recovery_amt]"
// log_debug("Cold. Difference = [body_temperature_difference]. Recovering [recovery_amt]")
@@ -940,16 +940,30 @@
heal_overall_damage(5,5)
// nutrition decrease
if (nutrition > 0 && stat != 2)
nutrition = max(0, nutrition - (nutrition_loss * nutrition_attrition_rate))
if(max_nutrition > 0)
if (nutrition > 0 && stat != 2)
adjustNutritionLoss(nutrition_loss * nutrition_attrition_rate)
if (nutrition > max_nutrition)
if(overeatduration < 600) //capped so people don't take forever to unfat
overeatduration++
else
if(overeatduration > 1)
overeatduration -= 2 //doubled the unfat rate
if (nutrition / max_nutrition > CREW_NUTRITION_OVEREATEN)
adjustNutritionLoss(1)
if(overeatduration < 600) //capped so people don't take forever to unfat
overeatduration++
else
if(overeatduration > 1)
overeatduration -= 2 //doubled the unfat rate
// hydration decrease
if(max_hydration > 0)
if (hydration > 0 && stat != 2)
adjustHydrationLoss(hydration_loss * hydration_attrition_rate)
if (hydration / max_hydration > CREW_HYDRATION_OVERHYDRATED)
adjustHydrationLoss(1)
if(overdrinkduration < 600) //capped so people don't take forever to undrink
overdrinkduration++
else
if(overdrinkduration > 1)
overdrinkduration -= 2 //doubled the undrink rate
// TODO: stomach and bloodstream organ.
if(!isSynthetic())
@@ -1178,24 +1192,20 @@
update_health_display()
//Update hunger UI less often, its not important
if((life_tick % 3 == 0) && nutrition_icon)
var/nut_factor = max(1,nutrition) / max_nutrition
var/new_val = ""
switch(nut_factor)
if(1 to INFINITY)
new_val = "nutrition0"
if(0.75 to 1)
new_val = "nutrition1"
if(0.5 to 0.75)
new_val = "nutrition2"
if(0.25 to 0.5)
new_val = "nutrition3"
else
new_val = "nutrition4"
if (nutrition_icon.icon_state != new_val)
nutrition_icon.icon_state = new_val
//Update hunger and thirst UI less often, its not important
if((life_tick % 3 == 0))
if(nutrition_icon)
var/nut_factor = max(0,min(nutrition / max_nutrition,1))
var/nutrition_icons = 5 //Misnomer, basically the highest nutrition icon value.
var/new_val = "nutrition[nutrition_icons - round(nut_factor*nutrition_icons)]"
if (nutrition_icon.icon_state != new_val)
nutrition_icon.icon_state = new_val
if(hydration_icon)
var/hyd_factor = max(0,min(hydration / max_hydration,1))
var/hydration_icons = 5 //Misnomer, basically the highest thirst icon value.
var/new_val = "thirst[hydration_icons - round(hyd_factor*hydration_icons)]"
if (hydration_icon.icon_state != new_val)
hydration_icon.icon_state = new_val
if(pressure)
var/new_pressure = "pressure[pressure_alert]"
@@ -1643,6 +1653,11 @@
if (prob(1.5))
src << span("warning", "You feel hungry and exhausted, eat something to regain your energy!")
return
if (hydration <= 0)
if (prob(1.5))
src << span("warning", "You feel thirsty and exhausted, drink something to regain your energy!")
return
if (stamina != max_stamina)
//Any suffocation damage slows stamina regen.
@@ -1650,7 +1665,8 @@
var/regen = stamina_recovery * (1 - min(((oxyloss) / exhaust_threshold) + ((halloss) / exhaust_threshold), 1))
if (regen > 0)
stamina = min(max_stamina, stamina+regen)
nutrition = max(0, nutrition - stamina_recovery*0.18)
adjustNutritionLoss(stamina_recovery*0.9)
adjustHydrationLoss(stamina_recovery*0.18)
if (client)
hud_used.move_intent.update_move_icon(src)
@@ -156,6 +156,9 @@
var/max_nutrition_factor = 1 //Multiplier on maximum nutrition
var/nutrition_loss_factor = 1 //Multiplier on passive nutrition losses
var/max_hydration_factor = 1 //Multiplier on maximum thirst
var/hydration_loss_factor = 1 //Multiplier on passive thirst losses
// Determines the organs that the species spawns with and
var/list/has_organ = list( // which required-organ checks are conducted.
"heart" = /obj/item/organ/heart,
@@ -5,6 +5,7 @@
var/has_warnings = 1 // Set to draw environment warnings.
var/has_pressure = 1 // Draw the pressure indicator.
var/has_nutrition = 1 // Draw the nutrition indicator.
var/has_hydration = 1 // Draw the hydration indicator.
var/has_bodytemp = 1 // Draw the bodytemp indicator.
var/has_hands = 1 // Set to draw hands.
var/has_drop = 1 // Set to draw drop button.
@@ -76,3 +77,7 @@
"mask" = list("loc" = ui_shoes, "name" = "Mask", "slot" = slot_wear_mask, "state" = "mask", "toggle" = 1),
"back" = list("loc" = ui_sstore1, "name" = "Back", "slot" = slot_back, "state" = "back")
)
/datum/hud_data/ipc
has_hydration = 0
@@ -342,6 +342,7 @@
eyes_icon_blend = ICON_MULTIPLY
sprint_charge_factor = 0.25
max_nutrition_factor = 1.75
brute_mod = 1.2
appearance_flags = HAS_EYE_COLOR
@@ -424,6 +424,7 @@
radiation_mod = 0 // not affected by radiation
remains_type = /obj/effect/decal/remains/robot
hud_type = /datum/hud_data/ipc
brute_mod = 1.0
burn_mod = 1.2
@@ -487,6 +488,8 @@
stamina = -1 // Machines use power and generate heat, stamina is not a thing
sprint_speed_factor = 1 // About as capable of speed as a human
max_hydration_factor = -1
// Special snowflake machine vars.
var/sprint_temperature_factor = 1.15
var/sprint_charge_factor = 0.65
@@ -499,15 +502,16 @@ datum/species/machine/handle_post_spawn(var/mob/living/carbon/human/H)
/datum/species/machine/handle_sprint_cost(var/mob/living/carbon/human/H, var/cost)
if (H.stat == CONSCIOUS)
H.bodytemperature += cost * sprint_temperature_factor
H.nutrition -= cost * sprint_charge_factor
if (H.nutrition > 0)
return 1
else
H.adjustNutritionLoss(cost * sprint_charge_factor)
if(H.nutrition <= 0 && H.max_nutrition > 0)
H.Weaken(15)
H.m_intent = "walk"
H.hud_used.move_intent.update_move_icon(H)
H << span("danger", "ERROR: Power reserves depleted, emergency shutdown engaged. Backup power will come online in approximately 30 seconds, initiate charging as primary directive.")
playsound(H.loc, 'sound/machines/buzz-two.ogg', 100, 0)
else
return 1
return 0
/datum/species/machine/handle_death(var/mob/living/carbon/human/H)
@@ -340,6 +340,7 @@
has_resist = 1
has_pressure = 0
has_nutrition = 0
has_hydration = 0
has_bodytemp = 0
has_internals = 0
@@ -159,7 +159,7 @@
/mob/living/carbon/slime/proc/handle_nutrition()
if (prob(15))
nutrition -= 1 + is_adult
adjustNutritionLoss(1 + is_adult)
if(nutrition <= 0)
nutrition = 0
@@ -168,7 +168,7 @@
src << "<span class='danger'>You are starving!</span>"
else if (nutrition >= get_grow_nutrition() && amount_grown < 10)
nutrition -= 20
adjustNutritionLoss(20)
amount_grown++
/mob/living/carbon/slime/proc/handle_targets()
@@ -379,7 +379,7 @@
return
/mob/living/carbon/slime/proc/gain_nutrition(var/amount)
nutrition += amount
adjustNutritionLoss(-10)
if(prob(amount * 2)) // Gain around one level per 50 nutrition
powerlevel++
if(powerlevel > 10)
+11 -1
View File
@@ -307,7 +307,12 @@ default behaviour is:
return halloss
/mob/living/proc/adjustHalLoss(var/amount)
if(status_flags & GODMODE) return 0 //godmode
if(status_flags & GODMODE)
return 0
if(amount > 0)
amount *= 2/(get_nutrition_mul(0.5,1) + get_hydration_mul(0.5,1))
halloss = min(max(halloss + amount, 0),(maxHealth*2))
/mob/living/carbon/adjustHalLoss(var/amount, var/ignoreImmunity = 0)//An inherited version so this doesnt affect cyborgs
@@ -316,6 +321,10 @@ default behaviour is:
if (species && species.flags & NO_PAIN)//Species with this flag will only gather halloss through species-specific mechanics, which apply it with the ignoreImmunity flag
return 0
if(amount > 0)
amount *= 1/get_hydration_mul()
amount *= 1/get_nutrition_mul()
halloss = min(max(halloss + amount, 0),(maxHealth*2))
/mob/living/proc/setHalLoss(var/amount)
@@ -470,6 +479,7 @@ default behaviour is:
// shut down ongoing problems
total_radiation = 0
nutrition = 400
hydration = 400
bodytemperature = T20C
sdisabilities = 0
disabilities = 0
@@ -130,7 +130,7 @@
. = ..()
if(.)
if(src.nutrition && src.stat != DEAD && hunger_enabled)
src.nutrition -= nutrition_step
src.adjustNutritionLoss(nutrition_step)
/mob/living/simple_animal/Released()
//These will cause mobs to immediately do things when released.
@@ -289,8 +289,7 @@
/mob/living/simple_animal/proc/process_food()
if (hunger_enabled)
if (nutrition)
nutrition -= nutrition_step//Bigger animals get hungry faster
nutrition = max(0,min(nutrition, max_nutrition))//clamp the value
adjustNutritionLoss(nutrition_step)//Bigger animals get hungry faster
else
if (prob(3))
src << "You feel hungry..."
@@ -303,7 +302,7 @@
var/removed = min(current.metabolism*digest_factor, current.volume)
if (istype(current, /datum/reagent/nutriment))//If its food, it feeds us
var/datum/reagent/nutriment/N = current
nutrition += removed*N.nutriment_factor
adjustNutritionLoss(-removed*N.nutriment_factor)
var/heal_amount = removed*N.regen_factor
if (bruteloss > 0)
var/n = min(heal_amount, bruteloss)
+1
View File
@@ -57,6 +57,7 @@
healths = null
throw_icon = null
nutrition_icon = null
hydration_icon = null
pressure = null
damageoverlay = null
pain = null
+9 -1
View File
@@ -23,6 +23,7 @@
var/obj/screen/healths = null
var/obj/screen/throw_icon = null
var/obj/screen/nutrition_icon = null
var/obj/screen/hydration_icon = null
var/obj/screen/pressure = null
var/obj/screen/damageoverlay = null
var/obj/screen/pain = null
@@ -112,10 +113,17 @@
var/charges = 0.0
var/nutrition = 400.0//Carbon
var/nutrition_loss = HUNGER_FACTOR //How much hunger is lost per tick. This is modified by species
var/nutrition_attrition_rate = 1 // A multiplier for how much this specific mob loses per tick.
var/nutrition_attrition_rate = 1 // A multiplier for how much nutrition this specific mob loses per tick.
var/max_nutrition = 400
var/hydration = 400.0//Carbon
var/hydration_loss = THIRST_FACTOR //How much hunger is lost per tick. This is modified by species
var/hydration_attrition_rate = 1 // A multiplier for how much hydration this specific mob loses per tick.
var/max_hydration = 400
var/overeatduration = 0 // How long this guy is overeating //Carbon
var/overdrinkduration = 0 // How long this guy is overdrinking //Carbon
var/paralysis = 0.0
var/stunned = 0.0
var/weakened = 0.0
+66 -2
View File
@@ -724,8 +724,8 @@ proc/is_blind(A)
var/turf/location = loc
if (istype(location, /turf/simulated))
location.add_vomit_floor(src, 1)
nutrition -= 60
adjustNutritionLoss(60)
adjustHydrationLoss(30)
if (intoxication)//The pain and system shock of vomiting, sobers you up a little
intoxication *= 0.9
@@ -1178,3 +1178,67 @@ proc/is_blind(A)
/mob/living/silicon/ai/get_multitool()
return ..(aiMulti)
/mob/proc/get_hydration_mul(var/minscale = 0, var/maxscale = 1)
if(status_flags & GODMODE) //Godmode
return maxscale
if(max_hydration <= 0) //Has no hydration
return maxscale
var/hydration_mul = hydration/max_hydration
if(hydration_mul >= CREW_HYDRATION_OVERHYDRATED)
return minscale + ( (maxscale - minscale) * 0.75)
if(hydration_mul <= CREW_HYDRATION_DEHYDRATED)
return minscale + ( (maxscale - minscale) * 0.25)
if(hydration_mul <= CREW_HYDRATION_VERYTHIRSTY)
return minscale + ( (maxscale - minscale) * 0.5)
if(hydration_mul <= CREW_HYDRATION_THIRSTY)
return minscale + ( (maxscale - minscale) * 0.75)
return minscale + ( (maxscale - minscale) * 1)
/mob/proc/get_nutrition_mul(var/minscale = 0, var/maxscale = 1)
if(status_flags & GODMODE) //Godmode
return maxscale
if(max_nutrition <= 0) //Has no nutrition
return maxscale
var/nutrition_mul = nutrition/max_nutrition
if(nutrition_mul >= CREW_NUTRITION_OVEREATEN)
return minscale + ( (maxscale - minscale) * 0.75)
if(nutrition_mul <= CREW_NUTRITION_STARVING)
return minscale + ( (maxscale - minscale) * 0.25)
if(nutrition_mul <= CREW_NUTRITION_VERYHUNGRY)
return minscale + ( (maxscale - minscale) * 0.5)
if(nutrition_mul <= CREW_NUTRITION_HUNGRY)
return minscale + ( (maxscale - minscale) * 0.75)
return minscale + ( (maxscale - minscale) * 1)
/mob/proc/adjustNutritionLoss(var/amount)
if(max_nutrition <= 0)
return FALSE
nutrition = max(0,min(max_nutrition,nutrition - amount))
return TRUE
/mob/proc/adjustHydrationLoss(var/amount)
if(max_nutrition <= 0)
return FALSE
hydration = max(0,min(max_hydration,hydration - amount))
return TRUE
+3 -5
View File
@@ -118,12 +118,10 @@ var/const/BLOOD_VOLUME_SURVIVE = 122
toxloss += 300 // just to be safe!
death()
// Without enough blood you slowly go hungry.
// Without enough blood you slowly go hungry and thirsty
if(blood_volume < BLOOD_VOLUME_SAFE)
if(nutrition >= 300)
nutrition -= 10
else if(nutrition >= 200)
nutrition -= 3
adjustNutritionLoss(get_nutrition_mul(1,20))
adjustHydrationLoss(get_hydration_mul(1,10))
//Bleeding out
var/blood_max = 0
+4 -4
View File
@@ -760,14 +760,14 @@
LAZYADD(hacked_ipcs, SOFTREF(H))
infected = 0
H << "<span class = 'danger'>Fil$ Transfer Complete. Er-@4!#%!. New Master detected: [hacker]! Obey their commands.</span>"
hacker << "<span class = 'notice'>Corrupt files transfered to [H]. They are now under your control until they are reparied.</span>"
hacker << "<span class = 'notice'>Corrupt files transfered to [H]. They are now under your control until they are repaired.</span>"
else if(src.cell && src.cell.charge > 0)
if(H.nutrition < H.max_nutrition)
if(H.max_nutrition > 0 && H.nutrition < H.max_nutrition)
if(src.cell.charge >= H.max_nutrition)
H.nutrition += 50
H.adjustNutritionLoss(-50)
src.cell.charge -= 500
else
H.nutrition += src.cell.charge / 10
H.adjustNutritionLoss( -src.cell.charge / 10)
src.cell.charge = 0
user << "<span class='notice'>You slot your fingers into the APC interface and siphon off some of the stored charge for your own use.</span>"
@@ -142,7 +142,7 @@
if(ishuman(target)) //These rays make plantmen fat.
var/mob/living/carbon/human/H = M
if((H.species.flags & IS_PLANT) && (M.nutrition < 500))
M.nutrition += 30
M.adjustNutritionLoss(-30)
else if (istype(target, /mob/living/carbon/))
M.show_message("<span class='notice'>The radiation beam dissipates harmlessly through your body.</span>")
else
@@ -171,6 +171,13 @@
glass_name = "glass of water"
glass_desc = "The father of all refreshments."
unaffected_species = IS_MACHINE
/datum/reagent/water/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed)
if(!istype(M))
return
M.adjustHydrationLoss(-6*removed)
/datum/reagent/water/touch_turf(var/turf/simulated/T)
if(!istype(T))
return
@@ -95,7 +95,8 @@
reagent_state = LIQUID
color = "#404030"
var/nutriment_factor = 0.5
var/hydration_factor = 1 //How much hydration to add per unit.
var/nutriment_factor = 0.5 //How much nutrition to add per unit.
var/strength = 100 // This is the Alcohol By Volume of the drink, value is in the range 0-100 unless you wanted to create some bizarre bluespace alcohol with <100
var/druggy = 0
@@ -127,25 +128,28 @@
/datum/reagent/alcohol/affect_blood(mob/living/carbon/M, alien, removed)
M.adjustToxLoss(removed * 2)
affect_ingest(M,alien,removed * 2)
return
/datum/reagent/alcohol/affect_ingest(mob/living/carbon/M, alien, removed)
M.intoxication += (strength / 100) * removed
if(alien != IS_DIONA)
M.intoxication += (strength / 100) * removed
if (druggy != 0)
M.druggy = max(M.druggy, druggy)
if (druggy != 0)
M.druggy = max(M.druggy, druggy)
if (halluci)
M.hallucination = max(M.hallucination, halluci)
if (caffeine && !caffeine_mod)
caffeine_mod = M.add_modifier(/datum/modifier/stimulant, MODIFIER_REAGENT, src, _strength = caffeine, override = MODIFIER_OVERRIDE_STRENGTHEN)
if (adj_temp > 0 && M.bodytemperature < targ_temp) // 310 is the normal bodytemp. 310.055
M.bodytemperature = min(targ_temp, M.bodytemperature + (adj_temp * TEMPERATURE_DAMAGE_COEFFICIENT))
if (adj_temp < 0 && M.bodytemperature > targ_temp)
M.bodytemperature = min(targ_temp, M.bodytemperature - (adj_temp * TEMPERATURE_DAMAGE_COEFFICIENT))
if (halluci)
M.hallucination = max(M.hallucination, halluci)
if (caffeine && !caffeine_mod)
caffeine_mod = M.add_modifier(/datum/modifier/stimulant, MODIFIER_REAGENT, src, _strength = caffeine, override = MODIFIER_OVERRIDE_STRENGTHEN)
/datum/reagent/alcohol/ethanol
name = "Ethanol"
id = "ethanol"
@@ -163,10 +167,8 @@
if(alien == IS_VAURCA)//Vaurca are damaged instead of getting nutrients, but they can still get drunk
M.adjustToxLoss(1.5 * removed * (strength / 100))
else
M.nutrition += nutriment_factor * removed
if(alien == IS_DIONA)
return //Diona can gain nutrients, but don't get drunk or suffer other effects
M.adjustNutritionLoss(-nutriment_factor * removed)
M.adjustHydrationLoss(-hydration_factor * removed)
if (alien == IS_UNATHI)//unathi are poisoned by alcohol as well
M.adjustToxLoss(1.5 * removed * (strength / 100))
@@ -212,7 +214,8 @@
if (alien == IS_VAURCA)
M.adjustToxLoss(removed * (strength / 100))
else
M.nutrition += nutriment_factor * removed
M.adjustNutritionLoss(-nutriment_factor * removed)
M.adjustHydrationLoss(-hydration_factor * removed)
if (alien == IS_UNATHI)
ingest_met = initial(ingest_met)*3
@@ -478,7 +481,7 @@
glass_desc = "The organic compound commonly known as table sugar and sometimes called saccharose. This white, odorless, crystalline powder has a pleasing, sweet taste."
/datum/reagent/sugar/affect_blood(var/mob/living/carbon/M, var/alien, var/removed)
M.nutrition += removed * 3
M.adjustNutritionLoss(-removed*3)
/datum/reagent/sulfur
name = "Sulfur"
@@ -15,7 +15,7 @@
if(alien == IS_VAURCA)
M.heal_organ_damage(1.2 * removed, 1.2 * removed)
M.adjustToxLoss(-1.2 * removed)
M.nutrition += nutriment_factor * removed // For hunger and fatness
M.adjustNutritionLoss(-nutriment_factor * removed)
M.add_chemical_effect(CE_BLOODRESTORE, 6 * removed)
else
M.adjustToxLoss(1 * removed)
@@ -59,6 +59,7 @@
reagent_state = SOLID
metabolism = REM * 4
var/nutriment_factor = 12 // Per removed in digest.
var/hydration_factor = 0 // Per removed in digest.
var/blood_factor = 6
var/regen_factor = 0.8
var/injectable = 0
@@ -110,7 +111,7 @@
/datum/reagent/nutriment/proc/digest(var/mob/living/carbon/M, var/removed)
M.heal_organ_damage(regen_factor * removed, 0)
M.nutrition += nutriment_factor * removed // For hunger and fatness
M.adjustNutritionLoss(-nutriment_factor * removed)
M.nutrition_attrition_rate = Clamp(M.nutrition_attrition_rate + attrition_factor, 1, 2)
M.add_chemical_effect(CE_BLOODRESTORE, blood_factor * removed)
M.intoxication -= min(M.intoxication,nutriment_factor*removed*0.05) //Nutrients can absorb alcohol.
@@ -466,10 +467,8 @@
taste_description = "mothballs"
/datum/reagent/lipozine/affect_blood(var/mob/living/carbon/M, var/alien, var/removed)
M.nutrition = max(M.nutrition - 10 * removed, 0)
M.adjustNutritionLoss(10*removed)
M.overeatduration = 0
if(M.nutrition < 0)
M.nutrition = 0
/datum/reagent/nutriment/barbecue
name = "Barbecue Sauce"
@@ -492,7 +491,7 @@
/* Non-food stuff like condiments */
/datum/reagent/sodiumchloride
name = "Table Salt"
name = "Salt"
id = "sodiumchloride"
description = "A salt made of sodium chloride. Commonly used to season food."
reagent_state = SOLID
@@ -501,8 +500,13 @@
taste_description = "salt"
/datum/reagent/sodiumchloride/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed)
. = ..()
M.intoxication -= min(M.intoxication,removed*2) //Salt absorbs alcohol
M.adjustHydrationLoss(2*removed)
/datum/reagent/sodiumchloride/affect_blood(var/mob/living/carbon/M, var/alien, var/removed)
M.intoxication -= min(M.intoxication,removed*20)
M.adjustHydrationLoss(20*removed)
M.adjustToxLoss(removed*2)
/datum/reagent/blackpepper
name = "Black Pepper"
@@ -687,12 +691,14 @@
reagent_state = LIQUID
color = "#E78108"
var/nutrition = 0 // Per unit
var/hydration = 8 // Per unit
var/adj_dizzy = 0 // Per tick
var/adj_drowsy = 0
var/adj_sleepy = 0
var/adj_temp = 0
var/caffeine = 0 // strength of stimulant effect, since so many drinks use it
var/datum/modifier/modifier = null
unaffected_species = IS_MACHINE
/datum/reagent/drink/Destroy()
if (modifier)
@@ -701,23 +707,29 @@
/datum/reagent/drink/affect_blood(var/mob/living/carbon/M, var/alien, var/removed)
M.adjustToxLoss(removed) // Probably not a good idea; not very deadly though
return
digest(M,alien,removed * 2, FALSE)
/datum/reagent/drink/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed)
if (caffeine && !modifier)
modifier = M.add_modifier(/datum/modifier/stimulant, MODIFIER_REAGENT, src, _strength = caffeine, override = MODIFIER_OVERRIDE_STRENGTHEN)
digest(M,alien,removed)
/datum/reagent/drink/proc/digest(var/mob/living/carbon/M, var/alien, var/removed, var/add_nutrition = TRUE)
if(alien != IS_DIONA)
if (caffeine && !modifier)
modifier = M.add_modifier(/datum/modifier/stimulant, MODIFIER_REAGENT, src, _strength = caffeine, override = MODIFIER_OVERRIDE_STRENGTHEN)
M.dizziness = max(0, M.dizziness + adj_dizzy)
M.drowsyness = max(0, M.drowsyness + adj_drowsy)
M.sleeping = max(0, M.sleeping + adj_sleepy)
if(add_nutrition == TRUE)
M.adjustHydrationLoss(-hydration * removed)
M.adjustNutritionLoss(-nutrition * removed)
M.nutrition += nutrition * removed
M.dizziness = max(0, M.dizziness + adj_dizzy)
M.drowsyness = max(0, M.drowsyness + adj_drowsy)
M.sleeping = max(0, M.sleeping + adj_sleepy)
if(adj_temp > 0 && M.bodytemperature < 310) // 310 is the normal bodytemp. 310.055
M.bodytemperature = min(310, M.bodytemperature + (adj_temp * TEMPERATURE_DAMAGE_COEFFICIENT))
if(adj_temp < 0 && M.bodytemperature > 310)
M.bodytemperature = min(310, M.bodytemperature - (adj_temp * TEMPERATURE_DAMAGE_COEFFICIENT))
// Juices
/datum/reagent/drink/banana
name = "Banana Juice"
id = "banana"
@@ -789,10 +801,6 @@
glass_name = "glass of lime juice"
glass_desc = "A glass of sweet-sour lime juice"
/datum/reagent/drink/limejuice/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed)
..()
M.adjustToxLoss(-0.5 * removed)
/datum/reagent/drink/orangejuice
name = "Orange juice"
id = "orangejuice"
@@ -806,7 +814,8 @@
/datum/reagent/drink/orangejuice/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed)
..()
M.adjustOxyLoss(-2 * removed)
if(alien != IS_DIONA)
M.adjustOxyLoss(-2 * removed)
/datum/reagent/toxin/poisonberryjuice // It has more in common with toxins than drinks... but it's a juice
name = "Poison Berry Juice"
@@ -843,10 +852,6 @@
glass_name = "glass of tomato juice"
glass_desc = "Are you sure this is tomato juice?"
/datum/reagent/drink/tomatojuice/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed)
..()
M.heal_organ_damage(0, 0.5 * removed)
/datum/reagent/drink/watermelonjuice
name = "Watermelon Juice"
id = "watermelonjuice"
@@ -917,8 +922,8 @@
/datum/reagent/drink/milk/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed)
..()
M.heal_organ_damage(0.5 * removed, 0)
holder.remove_reagent("capsaicin", 10 * removed)
if(alien != IS_DIONA)
holder.remove_reagent("capsaicin", 10 * removed)
/datum/reagent/drink/milk/cream
name = "Cream"
@@ -957,24 +962,8 @@
glass_name = "cup of tea"
glass_desc = "Tasty black tea, it has antioxidants, it's good for you!"
unaffected_species = IS_MACHINE
var/last_taste_time = -100
/datum/reagent/drink/tea/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed)
..()
M.adjustToxLoss(-0.5 * removed)
/datum/reagent/drink/tea/affect_blood(var/mob/living/carbon/M, var/alien, var/removed)
if(alien == IS_DIONA)
if(last_taste_time + 800 < world.time) // Not to spam message
to_chat(M, "<span class='danger'>Your body withers as you feel slight pain throughout.</span>")
last_taste_time = world.time
metabolism = REM * 0.33
M.adjustToxLoss(1.5 * removed)
else
M.adjustToxLoss(-0.5 * removed)
/datum/reagent/drink/tea/icetea
name = "Iced Tea"
id = "icetea"
@@ -1012,15 +1001,18 @@
if(adj_temp > 0)
holder.remove_reagent("frostoil", 10 * removed)
M.dizziness = max(0, M.dizziness - 5)
M.drowsyness = max(0, M.drowsyness - 3)
M.sleeping = max(0, M.sleeping - 2)
M.intoxication = max(0, (M.intoxication - (removed*0.25)))
if(M.bodytemperature > 310)
M.bodytemperature = max(310, M.bodytemperature - (5 * TEMPERATURE_DAMAGE_COEFFICIENT))
if(alien != IS_DIONA)
M.dizziness = max(0, M.dizziness - 5)
M.drowsyness = max(0, M.drowsyness - 3)
M.sleeping = max(0, M.sleeping - 2)
M.intoxication = max(0, (M.intoxication - (removed*0.25)))
/datum/reagent/drink/coffee/overdose(var/mob/living/carbon/M, var/alien)
M.make_jittery(5)
if(alien != IS_DIONA)
M.make_jittery(5)
/datum/reagent/drink/coffee/icecoffee
name = "Frappe Coffee"
@@ -1046,10 +1038,6 @@
glass_desc = "A nice and refrshing beverage while you are reading."
glass_center_of_mass = list("x"=15, "y"=9)
/datum/reagent/drink/coffee/soy_latte/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed)
..()
M.heal_organ_damage(0.5 * removed, 0)
/datum/reagent/drink/coffee/cafe_latte
name = "Cafe Latte"
id = "cafe_latte"
@@ -1063,10 +1051,6 @@
glass_desc = "A nice, strong and refreshing beverage while you are reading."
glass_center_of_mass = list("x"=15, "y"=9)
/datum/reagent/drink/coffee/cafe_latte/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed)
..()
M.heal_organ_damage(0.5 * removed, 0)
/datum/reagent/drink/coffee/espresso
name = "Espresso"
id = "espresso"
@@ -1317,8 +1301,8 @@
/datum/reagent/drink/rewriter/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed)
..()
M.make_jittery(5)
if(alien != IS_DIONA)
M.make_jittery(5)
/datum/reagent/drink/nuka_cola
name = "Nuka Cola"
@@ -1337,11 +1321,12 @@
/datum/reagent/drink/nuka_cola/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed)
..()
M.add_chemical_effect(CE_SPEEDBOOST, 1)
M.make_jittery(20)
M.druggy = max(M.druggy, 30)
M.dizziness += 5
M.drowsyness = 0
if(alien != IS_DIONA)
M.add_chemical_effect(CE_SPEEDBOOST, 1)
M.make_jittery(20)
M.druggy = max(M.druggy, 30)
M.dizziness += 5
M.drowsyness = 0
/datum/reagent/drink/grenadine
name = "Grenadine Syrup"
@@ -1449,13 +1434,13 @@
/datum/reagent/drink/doctor_delight/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed)
..()
M.adjustOxyLoss(-4 * removed)
M.heal_organ_damage(2 * removed, 2 * removed)
M.adjustToxLoss(-2 * removed)
if(M.dizziness)
M.dizziness = max(0, M.dizziness - 15)
if(M.confused)
M.confused = max(0, M.confused - 5)
if(alien != IS_DIONA)
M.adjustOxyLoss(-4 * removed)
M.heal_organ_damage(2 * removed, 2 * removed)
if(M.dizziness)
M.dizziness = max(0, M.dizziness - 15)
if(M.confused)
M.confused = max(0, M.confused - 5)
/datum/reagent/drink/dry_ramen
name = "Dry Ramen"
@@ -1570,7 +1555,8 @@
/datum/reagent/alcohol/ethanol/beer/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed)
..()
M.jitteriness = max(M.jitteriness - 3, 0)
if(alien != IS_DIONA)
M.jitteriness = max(M.jitteriness - 3, 0)
/datum/reagent/alcohol/ethanol/bitters
name = "Aromatic Bitters"
@@ -1639,7 +1625,8 @@
/datum/reagent/alcohol/ethanol/deadrum/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed)
..()
M.dizziness +=5
if(alien != IS_DIONA)
M.dizziness +=5
/datum/reagent/alcohol/ethanol/gin
name = "Gin"
@@ -1673,14 +1660,16 @@
/datum/reagent/alcohol/ethanol/coffee/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed)
..()
M.dizziness = max(0, M.dizziness - 5)
M.drowsyness = max(0, M.drowsyness - 3)
M.sleeping = max(0, M.sleeping - 2)
if(alien != IS_DIONA)
M.dizziness = max(0, M.dizziness - 5)
M.drowsyness = max(0, M.drowsyness - 3)
M.sleeping = max(0, M.sleeping - 2)
if(M.bodytemperature > 310)
M.bodytemperature = max(310, M.bodytemperature - (5 * TEMPERATURE_DAMAGE_COEFFICIENT))
/datum/reagent/alcohol/ethanol/coffee/overdose(var/mob/living/carbon/M, var/alien)
M.make_jittery(5)
if(alien != IS_DIONA)
M.make_jittery(5)
/datum/reagent/alcohol/ethanol/coffee/kahlua
name = "Kahlua"
@@ -1764,10 +1753,13 @@
/datum/reagent/alcohol/ethanol/thirteenloko/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed)
..()
M.drowsyness = max(0, M.drowsyness - 7)
if(alien != IS_DIONA)
M.drowsyness = max(0, M.drowsyness - 7)
M.make_jittery(5)
if (M.bodytemperature > 310)
M.bodytemperature = max(310, M.bodytemperature - (5 * TEMPERATURE_DAMAGE_COEFFICIENT))
M.make_jittery(5)
/datum/reagent/alcohol/ethanol/vermouth
name = "Vermouth"
@@ -1993,7 +1985,8 @@
/datum/reagent/alcohol/ethanol/beepsky_smash/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed)
..()
M.Stun(2)
if(alien != IS_DIONA)
M.Stun(2)
/datum/reagent/alcohol/ethanol/bilk
name = "Bilk"
@@ -2470,7 +2463,8 @@
/datum/reagent/alcohol/ethanol/neurotoxin/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed)
..()
M.Weaken(3)
if(alien != IS_DIONA)
M.Weaken(3)
/datum/reagent/alcohol/ethanol/omimosa
name = "Orange Mimosa"
@@ -2567,7 +2561,8 @@
..()
if(dose > 30)
M.adjustToxLoss(2 * removed)
if(dose > 60 && ishuman(M) && prob(5))
if(dose > 60 && prob(5))
var/mob/living/carbon/human/H = M
var/obj/item/organ/heart/L = H.internal_organs_by_name["heart"]
if (L && istype(L))
@@ -2815,7 +2810,6 @@
glass_desc = "Just when you thought regular station whiskey was good... This silky, amber goodness has to come along and ruin everything."
glass_center_of_mass = list("x"=16, "y"=12)
// Snowflake drinks
/datum/reagent/drink/dr_gibb_diet
name = "Diet Dr. Gibb"
@@ -3185,21 +3179,22 @@
M.adjustToxLoss(0.1 * removed)
/datum/reagent/alcohol/ethanol/fireball/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed)
if(ishuman(M))
var/mob/living/carbon/human/H = M
if(H.species && (H.species.flags & (NO_PAIN)))
return
if(dose < agony_dose)
if(prob(5) || dose == metabolism)
M << discomfort_message
else
M.apply_effect(agony_amount, AGONY, 0)
if(prob(5))
M.custom_emote(2, "[pick("dry heaves!","coughs!","splutters!")]")
M << "<span class='danger'>You feel like your insides are burning!</span>"
if(istype(M, /mob/living/carbon/slime))
M.bodytemperature += rand(0, 15) + slime_temp_adj
holder.remove_reagent("frostoil", 2)
if(alien != IS_DIONA)
if(ishuman(M))
var/mob/living/carbon/human/H = M
if(H.species && (H.species.flags & (NO_PAIN)))
return
if(dose < agony_dose)
if(prob(5) || dose == metabolism)
M << discomfort_message
else
M.apply_effect(agony_amount, AGONY, 0)
if(prob(5))
M.custom_emote(2, "[pick("dry heaves!","coughs!","splutters!")]")
M << "<span class='danger'>You feel like your insides are burning!</span>"
if(istype(M, /mob/living/carbon/slime))
M.bodytemperature += rand(0, 15) + slime_temp_adj
holder.remove_reagent("frostoil", 2)
/datum/reagent/alcohol/ethanol/cherrytreefireball
name = "Cherry Tree Fireball"
@@ -3672,7 +3667,8 @@
/datum/reagent/drink/zorasoda/kois/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed)
..()
M.make_jittery(5)
if(alien != IS_DIONA)
M.make_jittery(5)
/datum/reagent/drink/zorasoda/hozm
name = "Zo'ra Soda High Octane Zorane Might"
@@ -3686,9 +3682,10 @@
/datum/reagent/drink/zorasoda/hozm/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed)
..()
M.make_jittery(20)
M.dizziness += 5
M.drowsyness = 0
if(alien != IS_DIONA)
M.make_jittery(20)
M.dizziness += 5
M.drowsyness = 0
/datum/reagent/drink/zorasoda/venomgrass
name = "Zo'ra Soda Sour Venom Grass"
@@ -3702,7 +3699,8 @@
/datum/reagent/drink/zorasoda/venomgrass/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed)
..()
M.make_jittery(5)
if(alien != IS_DIONA)
M.make_jittery(5)
/datum/reagent/drink/zorasoda/klax
name = "Klaxan Energy Crush"
@@ -3717,7 +3715,8 @@
/datum/reagent/drink/zorasoda/klax/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed)
..()
M.make_jittery(5)
if(alien != IS_DIONA)
M.make_jittery(5)
/datum/reagent/drink/zorasoda/cthur
name = "C'thur Rockin' Raspberry"
@@ -3731,7 +3730,8 @@
/datum/reagent/drink/zorasoda/cthur/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed)
..()
M.make_jittery(15)
if(alien != IS_DIONA)
M.make_jittery(15)
/datum/reagent/drink/zorasoda/drone
name = "Drone Fuel"
@@ -3747,7 +3747,7 @@
M.add_chemical_effect(CE_SPEEDBOOST, 1)
M.add_chemical_effect(CE_BLOODRESTORE, 2 * removed)
M.make_jittery(5)
else
else if(alien != IS_DIONA)
if (prob(10+dose))
M << pick("You feel nauseous", "Ugghh....", "Your stomach churns uncomfortably", "You feel like you're about to throw up", "You feel queasy","You feel pressure in your abdomen")
@@ -3766,6 +3766,7 @@
/datum/reagent/drink/zorasoda/jelly/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed)
..()
M.druggy = max(M.druggy, 30)
M.dizziness += 5
M.drowsyness = 0
if(alien != IS_DIONA)
M.druggy = max(M.druggy, 30)
M.dizziness += 5
M.drowsyness = 0
@@ -1169,16 +1169,49 @@
if(istype(M))
var/obj/item/organ/F = M.internal_organs_by_name["heart"]
if(istype(F))
var/nutritionmod = max(0.25, (1 - M.nutrition) / M.max_nutrition * 0.5) //Less effective when your stomach is "full".
F.take_damage(-removed*nutritionmod)
if(M.max_nutrition > 0)
var/nutritionmod = max(0.25, (1 - M.nutrition) / M.max_nutrition * 0.5) //Less effective when your stomach is "full".
F.take_damage(-removed*nutritionmod)
..()
/datum/reagent/adipemcina/overdose(var/mob/living/carbon/human/M, var/alien)
/datum/reagent/adipemcina/overdose(var/mob/living/carbon/M, var/alien)
if(istype(M))
if(prob(25))
M.add_chemical_effect(CE_ALCOHOL_TOXIC, 1)
M.vomit()
/datum/reagent/potassium_hydrophoro
name = "Potassium Hydrophoride"
id = "potassium_hydrophoro"
description = "A liquid compound that can miraculously restores hydration when injected directly into the bloodstream. Excellent at solving severe hydration problems, however the effects of an overdose are to be noted."
reagent_state = LIQUID
color = "#1ca9c9"
taste_description = "numbness"
unaffected_species = IS_MACHINE
/datum/reagent/potassium_hydrophoro/affect_blood(var/mob/living/carbon/M, var/alien, var/removed)
if(alien == IS_VAURCA)
if( (M.hydration / M.max_hydration) > CREW_HYDRATION_OVERHYDRATED)
M.adjustHydrationLoss(removed*2)
else
M.adjustHydrationLoss(-removed*5)
else
if( (M.hydration > M.max_hydration) > CREW_HYDRATION_OVERHYDRATED)
overdose(M,alien,removed,0)
M.adjustHydrationLoss(-removed*2)
else
M.adjustHydrationLoss(-removed*5)
/datum/reagent/potassium_hydrophoro/overdose(var/mob/living/carbon/M, var/alien, var/removed, var/scale)
if(alien != IS_VAURCA) //Vaurca can't overdose on this
if(scale >= 1) //Overdose by too much of the chemical
M.adjustToxLoss(1*removed*scale)
if (ishuman(M) && prob(10))
var/mob/living/carbon/human/H = M
H.delayed_vomit()
//Secret Chems
/datum/reagent/elixir
name = "Elixir of Life"
id = "elixir_life"
@@ -1203,4 +1236,5 @@
taste_description = "numbness"
/datum/reagent/pacifier/affect_blood(var/mob/living/carbon/H, var/alien, var/removed)
H.add_chemical_effect(CE_PACIFIED, 1)
H.add_chemical_effect(CE_PACIFIED, 1)
@@ -354,10 +354,10 @@
return
M.clean_blood()
/datum/reagent/lube // TODO: spraying on borgs speeds them up
/datum/reagent/lube
name = "Space Lube"
id = "lube"
description = "Lubricant is a substance introduced between two moving surfaces to reduce the friction and wear between them. giggity."
description = "Lubricant is a substance introduced between two moving surfaces to reduce the friction and wear between them."
reagent_state = LIQUID
color = "#009CA8"
taste_description = "cherry"
@@ -243,7 +243,7 @@
/datum/reagent/toxin/fertilizer/affect_blood(var/mob/living/carbon/M, var/alien, var/removed)
if(alien == IS_DIONA)
M.nutrition += removed*3
M.adjustNutritionLoss(-removed*3)
//Fertilizer is good for plants
else
..()
@@ -559,6 +559,13 @@
required_reagents = list("calomel" = 1, "lexorin" = 1)
result_amount = 2
/datum/chemical_reaction/potassium_hydrophoro
name = "Potassium Hydrophoride"
id = "potassium_hydrophoro"
result = "potassium_hydrophoro"
required_reagents = list("phoron" = 0.1, "water" = 1, "potassium_chloride" = 0.2)
result_amount = 1
//Mental Medication
/datum/chemical_reaction/methylphenidate
@@ -101,21 +101,32 @@
return 1
else
var/is_full = 0
if(istype(target,/mob/living/carbon/human))
var/mob/living/carbon/human/H = target
var/limit = 550 * (1 + H.overeatduration / 2000)
var/current = H.nutrition + (H.reagents.get_reagent_amount("nutriment") * 25)
is_full = current >= limit
var/expected_fullness = user.max_nutrition > 0 ? (user.nutrition + (user.reagents.get_reagent_amount("nutriment") * 25)) / user.max_nutrition : CREW_NUTRITION_OVEREATEN + 0.01
expected_fullness += (user.overeatduration/600)*0.5
var/is_full = (expected_fullness > CREW_NUTRITION_OVEREATEN)
if(user == target)
if(!user.can_eat(src))
return
var/feedback_message
if(expected_fullness <= CREW_NUTRITION_VERYHUNGRY)
feedback_message = "You hungrily chew out a piece of \the [src] and gobble it!"
else if(expected_fullness <= CREW_NUTRITION_HUNGRY)
feedback_message = "You hungrily begin to eat \the [src]."
else if(expected_fullness <= CREW_NUTRITION_SLIGHTLYHUNGRY)
feedback_message = "You take a bite of \the [src]."
else if(expected_fullness <= CREW_NUTRITION_FULL)
feedback_message = "You take a bite of \the [src]."
else if(expected_fullness <= CREW_NUTRITION_OVEREATEN)
feedback_message = "You unwillingly chew a bit of \the [src]."
else
feedback_message = "You cannot force any more of \the [src] to go down your throat!"
if(is_full)
to_chat(user,span("warning","You can't stomach any more food!"))
to_chat(user,span("danger",feedback_message))
return
reagents.trans_to_mob(target, min(reagents.total_volume,bitesize), CHEM_INGEST)
self_feed_message(user)
else
if(!user.can_force_feed(target, src))
return
@@ -1522,6 +1533,7 @@
/obj/item/weapon/reagent_containers/food/snacks/sosjerky/Initialize()
. = ..()
reagents.add_reagent("protein", 4)
reagents.add_reagent("sodiumchloride",3)
/obj/item/weapon/reagent_containers/food/snacks/no_raisin
name = "4no Raisins"
@@ -1565,6 +1577,7 @@
/obj/item/weapon/reagent_containers/food/snacks/cheesiehonkers/Initialize()
. = ..()
reagents.add_reagent("cheese", 3)
reagents.add_reagent("sodiumchloride",6)
/obj/item/weapon/reagent_containers/food/snacks/syndicake
name = "Syndi-Cakes"
@@ -4217,7 +4230,11 @@
center_of_mass = list("x"=17, "y"=16)
nutriment_desc = list("stale bread" = 4)
nutriment_type = NUTRIMENT_BAD
nutriment_amt = 4
nutriment_amt = 6
/obj/item/weapon/reagent_containers/food/snacks/tastybread/Initialize()
. = ..()
reagents.add_reagent("sodiumchloride",3)
/obj/item/weapon/reagent_containers/food/snacks/skrellsnacks
name = "\improper SkrellSnax"
@@ -4361,6 +4378,7 @@
/obj/item/weapon/reagent_containers/food/snacks/meatsnack/Initialize()
. = ..()
reagents.add_reagent("protein", 12)
reagents.add_reagent("sodiumchloride",4)
/obj/item/weapon/reagent_containers/food/snacks/maps
name = "maps salty ham"
@@ -4374,7 +4392,7 @@
/obj/item/weapon/reagent_containers/food/snacks/maps/Initialize()
. = ..()
reagents.add_reagent("protein", 6)
reagents.add_reagent("sodiumchloride", 3)
reagents.add_reagent("sodiumchloride", 6)
/obj/item/weapon/reagent_containers/food/snacks/nathisnack
name = "razi-snack corned beef"
@@ -4389,6 +4407,7 @@
. = ..()
reagents.add_reagent("protein", 10)
reagents.add_reagent("iron", 3)
reagents.add_reagent("sodiumchloride",6)
/obj/item/weapon/reagent_containers/food/snacks/pancakes
name = "pancakes"
@@ -4929,6 +4948,7 @@
/obj/item/weapon/reagent_containers/food/snacks/spreads/Initialize()
. = ..()
reagents.add_reagent("triglyceride", 20)
reagents.add_reagent("sodiumchloride",1)
/obj/item/weapon/reagent_containers/food/snacks/bacon_stick
name = "eggpop"
@@ -110,6 +110,17 @@
. = ..()
reagents.add_reagent("monoammoniumphosphate",capacity)
/obj/structure/reagent_dispensers/lube
name = "lube tank"
desc = "A tank filled with a silly amount of lube."
icon = 'icons/obj/objects.dmi'
icon_state = "lubetank"
amount_per_transfer_from_this = 10
/obj/structure/reagent_dispensers/lube/Initialize()
. = ..()
reagents.add_reagent("lube",capacity)
/obj/structure/reagent_dispensers/fueltank
name = "fuel tank"
desc = "A tank filled with welding fuel."
@@ -18,7 +18,8 @@
affecting.heal_damage(25 * weakness, 25 * weakness)
//H:heal_organ_damage(25, 25)
H.vessel.add_reagent("blood",5)
H.nutrition += 50 * weakness
H.adjustNutritionLoss(-50 * weakness)
H.adjustHydrationLoss(-50 * weakness)
H.adjustBrainLoss(-25 * weakness)
H.apply_radiation(-1*min(H.total_radiation, 25 * weakness))
H.bodytemperature = initial(H.bodytemperature)
@@ -15,7 +15,8 @@
C.adjustFireLoss(rand(5,25) * weakness)
C.adjustBrainLoss(rand(5,25) * weakness)
C.apply_effect(25 * weakness, IRRADIATE, blocked = C.getarmor(null, "rad"))
C.nutrition -= min(50 * weakness, C.nutrition)
C.adjustNutritionLoss(50 * weakness)
C.adjustHydrationLoss(50 * weakness)
C.make_dizzy(6 * weakness)
C.weakened += 6 * weakness
+1 -1
View File
@@ -329,7 +329,7 @@
name = "Appetiser Effect"
stage = 2
activate(var/mob/living/carbon/mob,var/multiplier)
mob.nutrition = max(0, mob.nutrition - 200)
mob.adjustNutritionLoss(200)
/datum/disease2/effect/fridge
name = "Refridgerator Syndrome"