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

Regenerative slime extract rework #2275

Merged
merged 20 commits into from
Jul 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
720f743
Regenerative slime extract rework
Absolucy Jun 14, 2024
3c9795b
Merge branch 'master' of https://github.com/Monkestation/Monkestation…
Absolucy Jun 25, 2024
599390f
It all works!
Absolucy Jun 25, 2024
b7c7733
Updated effect descriptions to reflect new effects.
Absolucy Jun 25, 2024
5b90b2f
Merge branch 'master' of https://github.com/Monkestation/Monkestation…
Absolucy Jun 25, 2024
b48781e
Documentation!
Absolucy Jun 25, 2024
0867136
Don't allow rainbow regen spamming
Absolucy Jun 25, 2024
6831054
apply review stuff
Absolucy Jun 25, 2024
8bf3656
Document `cmp_wound_severity_dsc`
Absolucy Jun 25, 2024
6407d28
Merge branch 'master' of https://github.com/Monkestation/Monkestation…
Absolucy Jun 25, 2024
9e3f90d
Overly verbose extract descriptions.
Absolucy Jun 25, 2024
ab4d7ee
regen purple adjustments
Absolucy Jun 28, 2024
abff5d9
Adjustments to stabilized rainbow to ensure they work to their fulles…
Absolucy Jun 30, 2024
bd89a30
Merge branch 'master' of https://github.com/Monkestation/Monkestation…
Absolucy Jun 30, 2024
9b887e8
Merge branch 'master' of https://github.com/Monkestation/Monkestation…
Absolucy Jul 3, 2024
c7fbf5d
Fix stabilized rainbows
Absolucy Jul 3, 2024
a1fa3e2
Merge branch 'master' of https://github.com/Monkestation/Monkestation…
Absolucy Jul 6, 2024
2597afd
no curing antag traumas
Absolucy Jul 6, 2024
1c54f74
Merge branch 'master' of https://github.com/Monkestation/Monkestation…
Absolucy Jul 6, 2024
7b80034
weh
Absolucy Jul 6, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@
#define COMSIG_STACK_MOVE "stack_move"
#define COMSIG_CHECK_CAN_ADD_NEW_STACK "check_stack_add"
#define COMSIG_MOBSTACKER_DESTROY "mobstack_destroy_stack"

#define COMSIG_SLIME_REGEN_CALC "slime_regen_calc"
5 changes: 5 additions & 0 deletions code/__HELPERS/~monkestation-helpers/cmp.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@

/proc/cmp_mob_playtime_dsc(mob/a, mob/b)
return cmp_numeric_dsc(a?.client?.get_exp_living(TRUE), b?.client?.get_exp_living(TRUE))

/// Sorts between two wounds, descending by their severity.
/// Use when you want a list of most to least severe wounds.
/proc/cmp_wound_severity_dsc(datum/wound/a, datum/wound/b)
Absolucy marked this conversation as resolved.
Show resolved Hide resolved
return cmp_numeric_dsc(a.severity, b.severity)
3 changes: 2 additions & 1 deletion code/datums/dna.dm
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,8 @@ GLOBAL_LIST_INIT(total_uf_len_by_block, populate_total_uf_len_by_block())
update_mutations_overlay()// no lizard with human hulk overlay please.


/mob/proc/has_dna()
/mob/proc/has_dna() as /datum/dna
RETURN_TYPE(/datum/dna)
return

/mob/living/carbon/has_dna()
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/carbon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,7 @@
set_handcuffed(null)
update_handcuffed()

stamina.adjust(stamina.maximum, TRUE)
stamina.revitalize(forced = TRUE)
return ..()

/mob/living/carbon/can_be_revived()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -445,12 +445,18 @@
/// Colour of the extract providing the buff
var/colour = "null"

/datum/status_effect/stabilized/Destroy()
if(linked_extract?.linked_effect == src)
linked_extract.linked_effect = null
linked_extract = null
return ..()

/datum/status_effect/stabilized/on_creation(mob/living/new_owner, obj/item/slimecross/stabilized/linked_extract)
src.linked_extract = linked_extract
return ..()

/datum/status_effect/stabilized/tick()
if(isnull(linked_extract))
if(QDELETED(linked_extract))
qdel(src)
return
if(linked_extract.get_held_mob() == owner)
Expand Down Expand Up @@ -1070,6 +1076,7 @@
id = "stabilizedrainbow"
colour = "rainbow"

/* monkestation edit: replaced in [monkestation\code\modules\slimecore\crossbreeding\stabilized.dm]
/datum/status_effect/stabilized/rainbow/tick()
if(owner.health <= 0)
var/obj/item/slimecross/stabilized/rainbow/X = linked_extract
Expand All @@ -1081,3 +1088,4 @@
qdel(src)
qdel(linked_extract)
return ..()
*/
58 changes: 33 additions & 25 deletions code/modules/research/xenobiology/crossbreeding/regenerative.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Regenerative extracts:
Work like a legion regenerative core.
Has a unique additional effect.
HEAVILY REWORKED BY MONKESTATION, SEE [monkestation\code\modules\slimecore\crossbreeding\regenerative]
*/
/obj/item/slimecross/regenerative
name = "regenerative extract"
Expand All @@ -14,6 +16,7 @@ Regenerative extracts:
/obj/item/slimecross/regenerative/proc/core_effect_before(mob/living/carbon/human/target, mob/user)
return

/* monkestation edit: overriden in [monkestation\code\modules\slimecore\crossbreeding\regenerative\extract.dm]
/obj/item/slimecross/regenerative/afterattack(atom/target,mob/user,prox)
. = ..()
if(!prox || !isliving(target))
Expand All @@ -33,30 +36,33 @@ Regenerative extracts:
core_effect(H, user)
playsound(target, 'sound/effects/splat.ogg', 40, TRUE)
qdel(src)
*/

/obj/item/slimecross/regenerative/grey
colour = "grey" //Has no bonus effect.
effect_desc = "Fully heals the target and does nothing else."
effect_desc = "Rapidly heals the target and does nothing else." // monkestation edit: updates effect_desc to reflect the rework

/obj/item/slimecross/regenerative/orange
colour = "orange"

/obj/item/slimecross/regenerative/orange/core_effect_before(mob/living/target, mob/user)
target.visible_message(span_warning("The [src] boils over!"))
target.visible_message(span_warning("\The [src] boils over!"))
for(var/turf/targetturf in RANGE_TURFS(1,target))
if(!locate(/obj/effect/hotspot) in targetturf)
new /obj/effect/hotspot(targetturf)

/obj/item/slimecross/regenerative/purple
colour = "purple"
effect_desc = "Fully heals the target and injects them with some regen jelly."
effect_desc = "Rapidly heals the target at an even greater rate, and injects them with some regenerative jelly afterwards. Prevents softcrit while active." // monkestation edit: updates effect_desc to reflect the rework

/* monkestation edit: moved functionality to status effect
/obj/item/slimecross/regenerative/purple/core_effect(mob/living/target, mob/user)
target.reagents.add_reagent(/datum/reagent/medicine/regen_jelly,10)
*/

/obj/item/slimecross/regenerative/blue
colour = "blue"
effect_desc = "Fully heals the target and makes the floor wet."
effect_desc = "Rapidly heals the target and makes the floor wet." // monkestation edit: updates effect_desc to reflect the rework

/obj/item/slimecross/regenerative/blue/core_effect(mob/living/target, mob/user)
if(isturf(target.loc))
Expand All @@ -66,7 +72,7 @@ Regenerative extracts:

/obj/item/slimecross/regenerative/metal
colour = "metal"
effect_desc = "Fully heals the target and encases the target in a locker."
effect_desc = "Rapidly heals the target and encases the target in a locker." // monkestation edit: updates effect_desc to reflect the rework

/obj/item/slimecross/regenerative/metal/core_effect(mob/living/target, mob/user)
target.visible_message(span_warning("The milky goo hardens and reshapes itself, encasing [target]!"))
Expand All @@ -77,7 +83,7 @@ Regenerative extracts:

/obj/item/slimecross/regenerative/yellow
colour = "yellow"
effect_desc = "Fully heals the target and fully recharges a single item on the target."
effect_desc = "Rapidly heals the target and fully recharges a single item on the target. Provides shock immunity while active." // monkestation edit: updates effect_desc to reflect the rework

/obj/item/slimecross/regenerative/yellow/core_effect(mob/living/target, mob/user)
var/list/batteries = list()
Expand All @@ -91,7 +97,7 @@ Regenerative extracts:

/obj/item/slimecross/regenerative/darkpurple
colour = "dark purple"
effect_desc = "Fully heals the target and gives them purple clothing if they are naked."
effect_desc = "Rapidly heals the target and gives them purple clothing if they are naked." // monkestation edit: updates effect_desc to reflect the rework

/obj/item/slimecross/regenerative/darkpurple/core_effect(mob/living/target, mob/user)
var/equipped = 0
Expand All @@ -104,7 +110,7 @@ Regenerative extracts:

/obj/item/slimecross/regenerative/darkblue
colour = "dark blue"
effect_desc = "Fully heals the target and fireproofs their clothes."
effect_desc = "Rapidly heals the target and fireproofs their clothes." // monkestation edit: updates effect_desc to reflect the rework

/obj/item/slimecross/regenerative/darkblue/core_effect(mob/living/target, mob/user)
if(!ishuman(target))
Expand Down Expand Up @@ -132,15 +138,17 @@ Regenerative extracts:

/obj/item/slimecross/regenerative/silver
colour = "silver"
effect_desc = "Fully heals the target and makes their belly feel round and full."
effect_desc = "Rapidly heals the target, regenerating their nutrition at a far greater rate than normal" // monkestation edit: updates effect_desc to reflect the rework

/* monkestation edit: replaced in [monkestation\code\modules\slimecore\crossbreeding\regenerative\extract.dm]
/obj/item/slimecross/regenerative/silver/core_effect(mob/living/target, mob/user)
target.set_nutrition(NUTRITION_LEVEL_FULL - 1)
to_chat(target, span_notice("You feel satiated."))
*/

/obj/item/slimecross/regenerative/bluespace
colour = "bluespace"
effect_desc = "Fully heals the target and teleports them to where this core was created."
effect_desc = "Rapidly heals the target and teleports them to where this core was created." // monkestation edit: updates effect_desc to reflect the rework
var/turf/open/T

/obj/item/slimecross/regenerative/bluespace/core_effect(mob/living/target, mob/user)
Expand All @@ -156,64 +164,64 @@ Regenerative extracts:

/obj/item/slimecross/regenerative/sepia
colour = "sepia"
effect_desc = "Fully heals the target. After 10 seconds, relocate the target to the initial position the core was used with their previous health status."
effect_desc = "Rapidly heals the target. After 10 seconds, relocate the target to the initial position the core was used with their previous health status." // monkestation edit: updates effect_desc to reflect the rework

/obj/item/slimecross/regenerative/sepia/core_effect_before(mob/living/target, mob/user)
to_chat(target, span_notice("You try to forget how you feel."))
target.AddComponent(/datum/component/dejavu)

/obj/item/slimecross/regenerative/cerulean
colour = "cerulean"
effect_desc = "Fully heals the target and makes a second regenerative core with no special effects."
effect_desc = "Rapidly heals the target and makes a second regenerative core with no special effects." // monkestation edit: updates effect_desc to reflect the rework

/obj/item/slimecross/regenerative/cerulean/core_effect(mob/living/target, mob/user)
src.forceMove(user.loc)
var/obj/item/slimecross/X = new /obj/item/slimecross/regenerative(user.loc)
var/obj/item/slimecross/X = new /obj/item/slimecross/regenerative(user.drop_location())
X.name = name
X.desc = desc
user.put_in_active_hand(X)
to_chat(user, span_notice("Some of the milky goo congeals in your hand!"))

/obj/item/slimecross/regenerative/pyrite
colour = "pyrite"
effect_desc = "Fully heals and randomly colors the target."
effect_desc = "Rapidly heals and randomly colors the target." // monkestation edit: updates effect_desc to reflect the rework

/obj/item/slimecross/regenerative/pyrite/core_effect(mob/living/target, mob/user)
target.visible_message(span_warning("The milky goo coating [target] leaves [target.p_them()] a different color!"))
target.add_atom_colour(rgb(rand(0,255),rand(0,255),rand(0,255)),WASHABLE_COLOUR_PRIORITY)

/obj/item/slimecross/regenerative/red
colour = "red"
effect_desc = "Fully heals the target and injects them with some ephedrine."
effect_desc = "Rapidly heals the target and injects them with some ephedrine." // monkestation edit: updates effect_desc to reflect the rework

/obj/item/slimecross/regenerative/red/core_effect(mob/living/target, mob/user)
to_chat(target, span_notice("You feel... <i>faster.</i>"))
target.reagents.add_reagent(/datum/reagent/medicine/ephedrine,3)

/obj/item/slimecross/regenerative/green
colour = "green"
effect_desc = "Fully heals the target and changes the spieces or color of a slime or jellyperson."
effect_desc = "Rapidly heals the target and changes the species or color of a slime or jellyperson." // monkestation edit: updates effect_desc to reflect the rework

/obj/item/slimecross/regenerative/green/core_effect(mob/living/target, mob/user)
if(isslime(target))
target.visible_message(span_warning("The [target] suddenly changes color!"))
target.visible_message(span_warning("\The [target] suddenly changes color!"))
var/mob/living/basic/slime/S = target
S.start_mutating(TRUE)
if(isjellyperson(target))
target.reagents.add_reagent(/datum/reagent/mutationtoxin/jelly,5)
target.reagents.add_reagent(/datum/reagent/mutationtoxin/jelly, 5)


/obj/item/slimecross/regenerative/pink
colour = "pink"
effect_desc = "Fully heals the target and injects them with some krokodil."
effect_desc = "Rapidly heals the target and injects them with some krokodil." // monkestation edit: updates effect_desc to reflect the rework

/obj/item/slimecross/regenerative/pink/core_effect(mob/living/target, mob/user)
to_chat(target, span_notice("You feel more calm."))
target.reagents.add_reagent(/datum/reagent/drug/krokodil,4)

/obj/item/slimecross/regenerative/gold
colour = "gold"
effect_desc = "Fully heals the target and produces a random coin."
effect_desc = "Rapidly heals the target and produces a random coin." // monkestation edit: updates effect_desc to reflect the rework

/obj/item/slimecross/regenerative/gold/core_effect(mob/living/target, mob/user)
var/newcoin = pick(/obj/item/coin/silver, /obj/item/coin/iron, /obj/item/coin/gold, /obj/item/coin/diamond, /obj/item/coin/plasma, /obj/item/coin/uranium)
Expand All @@ -223,7 +231,7 @@ Regenerative extracts:

/obj/item/slimecross/regenerative/oil
colour = "oil"
effect_desc = "Fully heals the target and flashes everyone in sight."
effect_desc = "Rapidly heals the target and flashes everyone in sight." // monkestation edit: updates effect_desc to reflect the rework

/obj/item/slimecross/regenerative/oil/core_effect(mob/living/target, mob/user)
playsound(src, 'sound/weapons/flash.ogg', 100, TRUE)
Expand All @@ -232,7 +240,7 @@ Regenerative extracts:

/obj/item/slimecross/regenerative/black
colour = "black"
effect_desc = "Fully heals the target and creates an imperfect duplicate of them made of slime, that fakes their death."
effect_desc = "Rapidly heals the target and creates an imperfect duplicate of them made of slime, that fakes their death." // monkestation edit: updates effect_desc to reflect the rework

/obj/item/slimecross/regenerative/black/core_effect_before(mob/living/target, mob/user)
var/dummytype = target.type
Expand All @@ -255,7 +263,7 @@ Regenerative extracts:

/obj/item/slimecross/regenerative/lightpink
colour = "light pink"
effect_desc = "Fully heals the target and also heals the user."
effect_desc = "Rapidly heals the target and also heals the user." // monkestation edit: updates effect_desc to reflect the rework

/obj/item/slimecross/regenerative/lightpink/core_effect(mob/living/target, mob/user)
if(!isliving(user))
Expand All @@ -268,14 +276,14 @@ Regenerative extracts:

/obj/item/slimecross/regenerative/adamantine
colour = "adamantine"
effect_desc = "Fully heals the target and boosts their armor."
effect_desc = "Rapidly heals the target, while boosting their armor and general resilience." // monkestation edit: updates effect_desc to reflect the rework, also a typo fix

/obj/item/slimecross/regenerative/adamantine/core_effect(mob/living/target, mob/user) //WIP - Find out why this doesn't work.
target.apply_status_effect(/datum/status_effect/slimeskin)

/obj/item/slimecross/regenerative/rainbow
colour = "rainbow"
effect_desc = "Fully heals the target and temporarily makes them immortal, but pacifistic."
effect_desc = "Fully heals the target, including all forms of damage, wounds, brain traumas, sickness, blood loss, and unsafe body temperature. Does not regrow limbs (except for oozelings) or refresh organs. Temporarily makes them immortal, but pacifistic." // monkestation edit: updates effect_desc to reflect the rework, also a typo fix

/obj/item/slimecross/regenerative/rainbow/core_effect(mob/living/target, mob/user)
target.apply_status_effect(/datum/status_effect/rainbow_protection)
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/datum/status_effect/regenerative_extract/purple
base_healing_amt = 10
diminishing_multiplier = 0.5
diminish_time = 1.5 MINUTES
extra_traits = list(TRAIT_NOCRITOVERLAY, TRAIT_NOSOFTCRIT)

/datum/status_effect/regenerative_extract/purple/on_remove()
. = ..()
if(owner.has_dna()?.species?.reagent_tag & PROCESS_ORGANIC) // won't work during cooldown, and won't waste effort injecting into IPCs
var/inject_amt = round(10 * multiplier)
if(inject_amt >= 1)
owner.reagents?.add_reagent(/datum/reagent/medicine/regen_jelly, inject_amt)


/datum/status_effect/regenerative_extract/silver
base_healing_amt = 4
nutrition_heal_cap = NUTRITION_LEVEL_WELL_FED + 50
diminishing_multiplier = 0.8
diminish_time = 30 SECONDS
extra_traits = list(TRAIT_NOFAT)

/datum/status_effect/regenerative_extract/yellow
extra_traits = list(TRAIT_SHOCKIMMUNE, TRAIT_TESLA_SHOCKIMMUNE, TRAIT_AIRLOCK_SHOCKIMMUNE)

/datum/status_effect/regenerative_extract/adamantine
extra_traits = list(TRAIT_FEARLESS, TRAIT_HARDLY_WOUNDED)

// rainbow extracts are similar to old regen extract effects, albeit it won't replace your organs, and won't heal limbs (unless you're an oozeling)
#define RAINBOW_HEAL_FLAGS ~(HEAL_ADMIN | HEAL_RESTRAINTS | HEAL_LIMBS | HEAL_REFRESH_ORGANS)

/datum/status_effect/regenerative_extract/rainbow
alert_type = null
diminishing_multiplier = 0 // you can't use other extracts at all during this time
tick_interval = -1

/datum/status_effect/regenerative_extract/rainbow/on_apply()
var/heal_flags = RAINBOW_HEAL_FLAGS
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably just be on regenerative_extract in case people want to change the effects of a regen extract to do something like heal organs or heal limbs.

if(isoozeling(owner)) // have some mercy on oozelings
heal_flags |= HEAL_LIMBS
owner.revive(heal_flags)
return FALSE // return false so we immediately clear the effect and start the cooldown


#undef RAINBOW_HEAL_FLAGS
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/datum/status_effect/slime_regen_cooldown
id = "slime_regen_cooldown"
status_type = STATUS_EFFECT_MULTIPLE
tick_interval = -1
alert_type = null
remove_on_fullheal = TRUE
heal_flag_necessary = HEAL_ADMIN
/// The multiplier applied to the effect of a regen extract while this cooldown is active.
/// As multiple cooldowns can be active at the same time, these multipliers stack, resulting in exponentially diminishing returns.
var/multiplier = 1
Absolucy marked this conversation as resolved.
Show resolved Hide resolved

/datum/status_effect/slime_regen_cooldown/on_creation(mob/living/new_owner, multiplier = 1, duration = 45 SECONDS)
src.multiplier = multiplier
src.duration = duration
return ..()

/datum/status_effect/slime_regen_cooldown/on_apply()
RegisterSignal(owner, COMSIG_SLIME_REGEN_CALC, PROC_REF(apply_multiplier))
return TRUE

/datum/status_effect/slime_regen_cooldown/on_remove()
UnregisterSignal(owner, COMSIG_SLIME_REGEN_CALC)

/datum/status_effect/slime_regen_cooldown/proc/apply_multiplier(datum/source, multiplier_ptr)
SIGNAL_HANDLER
*multiplier_ptr *= multiplier
Loading
Loading