diff --git a/code/__defines/mobs.dm b/code/__defines/mobs.dm index beeda302eb..548cabd73c 100644 --- a/code/__defines/mobs.dm +++ b/code/__defines/mobs.dm @@ -426,4 +426,6 @@ #define EXAMINE_SKIPARMS 0x0020 #define EXAMINE_SKIPHANDS 0x0040 #define EXAMINE_SKIPLEGS 0x0080 -#define EXAMINE_SKIPFEET 0x0100 \ No newline at end of file +#define EXAMINE_SKIPFEET 0x0100 + +#define MAX_NUTRITION 5000 //VOREStation Edit \ No newline at end of file diff --git a/code/game/gamemodes/changeling/powers/absorb.dm b/code/game/gamemodes/changeling/powers/absorb.dm index a76311c335..e532396176 100644 --- a/code/game/gamemodes/changeling/powers/absorb.dm +++ b/code/game/gamemodes/changeling/powers/absorb.dm @@ -3,11 +3,11 @@ desc = "Permits us to syphon the DNA from a human. They become one with us, and we become stronger if they were of our kind." ability_icon_state = "ling_absorb_dna" genomecost = 0 - verbpath = /mob/proc/changeling_absorb_dna + verbpath = /mob/living/proc/changeling_absorb_dna //Absorbs the victim's DNA. Requires a strong grip on the victim. //Doesn't cost anything as it's the most basic ability. -/mob/proc/changeling_absorb_dna() +/mob/living/proc/changeling_absorb_dna() set category = "Changeling" set name = "Absorb DNA" @@ -67,8 +67,7 @@ to_chat(src, "We have absorbed [T]!") src.visible_message("[src] sucks the fluids from [T]!") to_chat(T, "You have been absorbed by the changeling!") - if(src.nutrition < 400) - src.nutrition = min((src.nutrition + T.nutrition), 400) + adjust_nutrition(T.nutrition) changeling.chem_charges += 10 if(changeling.readapts <= 0) changeling.readapts = 0 //SANITYYYYYY diff --git a/code/game/gamemodes/changeling/powers/unfat_sting.dm b/code/game/gamemodes/changeling/powers/unfat_sting.dm index ece0d50f46..34ef7b7032 100644 --- a/code/game/gamemodes/changeling/powers/unfat_sting.dm +++ b/code/game/gamemodes/changeling/powers/unfat_sting.dm @@ -13,7 +13,6 @@ if(!T) return 0 add_attack_logs(src,T,"Unfat sting (changeling)") to_chat(T, "you feel a small prick as stomach churns violently and you become to feel skinnier.") - T.overeatduration = 0 - T.nutrition -= 100 + T.adjust_nutrition(-100) feedback_add_details("changeling_powers","US") return 1 \ No newline at end of file diff --git a/code/game/gamemodes/technomancer/spells/energy_siphon.dm b/code/game/gamemodes/technomancer/spells/energy_siphon.dm index 1bfcb4e2d2..21f7c6e1e7 100644 --- a/code/game/gamemodes/technomancer/spells/energy_siphon.dm +++ b/code/game/gamemodes/technomancer/spells/energy_siphon.dm @@ -83,7 +83,7 @@ #define SIPHON_CORE_TO_ENERGY 0.5 // This is called every tick, so long as a link exists between the target and the Technomancer. -/obj/item/weapon/spell/energy_siphon/proc/siphon(atom/movable/siphoning, mob/user) +/obj/item/weapon/spell/energy_siphon/proc/siphon(atom/movable/siphoning, mob/living/user) var/list/things_to_drain = things_to_siphon // Temporary list copy of what we're gonna steal from. var/charge_to_give = 0 // How much energy to give to the Technomancer at the end. var/flow_remaining = calculate_spell_power(flow_rate) @@ -141,7 +141,7 @@ if( (core.max_energy - core.energy) < charge_to_give ) // We have some overflow, if this is true. if(user.isSynthetic()) // Let's do something with it, if we're a robot. charge_to_give = charge_to_give - (core.max_energy - core.energy) - user.nutrition = min(user.nutrition + (charge_to_give / SIPHON_FBP_TO_ENERGY), 400) + user.adjust_nutrition(charge_to_give / SIPHON_FBP_TO_ENERGY) to_chat(user, "Redirected energy to internal microcell.") else to_chat(user, "Stolen [charge_to_give * CELLRATE] kJ.") diff --git a/code/game/machinery/computer/arcade.dm b/code/game/machinery/computer/arcade.dm index c5542777a2..86f3fe93da 100644 --- a/code/game/machinery/computer/arcade.dm +++ b/code/game/machinery/computer/arcade.dm @@ -384,7 +384,7 @@ spaceport_freebie = 0 last_spaceport_action = "" -/obj/machinery/computer/arcade/orion_trail/attack_hand(mob/user) +/obj/machinery/computer/arcade/orion_trail/attack_hand(mob/living/user) if(..()) return if(fuel <= 0 || food <=0 || settlers.len == 0) diff --git a/code/game/machinery/rechargestation.dm b/code/game/machinery/rechargestation.dm index c11c82eda3..d3db41ff2d 100644 --- a/code/game/machinery/rechargestation.dm +++ b/code/game/machinery/rechargestation.dm @@ -105,8 +105,8 @@ H.adjustBrainLoss(-(rand(1,3))) // Also recharge their internal battery. - if(H.isSynthetic() && H.nutrition < 450) - H.nutrition = min(H.nutrition+10, 450) + if(H.isSynthetic() && H.nutrition < MAX_NUTRITION) + H.nutrition = min(H.nutrition+10, MAX_NUTRITION) cell.use(7000/450*10) // And clear up radiation diff --git a/code/game/objects/items/crayons.dm b/code/game/objects/items/crayons.dm index 45ad1fa5b8..198288311c 100644 --- a/code/game/objects/items/crayons.dm +++ b/code/game/objects/items/crayons.dm @@ -109,7 +109,7 @@ qdel(src) return -/obj/item/weapon/pen/crayon/attack(mob/M as mob, mob/user as mob) +/obj/item/weapon/pen/crayon/attack(mob/living/M as mob, mob/living/user as mob) if(M == user) to_chat(user, "You take a bite of the crayon and swallow it.") user.nutrition += 1 @@ -195,7 +195,7 @@ shadeColour = input(user, "Please select the shade colour.", "Marker colour") as color return -/obj/item/weapon/pen/crayon/marker/attack(mob/M as mob, mob/user as mob) +/obj/item/weapon/pen/crayon/marker/attack(mob/living/M as mob, mob/living/user as mob) if(M == user) to_chat(user, "You take a bite of the marker and swallow it.") user.nutrition += 1 diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm index a085e59d24..06197f202d 100644 --- a/code/game/objects/items/devices/scanners.dm +++ b/code/game/objects/items/devices/scanners.dm @@ -492,7 +492,7 @@ HALOGEN COUNTER - Radcount on mobs for(var/potential_color in S.slime_mutation) var/mob/living/simple_mob/slime/xenobio/slime = potential_color mutations.Add(initial(slime.slime_color)) - user.show_message("Potental to mutate into [english_list(mutations)] colors.
Extract potential: [S.cores]
Nutrition: [S.nutrition]/[S.get_max_nutrition()]") + user.show_message("Potental to mutate into [english_list(mutations)] colors.
Extract potential: [S.cores]
Nutrition: [S.nutrition]/[S.max_nutrition]") if (S.nutrition < S.get_starve_nutrition()) user.show_message("Warning: Subject is starving!") diff --git a/code/game/objects/items/weapons/implants/implantreagent_vr.dm b/code/game/objects/items/weapons/implants/implantreagent_vr.dm index 4597cbe0a8..ddaa6680c8 100644 --- a/code/game/objects/items/weapons/implants/implantreagent_vr.dm +++ b/code/game/objects/items/weapons/implants/implantreagent_vr.dm @@ -38,11 +38,12 @@ /obj/item/weapon/implant/reagent_generator/process() var/before_gen - if(imp_in && generated_reagents) + if(isliving(imp_in) && generated_reagents) before_gen = reagents.total_volume + var/mob/living/L = imp_in if(reagents.total_volume < reagents.maximum_volume) - if(imp_in.nutrition >= gen_cost) - do_generation() + if(L.nutrition >= gen_cost) + do_generation(L) else return else @@ -55,8 +56,8 @@ else if(reagents.total_volume == reagents.maximum_volume && before_gen < reagents.maximum_volume) to_chat(imp_in, "[pick(full_message)]") -/obj/item/weapon/implant/reagent_generator/proc/do_generation() - imp_in.nutrition -= gen_cost +/obj/item/weapon/implant/reagent_generator/proc/do_generation(var/mob/living/L) + L.adjust_nutrition(-gen_cost) for(var/reagent in generated_reagents) reagents.add_reagent(reagent, generated_reagents[reagent]) diff --git a/code/game/objects/items/weapons/inducer_vr.dm b/code/game/objects/items/weapons/inducer_vr.dm index 8d92ea3ffe..998447b5fa 100644 --- a/code/game/objects/items/weapons/inducer_vr.dm +++ b/code/game/objects/items/weapons/inducer_vr.dm @@ -267,7 +267,7 @@ /obj/item/weapon/cell/standin/give(var/amount) . = ..(amount * NUTRITION_COEFF) //Shrink amount to store - hume.nutrition += . //Add the amount we really stored + hume.adjust_nutrition(.) //Add the amount we really stored . /= NUTRITION_COEFF //Inflate amount to take from the giver #undef NUTRITION_COEFF diff --git a/code/game/objects/structures/fitness.dm b/code/game/objects/structures/fitness.dm index 158bf5533b..f0b121a1aa 100644 --- a/code/game/objects/structures/fitness.dm +++ b/code/game/objects/structures/fitness.dm @@ -57,7 +57,7 @@ flick("[icon_state]_[weight]", src) if(do_after(user, 20 + (weight * 10))) playsound(src.loc, 'sound/effects/weightdrop.ogg', 25, 1) - user.nutrition -= weight * 10 + user.adjust_nutrition(weight * -10) to_chat(user, "You lift the weights [qualifiers[weight]].") being_used = 0 else diff --git a/code/modules/food/food/snacks.dm b/code/modules/food/food/snacks.dm index 3bcf7d3440..a3f16a3563 100644 --- a/code/modules/food/food/snacks.dm +++ b/code/modules/food/food/snacks.dm @@ -43,7 +43,7 @@ /obj/item/weapon/reagent_containers/food/snacks/attack_self(mob/user as mob) return -/obj/item/weapon/reagent_containers/food/snacks/attack(mob/M as mob, mob/user as mob, def_zone) +/obj/item/weapon/reagent_containers/food/snacks/attack(mob/living/M as mob, mob/user as mob, def_zone) if(reagents && !reagents.total_volume) to_chat(user, "None of [src] left!") user.drop_from_inventory(src) @@ -92,9 +92,6 @@ if (fullness > 6000) // There has to be a limit eventually. to_chat(M, "Your stomach blorts and aches, prompting you to stop. You literally cannot force any more of [src] to go down your throat.") return 0 - /*if (fullness > (550 * (1 + M.overeatduration / 2000))) // The more you eat - the more you can eat - to_chat(M, "You cannot force any more of [src] to go down your throat.") - return 0*/ //VOREStation Edit End else if(user.a_intent == I_HURT) @@ -123,12 +120,7 @@ to_chat(user, "\The [blocked] is in the way!") return - /*if (fullness <= (550 * (1 + M.overeatduration / 1000))) // Vorestation edit - user.visible_message("[user] attempts to feed [M] [src].") - else - user.visible_message("[user] cannot force anymore of [src] down [M]'s throat.") - return 0*/ - user.visible_message("[user] attempts to feed [M] [src].") // Vorestation edit + user.visible_message("[user] attempts to feed [M] [src].") user.setClickCooldown(user.get_attack_speed(src)) if(!do_mob(user, M)) return diff --git a/code/modules/mob/_modifiers/modifiers_misc.dm b/code/modules/mob/_modifiers/modifiers_misc.dm index 8e6a094910..e7af15895c 100644 --- a/code/modules/mob/_modifiers/modifiers_misc.dm +++ b/code/modules/mob/_modifiers/modifiers_misc.dm @@ -83,7 +83,7 @@ the artifact triggers the rage. /datum/modifier/berserk/on_applied() if(ishuman(holder)) // Most other mobs don't really use nutrition and can't get it back. - holder.nutrition = max(0, holder.nutrition - nutrition_cost) + holder.adjust_nutrition(-nutrition_cost) holder.visible_message("\The [holder] descends into an all consuming rage!") // End all stuns. diff --git a/code/modules/mob/_modifiers/unholy.dm b/code/modules/mob/_modifiers/unholy.dm index 730e57691c..64d7a99d38 100644 --- a/code/modules/mob/_modifiers/unholy.dm +++ b/code/modules/mob/_modifiers/unholy.dm @@ -184,7 +184,7 @@ if(ishuman(holder)) var/mob/living/carbon/human/H = holder var/starting_nutrition = H.nutrition - H.nutrition = max(0, H.nutrition - 10) + H.adjust_nutrition(-10) var/healing_amount = starting_nutrition - H.nutrition if(healing_amount < 0) // If you are eating enough to somehow outpace this, congratulations, you are gluttonous enough to gain a boon. healing_amount *= -2 diff --git a/code/modules/mob/living/carbon/alien/diona/life.dm b/code/modules/mob/living/carbon/alien/diona/life.dm index aa178f93c1..fe97e96674 100644 --- a/code/modules/mob/living/carbon/alien/diona/life.dm +++ b/code/modules/mob/living/carbon/alien/diona/life.dm @@ -6,16 +6,14 @@ var/turf/T = loc light_amount = T.get_lumcount() * 5 - nutrition += light_amount + adjust_nutrition(light_amount) - if(nutrition > 500) - nutrition = 500 if(light_amount > 2) //if there's enough light, heal adjustBruteLoss(-1) adjustFireLoss(-1) adjustToxLoss(-1) adjustOxyLoss(-1) - - + + if(!client) - handle_npc(src) + handle_npc(src) diff --git a/code/modules/mob/living/carbon/alien/life.dm b/code/modules/mob/living/carbon/alien/life.dm index 3b57c6a5f7..0bd0ac89b1 100644 --- a/code/modules/mob/living/carbon/alien/life.dm +++ b/code/modules/mob/living/carbon/alien/life.dm @@ -28,7 +28,7 @@ var/rads = radiation/25 radiation -= rads - nutrition += rads + adjust_nutrition(rads) heal_overall_damage(rads,rads) adjustOxyLoss(-(rads)) adjustToxLoss(-(rads)) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 894885fe5e..c11cf6bac0 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -36,12 +36,14 @@ /* VOREStation Edit - Duplicated in our code /mob/living/carbon/Moved(atom/old_loc, direction, forced = FALSE) . = ..() - if(src.nutrition && src.stat != 2) - src.nutrition -= DEFAULT_HUNGER_FACTOR/10 - if(src.m_intent == "run") - src.nutrition -= DEFAULT_HUNGER_FACTOR/10 - if((FAT in src.mutations) && src.m_intent == "run" && src.bodytemperature <= 360) - src.bodytemperature += 2 + if(.) + if(src.nutrition && src.stat != 2) + adjust_nutrition(-DEFAULT_HUNGER_FACTOR / 10) + if(src.m_intent == "run") + adjust_nutrition(-DEFAULT_HUNGER_FACTOR / 10) + + if((FAT in src.mutations) && src.m_intent == "run" && src.bodytemperature <= 360) + src.bodytemperature += 2 // Moving around increases germ_level faster if(germ_level < GERM_LEVEL_MOVE_CAP && prob(8)) @@ -109,7 +111,7 @@ src.apply_damage(0.4 * shock_damage, BURN, BP_TORSO, used_weapon="Electrocution") //shock the torso more src.apply_damage(0.2 * shock_damage, BURN, null, used_weapon="Electrocution") //shock a random part! src.apply_damage(0.2 * shock_damage, BURN, null, used_weapon="Electrocution") //shock a random part! - + playsound(loc, "sparks", 50, 1, -1) if (shock_damage > 15) src.visible_message( diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 7756829bf1..381133a217 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1141,6 +1141,7 @@ // Clear out their species abilities. species.remove_inherent_verbs(src) holder_type = null + hunger_rate = initial(hunger_rate) //VOREStation Add species = GLOB.all_species[new_species] @@ -1184,6 +1185,7 @@ maxHealth = species.total_health + hunger_rate = species.hunger_factor //VOREStation Add if(LAZYLEN(descriptors)) descriptors = null diff --git a/code/modules/mob/living/carbon/human/human_movement.dm b/code/modules/mob/living/carbon/human/human_movement.dm index 2c08449e1e..225aada7e0 100644 --- a/code/modules/mob/living/carbon/human/human_movement.dm +++ b/code/modules/mob/living/carbon/human/human_movement.dm @@ -27,7 +27,7 @@ if(can_feel_pain()) if(halloss >= 10) tally += (halloss / 10) //halloss shouldn't slow you down if you can't even feel it - var/hungry = (500 - nutrition)/5 // So overeat would be 100 and default level would be 80 + var/hungry = (MAX_NUTRITION - nutrition) / 5 if (hungry >= 70) tally += hungry/50 //VOREstation start diff --git a/code/modules/mob/living/carbon/human/human_powers.dm b/code/modules/mob/living/carbon/human/human_powers.dm index cb053663e0..acc4607191 100644 --- a/code/modules/mob/living/carbon/human/human_powers.dm +++ b/code/modules/mob/living/carbon/human/human_powers.dm @@ -302,7 +302,7 @@ var/delay_length = round(active_regen_delay * species.active_regen_mult) if(do_after(src,delay_length)) - nutrition -= 200 + adjust_nutrition(-200) for(var/obj/item/organ/I in internal_organs) if(I.robotic >= ORGAN_ROBOT) // No free robofix. @@ -345,5 +345,5 @@ active_regen = FALSE else to_chat(src, "Your regeneration is interrupted!") - nutrition -= 75 + adjust_nutrition(-75) active_regen = FALSE diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 50156c808f..34530434f1 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -275,7 +275,7 @@ if(rad_organ && !rad_organ.is_broken()) var/rads = radiation/25 radiation -= rads - nutrition += rads + adjust_nutrition(rads) adjustBruteLoss(-(rads)) adjustFireLoss(-(rads)) adjustOxyLoss(-(rads)) @@ -794,7 +794,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 + adjust_nutrition(-2) var/recovery_amt = max((body_temperature_difference / BODYTEMP_AUTORECOVERY_DIVISOR), BODYTEMP_AUTORECOVERY_MINIMUM) //to_world("Cold. Difference = [body_temperature_difference]. Recovering [recovery_amt]") // log_debug("Cold. Difference = [body_temperature_difference]. Recovering [recovery_amt]") @@ -925,15 +925,7 @@ for(var/datum/modifier/mod in modifiers) if(!isnull(mod.metabolism_percent)) nutrition_reduction *= mod.metabolism_percent - - nutrition = max (0, nutrition - nutrition_reduction) - - if (nutrition > 450) - if(overeatduration < 600) //capped so people don't take forever to unfat - overeatduration++ - else - if(overeatduration > 1) - overeatduration -= 2 //doubled the unfat rate + adjust_nutrition(-nutrition_reduction) if(noisy == TRUE && nutrition < 250 && prob(10)) //VOREStation edit for hunger noises. var/sound/growlsound = sound(get_sfx("hunger_sounds")) @@ -1469,7 +1461,7 @@ if(air_master.current_cycle%3==1) if(!(M.status_flags & GODMODE)) M.adjustBruteLoss(5) - nutrition += 10 + adjust_nutrition(10) /mob/living/carbon/human/proc/handle_changeling() if(mind && mind.changeling) diff --git a/code/modules/mob/living/carbon/human/life_vr.dm b/code/modules/mob/living/carbon/human/life_vr.dm index 8120e504d9..a513fc3df0 100644 --- a/code/modules/mob/living/carbon/human/life_vr.dm +++ b/code/modules/mob/living/carbon/human/life_vr.dm @@ -60,19 +60,13 @@ //Overriding carbon move proc that forces default hunger factor /mob/living/carbon/Moved(atom/old_loc, direction, forced = FALSE) . = ..() - if(src.nutrition && src.stat != 2) - if(ishuman(src)) - var/mob/living/carbon/human/M = src - if(M.stat != 2 && M.nutrition > 0) - M.nutrition -= M.species.hunger_factor/10 - if(M.m_intent == "run") - M.nutrition -= M.species.hunger_factor/10 - if(M.nutrition < 0) - M.nutrition = 0 - else - src.nutrition -= DEFAULT_HUNGER_FACTOR/10 - if(src.m_intent == "run") - src.nutrition -= DEFAULT_HUNGER_FACTOR/10 + + // Technically this does mean being dragged takes nutrition + if(stat != DEAD) + adjust_nutrition(hunger_rate/-10) + if(m_intent == "run") + adjust_nutrition(hunger_rate/-10) + // Moving around increases germ_level faster if(germ_level < GERM_LEVEL_MOVE_CAP && prob(8)) germ_level++ \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/species/station/alraune.dm b/code/modules/mob/living/carbon/human/species/station/alraune.dm index ce04cbcef9..b78d7caf78 100644 --- a/code/modules/mob/living/carbon/human/species/station/alraune.dm +++ b/code/modules/mob/living/carbon/human/species/station/alraune.dm @@ -217,7 +217,7 @@ H.adjustFireLoss(-(light_amount * co2buff)) //this won't let you tank environmental damage from fire. MAYBE cold until your body temp drops. if(H.nutrition < (200 + 400*co2buff)) //if no CO2, a fully lit tile gives them 1/tick up to 200. With CO2, potentially up to 600. - H.nutrition += (light_amount*(1+co2buff*5)) + H.adjust_nutrition(light_amount*(1+co2buff*5)) // Too much poison in the air. if(toxins_pp > safe_toxins_max) @@ -357,7 +357,7 @@ var/short_emote_descriptor = list("picks", "grabs") var/self_emote_descriptor = list("grab", "pick", "snatch") var/fruit_type = "apple" - var/mob/organ_owner = null + var/mob/living/organ_owner = null var/gen_cost = 0.5 /obj/item/organ/internal/fruitgland/New() @@ -382,7 +382,7 @@ to_chat(organ_owner, "[pick(full_message)]") /obj/item/organ/internal/fruitgland/proc/do_generation() - organ_owner.nutrition -= gen_cost + organ_owner.adjust_nutrition(-gen_cost) for(var/reagent in generated_reagents) reagents.add_reagent(reagent, generated_reagents[reagent]) diff --git a/code/modules/mob/living/carbon/human/species/station/prometheans.dm b/code/modules/mob/living/carbon/human/species/station/prometheans.dm index 57a3ecb8f4..c6f71cad25 100644 --- a/code/modules/mob/living/carbon/human/species/station/prometheans.dm +++ b/code/modules/mob/living/carbon/human/species/station/prometheans.dm @@ -189,32 +189,34 @@ var/datum/species/shapeshifter/promethean/prometheans if(!(H.shoes || (H.wear_suit && (H.wear_suit.body_parts_covered & FEET)))) for(var/obj/O in T) O.clean_blood() - H.nutrition = min(500, max(0, H.nutrition + rand(5, 15))) + H.adjust_nutrition(rand(5, 15)) if (istype(T, /turf/simulated)) var/turf/simulated/S = T T.clean_blood() S.dirt = 0 - H.nutrition = max(H.nutrition, min(500, H.nutrition + rand(15, 30))) //VOREStation Edit: Gives nutrition up to a point instead of being capped + //VOREStation Edit Start + H.adjust_nutrition(H.nutrition < 500 ? rand(15, 30) : 0) if(H.clean_blood(1)) - H.nutrition = max(H.nutrition, min(500, H.nutrition + rand(15, 30))) //VOREStation Edit: Gives nutrition up to a point instead of being capped + H.adjust_nutrition(H.nutrition < 500 ? rand(15, 30) : 0) if(H.r_hand) if(H.r_hand.clean_blood()) - H.nutrition = max(H.nutrition, min(500, H.nutrition + rand(15, 30))) //VOREStation Edit: Gives nutrition up to a point instead of being capped + H.adjust_nutrition(H.nutrition < 500 ? rand(15, 30) : 0) if(H.l_hand) if(H.l_hand.clean_blood()) - H.nutrition = max(H.nutrition, min(500, H.nutrition + rand(15, 30))) //VOREStation Edit: Gives nutrition up to a point instead of being capped + H.adjust_nutrition(H.nutrition < 500 ? rand(15, 30) : 0) if(H.head) if(H.head.clean_blood()) H.update_inv_head(0) - H.nutrition = max(H.nutrition, min(500, H.nutrition + rand(15, 30))) //VOREStation Edit: Gives nutrition up to a point instead of being capped + H.adjust_nutrition(H.nutrition < 500 ? rand(15, 30) : 0) if(H.wear_suit) if(H.wear_suit.clean_blood()) H.update_inv_wear_suit(0) - H.nutrition = max(H.nutrition, min(500, H.nutrition + rand(15, 30))) //VOREStation Edit: Gives nutrition up to a point instead of being capped + H.adjust_nutrition(H.nutrition < 500 ? rand(15, 30) : 0) if(H.w_uniform) if(H.w_uniform.clean_blood()) H.update_inv_w_uniform(0) - H.nutrition = max(H.nutrition, min(500, H.nutrition + rand(15, 30))) //VOREStation Edit: Gives nutrition up to a point instead of being capped + H.adjust_nutrition(H.nutrition < 500 ? rand(15, 30) : 0) + //VOREStation Edit End //End cleaning code. var/datum/gas_mixture/environment = T.return_air() @@ -297,8 +299,7 @@ var/datum/species/shapeshifter/promethean/prometheans if(ToxReg) strain_negation += to_pay * max(0, (1 - ToxReg.get_strain_percent())) - H.nutrition -= (3 * nutrition_cost) //Costs Nutrition when damage is being repaired, corresponding to the amount of damage being repaired. - H.nutrition = max(0, H.nutrition) //Ensure it's not below 0. + H.adjust_nutrition(-(3 * nutrition_cost)) // Costs Nutrition when damage is being repaired, corresponding to the amount of damage being repaired. var/agony_to_apply = ((1 / starve_mod) * (nutrition_cost - strain_negation)) //Regenerating damage causes minor pain over time, if the organs responsible are nonexistant or too high on strain. Small injures will be no issue, large ones will cause problems. diff --git a/code/modules/mob/living/carbon/human/species/station/station.dm b/code/modules/mob/living/carbon/human/species/station/station.dm index 4e64d59d72..6e06efef0c 100644 --- a/code/modules/mob/living/carbon/human/species/station/station.dm +++ b/code/modules/mob/living/carbon/human/species/station/station.dm @@ -586,11 +586,9 @@ if(isturf(H.loc)) //else, there's considered to be no light var/turf/T = H.loc light_amount = T.get_lumcount() * 10 - H.nutrition += light_amount + H.adjust_nutrition(light_amount) H.shock_stage -= light_amount - if(H.nutrition > 450) - H.nutrition = 450 if(light_amount >= 3) //if there's enough light, heal H.adjustBruteLoss(-(round(light_amount/2))) H.adjustFireLoss(-(round(light_amount/2))) diff --git a/code/modules/mob/living/carbon/human/species/station/station_special_abilities_vr.dm b/code/modules/mob/living/carbon/human/species/station/station_special_abilities_vr.dm index 772d9881cf..fa6bed5c10 100644 --- a/code/modules/mob/living/carbon/human/species/station/station_special_abilities_vr.dm +++ b/code/modules/mob/living/carbon/human/species/station/station_special_abilities_vr.dm @@ -390,7 +390,7 @@ src.visible_message("[src] suddenly extends their fangs and plunges them down into [B]'s neck!") B.apply_damage(5, BRUTE, BP_HEAD) //You're getting fangs pushed into your neck. What do you expect???? B.drip(80) //Remove enough blood to make them a bit woozy, but not take oxyloss. - src.nutrition += 400 + adjust_nutrition(400) sleep(50) B.drip(1) sleep(50) @@ -836,7 +836,7 @@ if(!C.anchored && !C.pulledby) //Not currently anchored, and not pulled by anyone. C.anchored = 1 //This is the only way to stop the inertial_drift. - C.nutrition -= 25 + C.adjust_nutrition(-25) update_floating() to_chat(C, "You hover in place.") spawn(6) //.6 seconds. diff --git a/code/modules/mob/living/carbon/human/species/station/station_special_vr.dm b/code/modules/mob/living/carbon/human/species/station/station_special_vr.dm index e9865bc966..520b984a0b 100644 --- a/code/modules/mob/living/carbon/human/species/station/station_special_vr.dm +++ b/code/modules/mob/living/carbon/human/species/station/station_special_vr.dm @@ -376,7 +376,7 @@ icobase_tail = 1 inherent_verbs = list( - /mob/proc/weaveWebBindings) + /mob/living/proc/weaveWebBindings) min_age = 18 max_age = 80 diff --git a/code/modules/mob/living/carbon/lick_wounds.dm b/code/modules/mob/living/carbon/lick_wounds.dm index c712448f8a..4fde4ab24d 100644 --- a/code/modules/mob/living/carbon/lick_wounds.dm +++ b/code/modules/mob/living/carbon/lick_wounds.dm @@ -74,7 +74,7 @@ "uses their tongue to disinfect \a [W.desc] on [M]'s [affecting.name].", "licks \a [W.desc] on [M]'s [affecting.name], cleaning it.")]", \ "You treat \a [W.desc] on [M]'s [affecting.name] with your antiseptic saliva." ) - nutrition -= 20 + adjust_nutrition(-20) W.salve() W.bandage() W.disinfect() diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 1ab0cdba02..48facacd98 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -1086,7 +1086,7 @@ default behaviour is: if(getBruteLoss() < 50) adjustBruteLoss(3) else - nutrition -= 40 + adjust_nutrition(-40) adjustToxLoss(-3) spawn(350) @@ -1362,6 +1362,9 @@ default behaviour is: /mob/living/proc/needs_to_breathe() return !isSynthetic() +/mob/living/proc/adjust_nutrition(amount) + nutrition = between(0, nutrition + amount, max_nutrition) + /mob/living/vv_get_header() . = ..() . += {" diff --git a/code/modules/mob/living/living_defines.dm b/code/modules/mob/living/living_defines.dm index 8e3b9fb9a4..92416a25f3 100644 --- a/code/modules/mob/living/living_defines.dm +++ b/code/modules/mob/living/living_defines.dm @@ -18,6 +18,9 @@ var/brainloss = 0 //'Retardation' damage caused by someone hitting you in the head with a bible or being infected with brainrot. var/halloss = 0 //Hallucination damage. 'Fake' damage obtained through hallucinating or the holodeck. Sleeping should cause it to wear off. + var/nutrition = 400 + var/max_nutrition = MAX_NUTRITION + var/hallucination = 0 //Directly affects how long a mob will hallucinate for var/list/atom/hallucinations = list() //A list of hallucinated people that try to attack the mob. See /obj/effect/fake_attacker in hallucinations.dm diff --git a/code/modules/mob/living/living_defines_vr.dm b/code/modules/mob/living/living_defines_vr.dm index b3f38e8013..8b99c7aefb 100644 --- a/code/modules/mob/living/living_defines_vr.dm +++ b/code/modules/mob/living/living_defines_vr.dm @@ -5,6 +5,7 @@ var/ooc_notes = null var/obj/structure/mob_spawner/source_spawner = null appearance_flags = TILE_BOUND|PIXEL_SCALE|KEEP_TOGETHER + var/hunger_rate = DEFAULT_HUNGER_FACTOR //custom say verbs var/custom_say = null diff --git a/code/modules/mob/living/simple_mob/subtypes/slime/xenobio/consumption.dm b/code/modules/mob/living/simple_mob/subtypes/slime/xenobio/consumption.dm index 13764d20fd..7b43a09b2b 100644 --- a/code/modules/mob/living/simple_mob/subtypes/slime/xenobio/consumption.dm +++ b/code/modules/mob/living/simple_mob/subtypes/slime/xenobio/consumption.dm @@ -1,8 +1,7 @@ // Handles hunger, starvation, growth, and eatting humans. -// Might be best to make this a /mob/living proc and override. -/mob/living/simple_mob/slime/xenobio/proc/adjust_nutrition(input, var/heal = 1) - nutrition = between(0, nutrition + input, get_max_nutrition()) +/mob/living/simple_mob/slime/xenobio/adjust_nutrition(input, var/heal = 1) + ..(input) if(input > 0) // Gain around one level per 50 nutrition. @@ -19,10 +18,6 @@ adjustOxyLoss(-input * 0.2) adjustCloneLoss(-input * 0.2) - -/mob/living/simple_mob/slime/xenobio/proc/get_max_nutrition() // Can't go above it - return is_adult ? 1200 : 1000 - /mob/living/simple_mob/slime/xenobio/proc/get_grow_nutrition() // Above it we grow, below it we can eat return is_adult ? 1000 : 800 diff --git a/code/modules/mob/living/simple_mob/subtypes/slime/xenobio/xenobio.dm b/code/modules/mob/living/simple_mob/subtypes/slime/xenobio/xenobio.dm index 3437d05ba2..ba2d76b39f 100644 --- a/code/modules/mob/living/simple_mob/subtypes/slime/xenobio/xenobio.dm +++ b/code/modules/mob/living/simple_mob/subtypes/slime/xenobio/xenobio.dm @@ -4,6 +4,7 @@ desc = "The most basic of slimes. The grey slime has no remarkable qualities, however it remains one of the most useful colors for scientists." layer = MOB_LAYER + 1 // Need them on top of other mobs or it looks weird when consuming something. ai_holder_type = /datum/ai_holder/simple_mob/xenobio_slime // This should never be changed for xenobio slimes. + max_nutrition = 1000 var/is_adult = FALSE // Slimes turn into adults when fed enough. Adult slimes are somewhat stronger, and can reproduce if fed enough. var/maxHealth_adult = 200 var/power_charge = 0 // Disarm attacks can shock someone if high/lucky enough. @@ -101,6 +102,7 @@ melee_damage_lower = round(melee_damage_lower * 2) // 20 melee_damage_upper = round(melee_damage_upper * 2) // 30 maxHealth = maxHealth_adult + max_nutrition = 1200 amount_grown = 0 update_icon() update_name() diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index 6fab127084..27029f7e08 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -112,9 +112,7 @@ var/bodytemperature = 310.055 //98.7 F var/drowsyness = 0.0//Carbon var/charges = 0.0 - var/nutrition = 400.0//Carbon - var/overeatduration = 0 // How long this guy is overeating //Carbon var/paralysis = 0.0 var/stunned = 0.0 var/weakened = 0.0 diff --git a/code/modules/multiz/movement.dm b/code/modules/multiz/movement.dm index 0ccb640487..8ccae7289d 100644 --- a/code/modules/multiz/movement.dm +++ b/code/modules/multiz/movement.dm @@ -205,38 +205,33 @@ if(throwing) return - if(ismob(src)) - var/mob/H = src //VOREStation Edit Start. Flight on mobs. - if(H.flying) //Some other checks are done in the wings_toggle proc - if(H.nutrition > 2) - H.nutrition -= 2 //You use up 2 nutrition per TILE and tick of flying above open spaces. If people wanna flap their wings in the hallways, shouldn't penalize them for it. - if(H.incapacitated(INCAPACITATION_ALL)) - H.stop_flying() + //VOREStation Edit Start. Flight on mobs. + if(isliving(src)) + var/mob/living/L = src //VOREStation Edit Start. Flight on mobs. + if(L.flying) //Some other checks are done in the wings_toggle proc + if(L.nutrition > 2) + L.adjust_nutrition(-2) //You use up 2 nutrition per TILE and tick of flying above open spaces. If people wanna flap their wings in the hallways, shouldn't penalize them for it. + if(L.incapacitated(INCAPACITATION_ALL)) + L.stop_flying() //Just here to see if the person is KO'd, stunned, etc. If so, it'll move onto can_fall. - else if (H.nutrition > 1000) //Eat too much while flying? Get fat and fall. - to_chat(H, "You're too heavy! Your wings give out and you plummit to the ground!") - H.stop_flying() //womp womp. - else if(H.nutrition < 300 && H.nutrition > 289) //290 would be risky, as metabolism could mess it up. Let's do 289. - to_chat(H, "You are starting to get fatigued... You probably have a good minute left in the air, if that. Even less if you continue to fly around! You should get to the ground soon!") //Ticks are, on average, 3 seconds. So this would most likely be 90 seconds, but lets just say 60. - H.nutrition -= 10 + else if (L.nutrition > 1000) //Eat too much while flying? Get fat and fall. + to_chat(L, "You're too heavy! Your wings give out and you plummit to the ground!") + L.stop_flying() //womp womp. + else if(L.nutrition < 300 && L.nutrition > 289) //290 would be risky, as metabolism could mess it up. Let's do 289. + to_chat(L, "You are starting to get fatigued... You probably have a good minute left in the air, if that. Even less if you continue to fly around! You should get to the ground soon!") //Ticks are, on average, 3 seconds. So this would most likely be 90 seconds, but lets just say 60. + L.adjust_nutrition(-10) return - else if(H.nutrition < 100 && H.nutrition > 89) - to_chat(H, "You're seriously fatigued! You need to get to the ground immediately and eat before you fall!") + else if(L.nutrition < 100 && L.nutrition > 89) + to_chat(L, "You're seriously fatigued! You need to get to the ground immediately and eat before you fall!") return - else if(H.nutrition < 2) //Should have listened to the warnings! - to_chat(H, "You lack the strength to keep yourself up in the air...") - H.stop_flying() + else if(L.nutrition < 2) //Should have listened to the warnings! + to_chat(L, "You lack the strength to keep yourself up in the air...") + L.stop_flying() else return - else if(ishuman(H)) //Needed to prevent 2 people from grabbing eachother in the air. - var/mob/living/carbon/human/F = H - if(F.grabbed_by.len) //If you're grabbed (presumably by someone flying) let's not have you fall. This also allows people to grab onto you while you jump over a railing to prevent you from falling! - var/obj/item/weapon/grab/G = F.get_active_hand() - var/obj/item/weapon/grab/J = F.get_inactive_hand() - if(istype(G) || istype(J)) - //fall - else - return + if(LAZYLEN(L.grabbed_by)) //If you're grabbed (presumably by someone flying) let's not have you fall. This also allows people to grab onto you while you jump over a railing to prevent you from falling! + return + //VOREStation Edit End if(can_fall()) // We spawn here to let the current move operation complete before we start falling. fall() is normally called from diff --git a/code/modules/nifsoft/nif.dm b/code/modules/nifsoft/nif.dm index 32564c5c6f..0b167e135b 100644 --- a/code/modules/nifsoft/nif.dm +++ b/code/modules/nifsoft/nif.dm @@ -376,7 +376,7 @@ You can also set the stat of a NIF to NIF_TEMPFAIL without any issues to disable return FALSE //Was enough, reduce and return. - human.nutrition -= use_charge + human.adjust_nutrition(-use_charge) return TRUE //Install a piece of software diff --git a/code/modules/organs/blood.dm b/code/modules/organs/blood.dm index 0a3685d61e..931eaab0cb 100644 --- a/code/modules/organs/blood.dm +++ b/code/modules/organs/blood.dm @@ -133,9 +133,9 @@ var/const/CE_STABLE_THRESHOLD = 0.5 // Without enough blood you slowly go hungry. if(blood_volume < BLOOD_VOLUME_SAFE) if(nutrition >= 300) - nutrition -= 10 + adjust_nutrition(-10) else if(nutrition >= 200) - nutrition -= 3 + adjust_nutrition(-3) //Bleeding out var/blood_max = 0 diff --git a/code/modules/organs/subtypes/machine.dm b/code/modules/organs/subtypes/machine.dm index 0e3a60fdd5..6bb76bbd5e 100644 --- a/code/modules/organs/subtypes/machine.dm +++ b/code/modules/organs/subtypes/machine.dm @@ -18,8 +18,8 @@ owner.visible_message("\The [owner] twitches visibly!") /obj/item/organ/internal/cell/emp_act(severity) - // ..() // VOREStation Edit - Don't take damage - owner.nutrition = max(0, owner.nutrition - rand(10/severity, 50/severity)) + ..() + owner.adjust_nutrition(-rand(10 / severity, 50 / severity)) // Used for an MMI or posibrain being installed into a human. /obj/item/organ/internal/mmi_holder diff --git a/code/modules/power/cells/power_cells.dm b/code/modules/power/cells/power_cells.dm index 3638c625f1..ca6f96ec9b 100644 --- a/code/modules/power/cells/power_cells.dm +++ b/code/modules/power/cells/power_cells.dm @@ -130,7 +130,7 @@ used = TRUE desc += " This one has already been used." overlays.Cut() - target.nutrition += amount + target.adjust_nutrition(amount) user.custom_emote(message = "connects \the [src] to [user == target ? "their" : "[target]'s"] charging port, expending it.") /obj/item/weapon/cell/emergency_light diff --git a/code/modules/projectiles/guns/energy.dm b/code/modules/projectiles/guns/energy.dm index e58826dd0c..bff75f27f7 100644 --- a/code/modules/projectiles/guns/energy.dm +++ b/code/modules/projectiles/guns/energy.dm @@ -76,7 +76,7 @@ var/start_nutrition = H.nutrition var/end_nutrition = 0 - H.nutrition -= rechargeamt / 15 + H.adjust_nutrition(-rechargeamt / 15) end_nutrition = H.nutrition diff --git a/code/modules/projectiles/projectile/special.dm b/code/modules/projectiles/projectile/special.dm index 8f81ed16cd..2cd0519285 100644 --- a/code/modules/projectiles/projectile/special.dm +++ b/code/modules/projectiles/projectile/special.dm @@ -197,11 +197,11 @@ impact_effect_type = /obj/effect/temp_visual/impact_effect/monochrome_laser /obj/item/projectile/energy/florayield/on_hit(var/atom/target, var/blocked = 0) - var/mob/M = target + var/mob/living/M = target 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.adjust_nutrition(30) else if (istype(target, /mob/living/carbon/)) M.show_message("The radiation beam dissipates harmlessly through your body.") else diff --git a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Core.dm b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Core.dm index c2ff36ea10..54e1e1bbdd 100644 --- a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Core.dm +++ b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Core.dm @@ -46,11 +46,11 @@ if(ishuman(M)) var/mob/living/carbon/human/H = M if(H.species.gets_food_nutrition == 0) - H.nutrition += removed + H.adjust_nutrition(removed) is_vampire = 1 //VOREStation Edit END if(alien == IS_SLIME) // Treat it like nutriment for the jello, but not equivalent. M.heal_organ_damage(0.2 * removed * volume_mod, 0) // More 'effective' blood means more usable material. - M.nutrition += 20 * removed * volume_mod + M.adjust_nutrition(20 * removed * volume_mod) M.add_chemical_effect(CE_BLOODRESTORE, 4 * removed) M.adjustToxLoss(removed / 2) // Still has some water in the form of plasma. return diff --git a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Dispenser.dm b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Dispenser.dm index ead972b7f4..d49d952314 100644 --- a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Dispenser.dm +++ b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Dispenser.dm @@ -138,7 +138,7 @@ /datum/reagent/ethanol/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed) if(issmall(M)) removed *= 2 - M.nutrition += nutriment_factor * removed + M.adjust_nutrition(nutriment_factor * removed) var/strength_mod = 1 if(alien == IS_SKRELL) strength_mod *= 5 @@ -448,7 +448,7 @@ glass_icon = DRINK_ICON_NOISY /datum/reagent/sugar/affect_blood(var/mob/living/carbon/M, var/alien, var/removed) - M.nutrition += removed * 3 + M.adjust_nutrition(removed * 3) var/effective_dose = dose if(issmall(M)) diff --git a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Food-Drinks.dm b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Food-Drinks.dm index f50a791550..d528f7bda5 100644 --- a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Food-Drinks.dm +++ b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Food-Drinks.dm @@ -47,7 +47,7 @@ if(issmall(M)) removed *= 2 // Small bodymass, more effect from lower volume. M.heal_organ_damage(0.5 * removed, 0) if(M.species.gets_food_nutrition) //VOREStation edit. If this is set to 0, they don't get nutrition from food. - M.nutrition += nutriment_factor * removed // For hunger and fatness + M.adjust_nutrition(nutriment_factor * removed) // For hunger and fatness M.add_chemical_effect(CE_BLOODRESTORE, 4 * removed) /datum/reagent/nutriment/glucose @@ -388,10 +388,7 @@ overdose = REAGENTS_OVERDOSE /datum/reagent/lipozine/affect_blood(var/mob/living/carbon/M, var/alien, var/removed) - M.nutrition = max(M.nutrition - 10 * removed, 0) - M.overeatduration = 0 - if(M.nutrition < 0) - M.nutrition = 0 + M.adjust_nutrition(-10 * removed) /* Non-food stuff like condiments */ @@ -659,7 +656,7 @@ return /datum/reagent/drink/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed) - M.nutrition += nutrition * removed + M.adjust_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) diff --git a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Food-Drinks_vr.dm b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Food-Drinks_vr.dm index a87ccb9194..60b126e286 100644 --- a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Food-Drinks_vr.dm +++ b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Food-Drinks_vr.dm @@ -29,10 +29,7 @@ color = "#fff200" /datum/reagent/lipozine/affect_blood(var/mob/living/carbon/M, var/alien, var/removed) - M.nutrition = max(M.nutrition - 20 * removed, 0) - M.overeatduration = 0 - if(M.nutrition < 0) - M.nutrition = 0 + M.adjust_nutrition(-20 * removed) /datum/reagent/ethanol/deathbell name = "Deathbell" @@ -79,13 +76,13 @@ if(IS_SKRELL) M.adjustToxLoss(0.25 * removed) //Equivalent to half as much protein, since it's half protein. if(IS_TESHARI) - M.nutrition += (alt_nutriment_factor * 1.2 * removed) //Give them the same nutrition they would get from protein. + M.adjust_nutrition(alt_nutriment_factor * 1.2 * removed) //Give them the same nutrition they would get from protein. if(IS_UNATHI) - M.nutrition += (alt_nutriment_factor * 1.125 * removed) //Give them the same nutrition they would get from protein. + M.adjust_nutrition(alt_nutriment_factor * 1.125 * removed) //Give them the same nutrition they would get from protein. //Takes into account the 0.5 factor for all nutriment which is applied on top of the 2.25 factor for protein. //Chimera don't need their own case here since their factors for nutriment and protein cancel out. else - M.nutrition += (alt_nutriment_factor * removed) + M.adjust_nutrition(alt_nutriment_factor * removed) if(ishuman(M)) var/mob/living/carbon/human/H = M if(H.feral > 0 && H.nutrition > 100 && H.traumatic_shock < min(60, H.nutrition/10) && H.jitteriness < 100) // same check as feral triggers to stop them immediately re-feralling @@ -101,7 +98,7 @@ M.adjustToxLoss(removed) //Equivalent to half as much protein, since it's half protein. if(M.species.gets_food_nutrition) if(alien == IS_SLIME || alien == IS_CHIMERA) //slimes and chimera can get nutrition from injected nutriment and protein - M.nutrition += (alt_nutriment_factor * removed) + M.adjust_nutrition(alt_nutriment_factor * removed) diff --git a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Medicine.dm b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Medicine.dm index 80ccc0ced5..d083c95cbc 100644 --- a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Medicine.dm +++ b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Medicine.dm @@ -520,7 +520,7 @@ return if(alien == IS_SLIME) if(dose >= 5) //Not effective in small doses, though it causes toxloss at higher ones, it will make the regeneration for brute and burn more 'efficient' at the cost of more nutrition. - M.nutrition -= removed * 2 + M.adjust_nutrition(removed * 2) M.adjustBruteLoss(-2 * removed) M.adjustFireLoss(-1 * removed) chem_effective = 0.5 @@ -548,7 +548,7 @@ if(alien == IS_SLIME) M.make_jittery(4) //Hyperactive fluid pumping results in unstable 'skeleton', resulting in vibration. if(dose >= 5) - M.nutrition = (M.nutrition - (removed * 2)) //Sadly this movement starts burning food in higher doses. + M.adjust_nutrition(-removed * 2) // Sadly this movement starts burning food in higher doses. ..() if(prob(5)) M.emote(pick("twitch", "blink_r", "shiver")) @@ -738,7 +738,7 @@ if(prob(10)) H.vomit(1) else if(H.nutrition > 30) - H.nutrition = max(0, H.nutrition - round(30 * removed)) + M.adjust_nutrition(-removed * 30) else H.adjustToxLoss(-10 * removed) // Carthatoline based, considering cost. @@ -1092,7 +1092,7 @@ M.make_jittery(5) if(dose >= 20 || M.toxloss >= 60) //Core disentigration, cellular mass begins treating itself as an enemy, while maintaining regeneration. Slime-cancer. M.adjustBrainLoss(2 * removed) - M.nutrition = max(H.nutrition - 20, 0) + M.adjust_nutrition(-20) if(M.bruteloss >= 60 && M.toxloss >= 60 && M.brainloss >= 30) //Total Structural Failure. Limbs start splattering. var/obj/item/organ/external/O = pick(H.organs) if(prob(20) && !istype(O, /obj/item/organ/external/chest/unbreakable/slime) && !istype(O, /obj/item/organ/external/groin/unbreakable/slime)) diff --git a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Toxins.dm b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Toxins.dm index 135e8686cc..bee8702d0f 100644 --- a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Toxins.dm +++ b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Toxins.dm @@ -19,7 +19,7 @@ if(alien == IS_SLIME) removed *= 0.25 // Results in half the standard tox as normal. Prometheans are 'Small' for flaps. if(dose >= 10) - M.nutrition += strength * removed //Body has to deal with the massive influx of toxins, rather than try using them to repair. + M.adjust_nutrition(strength * removed) // Body has to deal with the massive influx of toxins, rather than try using them to repair. else M.heal_organ_damage((10/strength) * removed, (10/strength) * removed) //Doses of toxins below 10 units, and 10 strength, are capable of providing useful compounds for repair. M.adjustToxLoss(strength * removed) @@ -396,7 +396,7 @@ /datum/reagent/toxin/sifslurry/affect_blood(var/mob/living/carbon/M, var/alien, var/removed) if(alien == IS_DIONA) // Symbiotic bacteria. - M.nutrition += strength * removed + M.adjust_nutrition(strength * removed) return else M.add_modifier(/datum/modifier/slow_pulse, 30 SECONDS) diff --git a/code/modules/reagents/reagent_containers/blood_pack_vr.dm b/code/modules/reagents/reagent_containers/blood_pack_vr.dm index b4e27fb95a..118ad57bb3 100644 --- a/code/modules/reagents/reagent_containers/blood_pack_vr.dm +++ b/code/modules/reagents/reagent_containers/blood_pack_vr.dm @@ -7,7 +7,7 @@ if("blood") user.show_message("You sink your fangs into \the [src] and suck the blood out of it!") user.visible_message("[user] sinks their fangs into \the [src] and drains it!") - user.nutrition += remove_volume*5 + user.adjust_nutrition(remove_volume*5) reagents.remove_reagent(reagent_to_remove, remove_volume) update_icon() return diff --git a/code/modules/spells/spellbook.dm b/code/modules/spells/spellbook.dm index 3ae280a65b..831d44ba2f 100644 --- a/code/modules/spells/spellbook.dm +++ b/code/modules/spells/spellbook.dm @@ -300,13 +300,11 @@ icon_state ="booksmoke" desc = "This book is overflowing with the dank arts." -/obj/item/weapon/spellbook/oneuse/smoke/recoil(mob/user as mob) +/obj/item/weapon/spellbook/oneuse/smoke/recoil(mob/living/user as mob) ..() to_chat(user, "Your stomach rumbles...") if(user.nutrition) - user.nutrition -= 200 - if(user.nutrition <= 0) - user.nutrition = 0 + user.adjust_nutrition(-200) /obj/item/weapon/spellbook/oneuse/blind spell = /spell/targeted/genetic/blind diff --git a/code/modules/virus2/effect.dm b/code/modules/virus2/effect.dm index ea7de6ccac..742af67d46 100644 --- a/code/modules/virus2/effect.dm +++ b/code/modules/virus2/effect.dm @@ -424,7 +424,7 @@ stage = 2 /datum/disease2/effect/hungry/activate(var/mob/living/carbon/mob,var/multiplier) - mob.nutrition = max(0, mob.nutrition - 200) + mob.adjust_nutrition(-200) /datum/disease2/effect/fridge name = "Reduced Circulation" diff --git a/code/modules/vore/appearance/spider_taur_powers_vr.dm b/code/modules/vore/appearance/spider_taur_powers_vr.dm index 5675c6378a..a7df6edd4e 100644 --- a/code/modules/vore/appearance/spider_taur_powers_vr.dm +++ b/code/modules/vore/appearance/spider_taur_powers_vr.dm @@ -1,15 +1,4 @@ -// --------------------------------------------- -// -!-!-!-!-!-!-!-!- READ ME -!-!-!-!-!-!-!-!-!- -// --------------------------------------------- - -//Beep beep hello -// -//Use this file to define the exclusive abilities of the spidertaur folk -// -//ahuhuhuhu -//-Antsnap - -obj/item/clothing/suit/web_bindings +/obj/item/clothing/suit/web_bindings icon = 'icons/vore/custom_clothes_vr.dmi' icon_override = 'icons/vore/custom_clothes_vr.dmi' name = "web bindings" @@ -19,25 +8,12 @@ obj/item/clothing/suit/web_bindings body_parts_covered = UPPER_TORSO|LOWER_TORSO|LEGS|FEET|ARMS|HANDS flags_inv = HIDEGLOVES|HIDESHOES|HIDEJUMPSUIT|HIDETAIL -/* //Commenting all this out, as people keep abusing it. Sorry! -mob/proc/weaveWeb() - set name = "Weave Web" - set category = "Species Powers" - if(nutrition >= 500) //People decided to abuse it. Sorry. It was asked to be made so it couldn't be spammed, and what do ya know, people are spamming it everywhere. - src.visible_message("\the [src] weaves a web from their spinneret silk.") - nutrition -= 500 - spawn(30) //3 seconds to form - new /obj/effect/spider/stickyweb(src.loc) - else - to_chat(src, "You do not have enough nutrition to create webbing!") -*/ - -mob/proc/weaveWebBindings() +/mob/living/proc/weaveWebBindings() set name = "Weave Web Bindings" set category = "Species Powers" if(nutrition >= 30) //This isn't a huge problem. This is so you can bind people up. src.visible_message("\the [src] pulls silk from their manibles and delicately weaves it into bindings.") - nutrition -= 30 + adjust_nutrition(-30) spawn(30) //5 seconds to weave the bindings~ var/obj/item/clothing/suit/web_bindings/bindings = new() //This sprite is amazing, I must say. src.put_in_hands(bindings) diff --git a/code/modules/vore/eating/belly_obj_vr.dm b/code/modules/vore/eating/belly_obj_vr.dm index 11ce8988f0..627934c6f3 100644 --- a/code/modules/vore/eating/belly_obj_vr.dm +++ b/code/modules/vore/eating/belly_obj_vr.dm @@ -486,7 +486,7 @@ if(!digested) items_preserved |= item else - owner.nutrition += ((nutrition_percent / 100) * 5 * digested) + owner.adjust_nutrition((nutrition_percent / 100) * 5 * digested) if(isrobot(owner)) var/mob/living/silicon/robot/R = owner R.cell.charge += (50 * digested) diff --git a/code/modules/vore/eating/bellymodes_tf_vr.dm b/code/modules/vore/eating/bellymodes_tf_vr.dm index 32a6e91a4c..2120ea78fd 100644 --- a/code/modules/vore/eating/bellymodes_tf_vr.dm +++ b/code/modules/vore/eating/bellymodes_tf_vr.dm @@ -59,8 +59,8 @@ continue if(stabilize_nutrition) if(O.nutrition > 400 && H.nutrition < 400) - O.nutrition -= 2 - H.nutrition += 1.5 + O.adjust_nutrition(-2) + H.adjust_nutrition(1.5) if(changes_eyes && check_eyes(H)) change_eyes(H, 1) continue diff --git a/code/modules/vore/eating/bellymodes_vr.dm b/code/modules/vore/eating/bellymodes_vr.dm index 40d2b32a4e..caf75ac3c6 100644 --- a/code/modules/vore/eating/bellymodes_vr.dm +++ b/code/modules/vore/eating/bellymodes_vr.dm @@ -143,9 +143,9 @@ var/mob/living/silicon/robot/R = owner R.cell.charge += 25 * damage_gain if(offset) // If any different than default weight, multiply the % of offset. - owner.nutrition += offset*((nutrition_percent / 100) * 4.5 * (damage_gain) / difference) //4.5 nutrition points per health point. Normal same size 100+100 health prey with average weight would give 900 points if the digestion was instant. With all the size/weight offset taxes plus over time oxyloss+hunger taxes deducted with non-instant digestion, this should be enough to not leave the pred starved. + owner.adjust_nutrition(offset*((nutrition_percent / 100) * 4.5 * (damage_gain) / difference)) //4.5 nutrition points per health point. Normal same size 100+100 health prey with average weight would give 900 points if the digestion was instant. With all the size/weight offset taxes plus over time oxyloss+hunger taxes deducted with non-instant digestion, this should be enough to not leave the pred starved. else - owner.nutrition += (nutrition_percent / 100) * 4.5 * (damage_gain) / difference + owner.adjust_nutrition((nutrition_percent / 100) * 4.5 * (damage_gain) / difference) if(DM_ABSORB) if(!L.absorbable || L.absorbed) continue @@ -159,7 +159,7 @@ L.absorbed = FALSE to_chat(L, "You suddenly feel solid again.") to_chat(owner,"You feel like a part of you is missing.") - owner.nutrition -= 100 + owner.adjust_nutrition(-100) to_update = TRUE if(DM_DRAIN) digestion_noise_chance = 10 @@ -189,12 +189,12 @@ L.adjustToxLoss(-5) L.adjustOxyLoss(-5) L.adjustCloneLoss(-1.25) - owner.nutrition -= 2 + owner.adjust_nutrition(-2) if(L.nutrition <= 400) - L.nutrition += 1 + L.adjust_nutrition(1) else if(owner.nutrition > 90 && (L.nutrition <= 400)) - owner.nutrition -= 1 - L.nutrition += 1 + owner.adjust_nutrition(-1) + L.adjust_nutrition(1) /////////////////////////// Make any noise /////////////////////////// if(digestion_noise_chance && prob(digestion_noise_chance)) @@ -283,13 +283,13 @@ var/mob/living/silicon/robot/R = owner R.cell.charge += 25*compensation else - owner.nutrition += (nutrition_percent / 100)*4.5*compensation + owner.adjust_nutrition((nutrition_percent / 100)*4.5*compensation) /obj/belly/proc/steal_nutrition(mob/living/L) if(L.nutrition >= 100) var/oldnutrition = (L.nutrition * 0.05) L.nutrition = (L.nutrition * 0.95) - owner.nutrition += oldnutrition + owner.adjust_nutrition(oldnutrition) /obj/belly/proc/updateVRPanels() for(var/mob/living/M in contents) diff --git a/code/modules/vore/eating/living_vr.dm b/code/modules/vore/eating/living_vr.dm index 9c1e91481a..15fde8b613 100644 --- a/code/modules/vore/eating/living_vr.dm +++ b/code/modules/vore/eating/living_vr.dm @@ -748,11 +748,11 @@ if(O.material in rock_munch) var/S = rock_munch[O.material] to_chat(src, "[S["remark"]]") - nutrition += S["nutrition"] + adjust_nutrition(S["nutrition"]) else //Handle everything else. if(istype(O, /obj/item/weapon/ore/slag/)) to_chat(src, "You taste dusty, crunchy mistakes. This is a travesty... but at least it is an edible one.") - nutrition += 15 + adjust_nutrition(15) else //Random rock. to_chat(src, "You taste stony, gravelly goodness - but you crave something with actual nutritional value.") diff --git a/code/modules/vore/weight/fitness_machines_vr.dm b/code/modules/vore/weight/fitness_machines_vr.dm index 733cb2faca..df828e8eef 100644 --- a/code/modules/vore/weight/fitness_machines_vr.dm +++ b/code/modules/vore/weight/fitness_machines_vr.dm @@ -20,7 +20,7 @@ else //If they have enough nutrition and body weight, they can exercise. user.setClickCooldown(cooldown) - user.nutrition -= 10 * weightloss_power + user.adjust_nutrition(-10 * weightloss_power) user.weight -= 0.025 * weightloss_power * (0.01 * user.weight_loss) flick("[icon_state]2", src) var/message = pick(messages) diff --git a/code/modules/xenoarcheaology/effects/heal.dm b/code/modules/xenoarcheaology/effects/heal.dm index b195c736c1..39bb09d04e 100644 --- a/code/modules/xenoarcheaology/effects/heal.dm +++ b/code/modules/xenoarcheaology/effects/heal.dm @@ -17,7 +17,7 @@ affecting.heal_damage(25 * weakness, 25 * weakness) //H:heal_organ_damage(25, 25) H.vessel.add_reagent("blood",5) - H.nutrition += 50 * weakness + H.adjust_nutrition(50 * weakness) H.adjustBrainLoss(-25 * weakness) H.radiation -= min(H.radiation, 25 * weakness) H.bodytemperature = initial(H.bodytemperature) diff --git a/code/modules/xenoarcheaology/effects/hurt.dm b/code/modules/xenoarcheaology/effects/hurt.dm index fb38214e23..14aff4e624 100644 --- a/code/modules/xenoarcheaology/effects/hurt.dm +++ b/code/modules/xenoarcheaology/effects/hurt.dm @@ -14,6 +14,7 @@ C.adjustFireLoss(rand(5,25) * weakness) C.adjustBrainLoss(rand(1,5) * weakness) C.apply_effect(25 * weakness, IRRADIATE) + C.adjust_nutrition(-50 * weakness) C.nutrition -= min(50 * weakness, C.nutrition) C.make_dizzy(6 * weakness) C.weakened += 6 * weakness diff --git a/code/modules/xenobio2/mob/slime/slime life.dm b/code/modules/xenobio2/mob/slime/slime life.dm index ef5f4aa2a5..ca5075f705 100644 --- a/code/modules/xenobio2/mob/slime/slime life.dm +++ b/code/modules/xenobio2/mob/slime/slime life.dm @@ -10,7 +10,7 @@ Slime specific life events go here. if(is_child) if(nutrition >= 275) growthcounter++ - nutrition -= hunger_factor + adjust_nutrition(-hunger_factor) if(nutrition <= 75) growthcounter-- if(growthcounter >= growthpoint) diff --git a/code/modules/xenobio2/mob/xeno procs.dm b/code/modules/xenobio2/mob/xeno procs.dm index d038f87104..1fd17c964b 100644 --- a/code/modules/xenobio2/mob/xeno procs.dm +++ b/code/modules/xenobio2/mob/xeno procs.dm @@ -75,7 +75,7 @@ Divergence proc, used in mutation to make unique datums. heal_overall_damage(reagent_response["heal"] * reagent_total) if(reagent_response["nutr"]) - nutrition += reagent_response["nutr"] * reagent_total + adjust_nutrition(reagent_response["nutr"] * reagent_total) if(reagent_response["mut"]) mut_level += reagent_response["mut"] * reagent_total diff --git a/code/modules/xenobio2/mob/xeno.dm b/code/modules/xenobio2/mob/xeno.dm index 74a35aacc4..9996be9e61 100644 --- a/code/modules/xenobio2/mob/xeno.dm +++ b/code/modules/xenobio2/mob/xeno.dm @@ -67,7 +67,7 @@ Also includes Life and New nutrition = 0 if((nutrition > 0 ) && traitdat.traits[TRAIT_XENO_EATS]) if(nutrition >= 300) - nutrition -= hunger_factor + adjust_nutrition(-hunger_factor) else if(traitdat.traits[TRAIT_XENO_EATS]) health = starve_damage diff --git a/html/changelogs/neerti_all_the_food.yml b/html/changelogs/neerti_all_the_food.yml new file mode 100644 index 0000000000..f0c1b4ab61 --- /dev/null +++ b/html/changelogs/neerti_all_the_food.yml @@ -0,0 +1,36 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +################################# + +# Your name. +author: Neerti + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - rscadd: "You can now eat as much food as you want, even while 'full'."