Slime core removal surgery changes (#84241)

## About The Pull Request

Fixed an issue with incorrect slime dead icon after core removal
surgery. Made the surgery yield all cores in case if the slime had a
steroid potion applied.

## Why It's Good For The Game

The icon was broken. Less clicks for surgery.

## Changelog

🆑
fix: Fixed dead slime icon not showing when cores are extracted
qol: Slime core removal surgery extracts all cores on completion
/🆑
This commit is contained in:
Andrew
2024-07-12 18:20:58 +03:00
committed by GitHub
parent 0eef564954
commit c8dcee1b61
3 changed files with 32 additions and 21 deletions
+21 -4
View File
@@ -189,15 +189,17 @@
cut_overlays()
if(slime_type.transparent)
alpha = SLIME_TRANSPARENCY_ALPHA
var/icon_text = "[slime_type.colour]-[life_stage]"
icon_dead = "[icon_text]-dead"
icon_dead = !cores ? "[slime_type.colour]-cut" : "[slime_type.colour]-[life_stage]-dead"
if(stat != DEAD)
icon_state = icon_text
icon_state = "[slime_type.colour]-[life_stage]"
if(current_mood && current_mood != SLIME_MOOD_NONE && !stat)
add_overlay("aslime-[current_mood]")
else
icon_state = icon_dead
..()
return ..()
/mob/living/basic/slime/get_status_tab_items()
. = ..()
@@ -364,6 +366,21 @@
visible_message(span_warning("The mutated core shudders, and collapses into a puddle, unable to maintain its form."))
qdel(src)
///Proc for slime core removal surgery, tries to remove cores from a dead slime.
/mob/living/basic/slime/proc/try_extract_cores(count = 1)
if(stat != DEAD)
return FALSE
if(count <= 0 || cores < count)
return FALSE
var/core_count = min(count, cores)
for(var/i in 1 to core_count)
new slime_type.core_type(loc)
cores--
regenerate_icons()
return TRUE
///Makes the slime peaceful and content
/mob/living/basic/slime/proc/set_pacified_behaviour()