Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slimes now feed faster, and attach to placed monkeys automatically #1192

Merged
merged 2 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions code/modules/mob/living/simple_animal/slime/life.dm
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,14 @@
if(stat)
Feedstop(silent = TRUE)

// monke start: make slimes feed faster on mindless mobs and monkeys
var/feed_multiplier = 1
if(QDELETED(prey.mind) && !istype(prey, /mob/living/simple_animal/pet) && !istype(prey, /mob/living/basic/pet)) // pets have an honorary soul in my book
feed_multiplier += 1
if(ismonkey(prey))
feed_multiplier += 0.5
// monke end

if(prey.stat == DEAD) // our victim died
if(!client)
if(!rabid && !attacked)
Expand All @@ -183,8 +191,8 @@
return

if(iscarbon(prey))
prey.adjustCloneLoss(rand(2, 4) * 0.5 * seconds_per_tick)
prey.adjustToxLoss(rand(1, 2) * 0.5 * seconds_per_tick)
prey.adjustCloneLoss(rand(2, 4) * 0.5 * seconds_per_tick * feed_multiplier) // monke edit: make slimes feed faster on mindless mobs and monkeys
prey.adjustToxLoss(rand(1, 2) * 0.5 * seconds_per_tick * feed_multiplier) // monke edit: make slimes feed faster on mindless mobs and monkeys

if(SPT_PROB(5, seconds_per_tick) && prey.client)
to_chat(prey, "<span class='userdanger'>[pick("You can feel your body becoming weak!", \
Expand All @@ -199,8 +207,8 @@
var/mob/living/animal_victim = prey

var/totaldamage = 0 //total damage done to this unfortunate animal
totaldamage += animal_victim.adjustCloneLoss(rand(2, 4) * 0.5 * seconds_per_tick)
totaldamage += animal_victim.adjustToxLoss(rand(1, 2) * 0.5 * seconds_per_tick)
totaldamage += animal_victim.adjustCloneLoss(rand(2, 4) * 0.5 * seconds_per_tick * feed_multiplier) // monke edit: make slimes feed faster on mindless mobs and monkeys
totaldamage += animal_victim.adjustToxLoss(rand(1, 2) * 0.5 * seconds_per_tick * feed_multiplier) // monke edit: make slimes feed faster on mindless mobs and monkeys

if(totaldamage <= 0) //if we did no(or negative!) damage to it, stop
Feedstop(0, 0)
Expand All @@ -210,10 +218,10 @@
Feedstop(0, 0)
return

add_nutrition((rand(7, 15) * 0.5 * seconds_per_tick * CONFIG_GET(number/damage_multiplier)))
add_nutrition((rand(7, 15) * 0.5 * seconds_per_tick * CONFIG_GET(number/damage_multiplier)) * feed_multiplier) // monke edit: make slimes feed faster on mindless mobs and monkeys

//Heal yourself.
adjustBruteLoss(-1.5 * seconds_per_tick)
adjustBruteLoss(-1.5 * seconds_per_tick * feed_multiplier) // monke edit: make slimes feed faster on mindless mobs and monkeys

/mob/living/simple_animal/slime/proc/handle_nutrition(seconds_per_tick, times_fired)

Expand Down
2 changes: 2 additions & 0 deletions code/modules/research/xenobiology/xenobio_camera.dm
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@
food.LAssailant = WEAKREF(C)
X.monkeys--
X.monkeys = round(X.monkeys, 0.1) //Prevents rounding errors
remote_eye.auto_attach_slime(food) // monke edit: hungry slimes that aren't feeding will now immediately latch onto monkeys placed on top of them
to_chat(owner, span_notice("[X] now has [X.monkeys] monkeys stored."))
else
to_chat(owner, span_warning("[X] needs to have at least 1 monkey stored. Currently has [X.monkeys] monkeys stored."))
Expand Down Expand Up @@ -421,6 +422,7 @@
food.LAssailant = WEAKREF(C)
X.monkeys--
X.monkeys = round(X.monkeys, 0.1) //Prevents rounding errors
E.auto_attach_slime(food) // monke edit: hungry slimes that aren't feeding will now immediately latch onto monkeys placed on top of them
to_chat(C, span_notice("[X] now has [X.monkeys] monkeys stored."))
else
to_chat(C, span_warning("[X] needs to have at least 1 monkey stored. Currently has [X.monkeys] monkeys stored."))
Expand Down
15 changes: 15 additions & 0 deletions monkestation/code/modules/research/xenobiology/xenobio_camera.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/mob/camera/ai_eye/remote/xenobio/proc/auto_attach_slime(mob/living/carbon/human/food)
var/mob/living/simple_animal/slime/glutton
for(var/mob/living/simple_animal/slime/slime in range(1, loc))
if(slime.ckey || slime.amount_grown >= SLIME_EVOLUTION_THRESHOLD)
continue
var/mob/living/slime_eating = slime.buckled
if(!isliving(slime_eating) || slime_eating.stat < DEAD)
continue
if(glutton?.is_adult && !slime.is_adult)
// adult slimes can react faster than baby slimes
continue
if(QDELETED(glutton) || (!glutton.is_adult && slime.is_adult) || (slime.amount_grown > glutton.amount_grown))
glutton = slime
if(!QDELETED(glutton))
addtimer(CALLBACK(glutton, TYPE_PROC_REF(/mob/living/simple_animal/slime, Feedon), food), rand(0.1 SECONDS, 0.9 SECONDS))
1 change: 1 addition & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -6609,6 +6609,7 @@
#include "monkestation\code\modules\research\nanites\nanite_programs\utility.dm"
#include "monkestation\code\modules\research\nanites\nanite_programs\weapon.dm"
#include "monkestation\code\modules\research\techweb\all_nodes.dm"
#include "monkestation\code\modules\research\xenobiology\xenobio_camera.dm"
#include "monkestation\code\modules\security\code\holographic_handcuffs.dm"
#include "monkestation\code\modules\security\code\weapons\lawbringer.dm"
#include "monkestation\code\modules\security\code\weapons\paco.dm"
Expand Down
Loading