-
Notifications
You must be signed in to change notification settings - Fork 276
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
108 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
monkestation/code/modules/slimecore/crossbreeding/regenerative/_cooldown.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/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 | ||
var/multiplier = 1 | ||
|
||
/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 |
64 changes: 64 additions & 0 deletions
64
monkestation/code/modules/slimecore/crossbreeding/regenerative/_effect.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/datum/status_effect/regenerative_extract | ||
id = "Slime Regeneration" | ||
status_type = STATUS_EFFECT_UNIQUE | ||
duration = 15 SECONDS | ||
tick_interval = 0.5 SECONDS | ||
alert_type = null | ||
var/base_healing_amt = 2 | ||
var/multiplier = 1 | ||
var/diminishing_multiplier = 0.75 | ||
var/diminish_time = 45 SECONDS | ||
var/nutrition_heal_cap = NUTRITION_LEVEL_FED - 50 | ||
var/list/given_traits = list(TRAIT_ANALGESIA, TRAIT_NOCRITDAMAGE) | ||
|
||
/datum/status_effect/regenerative_extract/on_apply() | ||
SEND_SIGNAL(owner, COMSIG_SLIME_REGEN_CALC, &multiplier) | ||
owner.add_traits(given_traits, id) | ||
return TRUE | ||
|
||
/datum/status_effect/regenerative_extract/on_remove() | ||
owner.remove_traits(given_traits, id) | ||
owner.apply_status_effect(/datum/status_effect/slime_regen_cooldown, diminishing_multiplier, diminish_time) | ||
|
||
/datum/status_effect/regenerative_extract/tick(seconds_per_tick, times_fired) | ||
var/heal_amt = base_healing_amt * seconds_per_tick * multiplier | ||
heal_act(heal_amt) | ||
owner.updatehealth() | ||
|
||
/datum/status_effect/regenerative_extract/proc/heal_act(heal_amt) | ||
if(!heal_amt) | ||
return | ||
heal_damage(heal_amt) | ||
heal_misc(heal_amt) | ||
if(iscarbon(owner)) | ||
heal_organs(heal_amt) | ||
heal_wounds() | ||
|
||
/datum/status_effect/regenerative_extract/proc/heal_damage(heal_amt) | ||
owner.heal_overall_damage(brute = heal_amt, burn = heal_amt, updating_health = FALSE) | ||
owner.stamina?.adjust(-heal_amt, forced = TRUE) | ||
owner.adjustOxyLoss(-heal_amt, updating_health = FALSE) | ||
owner.adjustToxLoss(-heal_amt, updating_health = FALSE, forced = TRUE) | ||
owner.adjustCloneLoss(-heal_amt, updating_health = FALSE) | ||
|
||
/datum/status_effect/regenerative_extract/proc/heal_misc(heal_amt) | ||
owner.adjust_disgust(-heal_amt) | ||
if(owner.blood_volume < BLOOD_VOLUME_NORMAL) | ||
owner.blood_volume = min(owner.blood_volume + heal_amt, BLOOD_VOLUME_NORMAL) | ||
if((owner.nutrition < nutrition_heal_cap) && !HAS_TRAIT(owner, TRAIT_NOHUNGER)) | ||
owner.nutrition = min(owner.nutrition + heal_amt, nutrition_heal_cap) | ||
|
||
/datum/status_effect/regenerative_extract/proc/heal_organs(heal_amt) | ||
var/mob/living/carbon/carbon_owner = owner | ||
for(var/obj/item/organ/organ in carbon_owner.organs) | ||
organ.apply_organ_damage(-heal_amt) | ||
carbon_owner.cure_trauma_type(resilience = TRAUMA_RESILIENCE_MAGIC) | ||
|
||
/datum/status_effect/regenerative_extract/proc/heal_wounds() | ||
var/mob/living/carbon/carbon_owner = owner | ||
if(length(carbon_owner.all_wounds)) | ||
var/list/datum/wound/ordered_wounds = sort_list(carbon_owner.all_wounds, GLOBAL_PROC_REF(cmp_wound_severity_dsc)) | ||
ordered_wounds[1]?.remove_wound() | ||
|
||
/datum/status_effect/regenerative_extract/get_examine_text() | ||
return "[owner.p_They()] have a subtle, gentle glow to [owner.p_their()] skin, with slime soothing [owner.p_their()] wounds." |
12 changes: 12 additions & 0 deletions
12
monkestation/code/modules/slimecore/crossbreeding/regenerative/colors.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/datum/status_effect/regenerative_extract/purple | ||
base_healing_amt = 4 | ||
diminishing_multiplier = 0.5 | ||
diminish_time = 1.5 MINUTES | ||
given_traits = list(TRAIT_ANALGESIA, TRAIT_NOCRITDAMAGE, TRAIT_NOCRITOVERLAY, TRAIT_NOSOFTCRIT) | ||
|
||
/datum/status_effect/regenerative_extract/silver | ||
base_healing_amt = 1.5 | ||
nutrition_heal_cap = NUTRITION_LEVEL_WELL_FED + 50 | ||
diminishing_multiplier = 0.8 | ||
diminish_time = 30 SECONDS | ||
given_traits = list(TRAIT_ANALGESIA, TRAIT_NOCRITDAMAGE, TRAIT_NOCRITOVERLAY, TRAIT_NOFAT) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters