mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-29 06:58:30 +01:00
Removes limits on eating, centralizes nutrition changing.
This commit is contained in:
@@ -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("<span class='critical'>\The [holder] descends into an all consuming rage!</span>")
|
||||
|
||||
// End all stuns.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
var/rads = radiation/25
|
||||
radiation -= rads
|
||||
nutrition += rads
|
||||
adjust_nutrition(rads)
|
||||
heal_overall_damage(rads,rads)
|
||||
adjustOxyLoss(-(rads))
|
||||
adjustToxLoss(-(rads))
|
||||
|
||||
@@ -36,12 +36,23 @@
|
||||
/* VOREStation Edit - Duplicated in our code
|
||||
/mob/living/carbon/Moved(atom/old_loc, direction, forced = FALSE)
|
||||
. = ..()
|
||||
<<<<<<< HEAD
|
||||
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
|
||||
>>>>>>> 61c4929... Merge pull request #7045 from Neerti/let_them_eat_all_the_cake
|
||||
|
||||
// Moving around increases germ_level faster
|
||||
if(germ_level < GERM_LEVEL_MOVE_CAP && prob(8))
|
||||
@@ -109,7 +120,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(
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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, "<span class='critical'>Your regeneration is interrupted!</span>")
|
||||
nutrition -= 75
|
||||
adjust_nutrition(-75)
|
||||
active_regen = FALSE
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -189,11 +189,12 @@ 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
|
||||
<<<<<<< HEAD
|
||||
H.nutrition = max(H.nutrition, min(500, H.nutrition + rand(15, 30))) //VOREStation Edit: Gives nutrition up to a point instead of being capped
|
||||
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
|
||||
@@ -215,6 +216,29 @@ var/datum/species/shapeshifter/promethean/prometheans
|
||||
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(rand(10, 20))
|
||||
if(H.clean_blood(1))
|
||||
H.adjust_nutrition(rand(5, 15))
|
||||
if(H.r_hand)
|
||||
if(H.r_hand.clean_blood())
|
||||
H.adjust_nutrition(rand(5, 15))
|
||||
if(H.l_hand)
|
||||
if(H.l_hand.clean_blood())
|
||||
H.adjust_nutrition(rand(5, 15))
|
||||
if(H.head)
|
||||
if(H.head.clean_blood())
|
||||
H.update_inv_head(0)
|
||||
H.adjust_nutrition(rand(5, 15))
|
||||
if(H.wear_suit)
|
||||
if(H.wear_suit.clean_blood())
|
||||
H.update_inv_wear_suit(0)
|
||||
H.adjust_nutrition(rand(5, 15))
|
||||
if(H.w_uniform)
|
||||
if(H.w_uniform.clean_blood())
|
||||
H.update_inv_w_uniform(0)
|
||||
H.adjust_nutrition(rand(5, 15))
|
||||
>>>>>>> 61c4929... Merge pull request #7045 from Neerti/let_them_eat_all_the_cake
|
||||
//End cleaning code.
|
||||
|
||||
var/datum/gas_mixture/environment = T.return_air()
|
||||
@@ -297,8 +321,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.
|
||||
|
||||
|
||||
@@ -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)))
|
||||
|
||||
@@ -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()
|
||||
. = ..()
|
||||
. += {"
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<<<<<<< HEAD
|
||||
// These slimes have the mechanics xenobiologists care about, such as reproduction, mutating into new colors, and being able to submit through fear.
|
||||
|
||||
/mob/living/simple_mob/slime/xenobio
|
||||
@@ -276,3 +277,285 @@
|
||||
|
||||
lines.Add(description_info)
|
||||
return lines.Join("\n")
|
||||
=======
|
||||
// These slimes have the mechanics xenobiologists care about, such as reproduction, mutating into new colors, and being able to submit through fear.
|
||||
|
||||
/mob/living/simple_mob/slime/xenobio
|
||||
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.
|
||||
var/mob/living/victim = null // the person the slime is currently feeding on
|
||||
var/rainbow_core_candidate = TRUE // If false, rainbow cores cannot make this type randomly.
|
||||
var/mutation_chance = 25 // Odds of spawning as a new color when reproducing. Can be modified by certain xenobio products. Carried across generations of slimes.
|
||||
var/list/slime_mutation = list(
|
||||
/mob/living/simple_mob/slime/xenobio/orange,
|
||||
/mob/living/simple_mob/slime/xenobio/metal,
|
||||
/mob/living/simple_mob/slime/xenobio/blue,
|
||||
/mob/living/simple_mob/slime/xenobio/purple
|
||||
)
|
||||
var/amount_grown = 0 // controls how long the slime has been overfed, if 10, grows or reproduces
|
||||
var/number = 0 // This is used to make the slime semi-unique for indentification.
|
||||
var/harmless = FALSE // Set to true when pacified. Makes the slime harmless, not get hungry, and not be able to grow/reproduce.
|
||||
|
||||
/mob/living/simple_mob/slime/xenobio/Initialize(mapload, var/mob/living/simple_mob/slime/xenobio/my_predecessor)
|
||||
ASSERT(ispath(ai_holder_type, /datum/ai_holder/simple_mob/xenobio_slime))
|
||||
number = rand(1, 1000)
|
||||
update_name()
|
||||
|
||||
. = ..() // This will make the AI and do the other mob constructor things. It will also return the default hint at the end.
|
||||
|
||||
if(my_predecessor)
|
||||
inherit_information(my_predecessor)
|
||||
|
||||
|
||||
/mob/living/simple_mob/slime/xenobio/Destroy()
|
||||
if(victim)
|
||||
stop_consumption() // Unbuckle us from our victim.
|
||||
return ..()
|
||||
|
||||
// Called when a slime makes another slime by splitting. The predecessor slime will be deleted shortly afterwards.
|
||||
/mob/living/simple_mob/slime/xenobio/proc/inherit_information(var/mob/living/simple_mob/slime/xenobio/predecessor)
|
||||
if(!predecessor)
|
||||
return
|
||||
|
||||
var/datum/ai_holder/simple_mob/xenobio_slime/AI = ai_holder
|
||||
var/datum/ai_holder/simple_mob/xenobio_slime/previous_AI = predecessor.ai_holder
|
||||
ASSERT(istype(AI))
|
||||
ASSERT(istype(previous_AI))
|
||||
|
||||
// Now to transfer the information.
|
||||
// Newly made slimes are bit more rebellious than their predecessors, but they also somewhat forget the atrocities the xenobiologist may have done.
|
||||
AI.discipline = max(previous_AI.discipline - 1, 0)
|
||||
AI.obedience = max(previous_AI.obedience - 1, 0)
|
||||
AI.resentment = max(previous_AI.resentment - 1, 0)
|
||||
AI.rabid = previous_AI.rabid
|
||||
|
||||
|
||||
/mob/living/simple_mob/slime/xenobio/update_icon()
|
||||
icon_living = "[icon_state_override ? "[icon_state_override] slime" : "slime"] [is_adult ? "adult" : "baby"][victim ? " eating" : ""]"
|
||||
icon_dead = "[icon_state_override ? "[icon_state_override] slime" : "slime"] [is_adult ? "adult" : "baby"] dead"
|
||||
icon_rest = icon_dead
|
||||
..() // This will apply the correct icon_state and do the other overlay-related things.
|
||||
|
||||
|
||||
/mob/living/simple_mob/slime/xenobio/handle_special()
|
||||
if(stat != DEAD)
|
||||
handle_nutrition()
|
||||
|
||||
if(victim)
|
||||
handle_consumption()
|
||||
|
||||
handle_stuttering() // ??
|
||||
|
||||
..()
|
||||
|
||||
/mob/living/simple_mob/slime/xenobio/examine(mob/user)
|
||||
. = ..()
|
||||
if(hat)
|
||||
. += "It is wearing \a [hat]."
|
||||
|
||||
if(stat == DEAD)
|
||||
. += "It appears to be dead."
|
||||
else if(incapacitated(INCAPACITATION_DISABLED))
|
||||
. += "It appears to be incapacitated."
|
||||
else if(harmless)
|
||||
. += "It appears to have been pacified."
|
||||
else
|
||||
if(has_AI())
|
||||
var/datum/ai_holder/simple_mob/xenobio_slime/AI = ai_holder
|
||||
if(AI.rabid)
|
||||
. += "It seems very, very angry and upset."
|
||||
else if(AI.obedience >= 5)
|
||||
. += "It looks rather obedient."
|
||||
else if(AI.discipline)
|
||||
. += "It has been subjugated by force, at least for now."
|
||||
|
||||
/mob/living/simple_mob/slime/xenobio/proc/make_adult()
|
||||
if(is_adult)
|
||||
return
|
||||
|
||||
is_adult = TRUE
|
||||
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()
|
||||
|
||||
/mob/living/simple_mob/slime/xenobio/proc/update_name()
|
||||
if(harmless) // Docile slimes are generally named, so we shouldn't mess with it.
|
||||
return
|
||||
name = "[slime_color] [is_adult ? "adult" : "baby"] [initial(name)] ([number])"
|
||||
real_name = name
|
||||
|
||||
/mob/living/simple_mob/slime/xenobio/update_mood()
|
||||
var/old_mood = mood
|
||||
if(incapacitated(INCAPACITATION_DISABLED))
|
||||
mood = "sad"
|
||||
else if(harmless)
|
||||
mood = ":33"
|
||||
else if(has_AI())
|
||||
var/datum/ai_holder/simple_mob/xenobio_slime/AI = ai_holder
|
||||
if(AI.rabid)
|
||||
mood = "angry"
|
||||
else if(AI.target)
|
||||
mood = "mischevous"
|
||||
else if(AI.discipline)
|
||||
mood = "pout"
|
||||
else
|
||||
mood = ":3"
|
||||
else
|
||||
mood = ":3"
|
||||
|
||||
if(old_mood != mood)
|
||||
update_icon()
|
||||
|
||||
/mob/living/simple_mob/slime/xenobio/proc/enrage()
|
||||
if(harmless)
|
||||
return
|
||||
if(has_AI())
|
||||
var/datum/ai_holder/simple_mob/xenobio_slime/AI = ai_holder
|
||||
AI.enrage()
|
||||
|
||||
/mob/living/simple_mob/slime/xenobio/proc/pacify()
|
||||
harmless = TRUE
|
||||
if(has_AI())
|
||||
var/datum/ai_holder/simple_mob/xenobio_slime/AI = ai_holder
|
||||
AI.pacify()
|
||||
|
||||
faction = "neutral"
|
||||
|
||||
// If for whatever reason the mob AI (or player) decides to try to attack something anyways.
|
||||
melee_damage_upper = 0
|
||||
melee_damage_lower = 0
|
||||
|
||||
update_mood()
|
||||
|
||||
|
||||
// These are verbs so that player slimes can evolve/split.
|
||||
/mob/living/simple_mob/slime/xenobio/verb/evolve()
|
||||
set category = "Slime"
|
||||
set desc = "This will let you evolve from baby to adult slime."
|
||||
|
||||
if(stat)
|
||||
to_chat(src, span("warning", "I must be conscious to do this..."))
|
||||
return
|
||||
|
||||
if(harmless)
|
||||
to_chat(src, span("warning", "I have been pacified. I cannot evolve..."))
|
||||
return
|
||||
|
||||
if(!is_adult)
|
||||
if(amount_grown >= 10)
|
||||
make_adult()
|
||||
else
|
||||
to_chat(src, span("warning", "I am not ready to evolve yet..."))
|
||||
else
|
||||
to_chat(src, span("warning", "I have already evolved..."))
|
||||
|
||||
|
||||
/mob/living/simple_mob/slime/xenobio/verb/reproduce()
|
||||
set category = "Slime"
|
||||
set desc = "This will make you split into four new slimes."
|
||||
|
||||
if(stat)
|
||||
to_chat(src, span("warning", "I must be conscious to do this..."))
|
||||
return
|
||||
|
||||
if(harmless)
|
||||
to_chat(src, span("warning", "I have been pacified. I cannot reproduce..."))
|
||||
return
|
||||
|
||||
if(is_adult)
|
||||
if(amount_grown >= 10)
|
||||
// Check if there's enough 'room' to split.
|
||||
var/list/nearby_things = orange(1, src)
|
||||
var/free_tiles = 0
|
||||
for(var/turf/T in nearby_things)
|
||||
var/free = TRUE
|
||||
if(T.density) // No walls.
|
||||
continue
|
||||
for(var/atom/movable/AM in T)
|
||||
if(AM.density)
|
||||
free = FALSE
|
||||
break
|
||||
|
||||
if(free)
|
||||
free_tiles++
|
||||
|
||||
if(free_tiles < 3) // Three free tiles are needed, as four slimes are made and the 4th tile is from the center tile that the current slime occupies.
|
||||
to_chat(src, span("warning", "It is too cramped here to reproduce..."))
|
||||
return
|
||||
|
||||
var/list/babies = list()
|
||||
for(var/i = 1 to 4)
|
||||
babies.Add(make_new_slime())
|
||||
|
||||
var/mob/living/simple_mob/slime/new_slime = pick(babies)
|
||||
new_slime.universal_speak = universal_speak
|
||||
if(src.mind)
|
||||
src.mind.transfer_to(new_slime)
|
||||
else
|
||||
new_slime.key = src.key
|
||||
qdel(src)
|
||||
else
|
||||
to_chat(src, span("warning", "I am not ready to reproduce yet..."))
|
||||
else
|
||||
to_chat(src, span("warning", "I have not evolved enough to reproduce yet..."))
|
||||
|
||||
// Used when reproducing or dying.
|
||||
/mob/living/simple_mob/slime/xenobio/proc/make_new_slime(var/desired_type)
|
||||
var/t = src.type
|
||||
if(desired_type)
|
||||
t = desired_type
|
||||
if(prob(mutation_chance / 10))
|
||||
t = /mob/living/simple_mob/slime/xenobio/rainbow
|
||||
else if(prob(mutation_chance) && slime_mutation.len)
|
||||
t = slime_mutation[rand(1, slime_mutation.len)]
|
||||
var/mob/living/simple_mob/slime/xenobio/baby = new t(loc, src)
|
||||
|
||||
// Handle 'inheriting' from parent slime.
|
||||
baby.mutation_chance = mutation_chance
|
||||
baby.power_charge = round(power_charge / 4)
|
||||
|
||||
if(!istype(baby, /mob/living/simple_mob/slime/xenobio/rainbow))
|
||||
baby.unity = unity
|
||||
baby.faction = faction
|
||||
baby.friends = friends.Copy()
|
||||
|
||||
step_away(baby, src)
|
||||
return baby
|
||||
|
||||
/mob/living/simple_mob/slime/xenobio/get_description_interaction()
|
||||
var/list/results = list()
|
||||
|
||||
if(!stat)
|
||||
results += "[desc_panel_image("slimebaton")]to stun the slime, if it's being bad."
|
||||
|
||||
results += ..()
|
||||
|
||||
return results
|
||||
|
||||
/mob/living/simple_mob/slime/xenobio/get_description_info()
|
||||
var/list/lines = list()
|
||||
var/intro_line = "Slimes are generally the test subjects of Xenobiology, with different colors having different properties. \
|
||||
They can be extremely dangerous if not handled properly."
|
||||
lines.Add(intro_line)
|
||||
lines.Add(null) // To pad the line breaks.
|
||||
|
||||
var/list/rewards = list()
|
||||
for(var/potential_color in slime_mutation)
|
||||
var/mob/living/simple_mob/slime/S = potential_color
|
||||
rewards.Add(initial(S.slime_color))
|
||||
var/reward_line = "This color of slime can mutate into [english_list(rewards)] colors, when it reproduces. It will do so when it has eatten enough."
|
||||
lines.Add(reward_line)
|
||||
lines.Add(null)
|
||||
|
||||
lines.Add(description_info)
|
||||
return lines.Join("\n")
|
||||
>>>>>>> 61c4929... Merge pull request #7045 from Neerti/let_them_eat_all_the_cake
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user