mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-15 18:14:22 +01:00
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:
@@ -238,8 +238,10 @@
|
||||
processed_slime.forceMove(drop_location())
|
||||
processed_slime.balloon_alert_to_viewers("crawls free")
|
||||
return
|
||||
|
||||
var/core_count = processed_slime.cores
|
||||
for(var/i in 1 to (core_count+rating_amount-1))
|
||||
var/extra_cores = rating_amount - 1 // 0-3 bonus cores above what slime already has with upgraded parts
|
||||
for(var/i in 1 to (core_count + extra_cores))
|
||||
var/atom/movable/item = new processed_slime.slime_type.core_type(drop_location())
|
||||
adjust_item_drop_location(item)
|
||||
SSblackbox.record_feedback("tally", "slime_core_harvested", 1, processed_slime.slime_type.colour)
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -37,23 +37,15 @@
|
||||
|
||||
/datum/surgery_step/extract_core/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results = FALSE)
|
||||
var/mob/living/basic/slime/target_slime = target
|
||||
if(target_slime.cores > 0)
|
||||
target_slime.cores--
|
||||
var/core_count = target_slime.cores
|
||||
if(core_count && target_slime.try_extract_cores(count = core_count))
|
||||
display_results(
|
||||
user,
|
||||
target,
|
||||
span_notice("You successfully extract a core from [target]. [target_slime.cores] core\s remaining."),
|
||||
span_notice("[user] successfully extracts a core from [target]!"),
|
||||
span_notice("[user] successfully extracts a core from [target]!"),
|
||||
span_notice("You successfully extract [core_count] core\s from [target]."),
|
||||
span_notice("[user] successfully extracts [core_count] core\s from [target]!"),
|
||||
span_notice("[user] successfully extracts [core_count] core\s from [target]!"),
|
||||
)
|
||||
|
||||
new target_slime.slime_type.core_type(target_slime.loc)
|
||||
|
||||
if(target_slime.cores <= 0)
|
||||
target_slime.icon_state = "[target_slime.slime_type.colour] baby slime dead-nocore"
|
||||
return ..()
|
||||
else
|
||||
return FALSE
|
||||
else
|
||||
to_chat(user, span_warning("There aren't any cores left in [target]!"))
|
||||
return ..()
|
||||
return TRUE
|
||||
to_chat(user, span_warning("There aren't any cores left in [target]!"))
|
||||
return ..()
|
||||
|
||||
Reference in New Issue
Block a user