From f924f5ef05ba01bf10d28f791e00b5801cb60017 Mon Sep 17 00:00:00 2001 From: Anewbe Date: Fri, 27 Jan 2017 22:58:21 -0600 Subject: [PATCH] Diona can regrow limbs --- .../mob/living/carbon/human/human_helpers.dm | 48 ----------- .../mob/living/carbon/human/human_powers.dm | 81 +++++++++++++++++++ .../human/species/station/prometheans.dm | 39 ++------- .../carbon/human/species/station/station.dm | 3 +- html/changelogs/Anewbe - Regenerate.yml | 36 +++++++++ 5 files changed, 125 insertions(+), 82 deletions(-) create mode 100644 html/changelogs/Anewbe - Regenerate.yml diff --git a/code/modules/mob/living/carbon/human/human_helpers.dm b/code/modules/mob/living/carbon/human/human_helpers.dm index 67561125f1..7682f675b0 100644 --- a/code/modules/mob/living/carbon/human/human_helpers.dm +++ b/code/modules/mob/living/carbon/human/human_helpers.dm @@ -90,54 +90,6 @@ return 0 -/mob/living/carbon/human - var/next_sonar_ping = 0 - -/mob/living/carbon/human/proc/sonar_ping() - set name = "Listen In" - set desc = "Allows you to listen in to movement and noises around you." - set category = "Abilities" - - if(incapacitated()) - src << "You need to recover before you can use this ability." - return - if(world.time < next_sonar_ping) - src << "You need another moment to focus." - return - if(is_deaf() || is_below_sound_pressure(get_turf(src))) - src << "You are for all intents and purposes currently deaf!" - return - next_sonar_ping += 10 SECONDS - var/heard_something = FALSE - src << "You take a moment to listen in to your environment..." - for(var/mob/living/L in range(client.view, src)) - var/turf/T = get_turf(L) - if(!T || L == src || L.stat == DEAD || is_below_sound_pressure(T)) - continue - heard_something = TRUE - var/feedback = list() - feedback += "There are noises of movement " - var/direction = get_dir(src, L) - if(direction) - feedback += "towards the [dir2text(direction)], " - switch(get_dist(src, L) / client.view) - if(0 to 0.2) - feedback += "very close by." - if(0.2 to 0.4) - feedback += "close by." - if(0.4 to 0.6) - feedback += "some distance away." - if(0.6 to 0.8) - feedback += "further away." - else - feedback += "far away." - else // No need to check distance if they're standing right on-top of us - feedback += "right on top of you." - feedback += "" - src << jointext(feedback,null) - if(!heard_something) - src << "You hear no movement but your own." - #undef HUMAN_EATING_NO_ISSUE #undef HUMAN_EATING_NO_MOUTH #undef HUMAN_EATING_BLOCKED_MOUTH diff --git a/code/modules/mob/living/carbon/human/human_powers.dm b/code/modules/mob/living/carbon/human/human_powers.dm index 7a27e3c341..0567be8e8f 100644 --- a/code/modules/mob/living/carbon/human/human_powers.dm +++ b/code/modules/mob/living/carbon/human/human_powers.dm @@ -175,3 +175,84 @@ output += "[IO.name] - OK\n" src << output + +/mob/living/carbon/human + var/next_sonar_ping = 0 + +/mob/living/carbon/human/proc/sonar_ping() + set name = "Listen In" + set desc = "Allows you to listen in to movement and noises around you." + set category = "Abilities" + + if(incapacitated()) + src << "You need to recover before you can use this ability." + return + if(world.time < next_sonar_ping) + src << "You need another moment to focus." + return + if(is_deaf() || is_below_sound_pressure(get_turf(src))) + src << "You are for all intents and purposes currently deaf!" + return + next_sonar_ping += 10 SECONDS + var/heard_something = FALSE + src << "You take a moment to listen in to your environment..." + for(var/mob/living/L in range(client.view, src)) + var/turf/T = get_turf(L) + if(!T || L == src || L.stat == DEAD || is_below_sound_pressure(T)) + continue + heard_something = TRUE + var/feedback = list() + feedback += "There are noises of movement " + var/direction = get_dir(src, L) + if(direction) + feedback += "towards the [dir2text(direction)], " + switch(get_dist(src, L) / client.view) + if(0 to 0.2) + feedback += "very close by." + if(0.2 to 0.4) + feedback += "close by." + if(0.4 to 0.6) + feedback += "some distance away." + if(0.6 to 0.8) + feedback += "further away." + else + feedback += "far away." + else // No need to check distance if they're standing right on-top of us + feedback += "right on top of you." + feedback += "" + src << jointext(feedback,null) + if(!heard_something) + src << "You hear no movement but your own." + +/mob/living/carbon/human/proc/regenerate() + set name = "Regenerate" + set desc = "Allows you to regrow limbs and heal organs." + set category = "Abilities" + + if(nutrition < 250) + to_chat(src, "You lack the biomass regrow anything!") + return + + nutrition -= 200 + + // Theoretically the only internal organ a slime will have + // is the slime core. but we might as well be thorough. + for(var/obj/item/organ/I in internal_organs) + if(I.damage > 0) + I.damage = 0 + to_chat(src, "You feel a soothing sensation within your [I.name]...") + + // Replace completely missing limbs. + for(var/limb_type in src.species.has_limbs) + var/obj/item/organ/external/E = src.organs_by_name[limb_type] + if(E && (E.is_stump() || (E.status & (ORGAN_DESTROYED|ORGAN_DEAD|ORGAN_MUTATED)))) + E.removed() + qdel(E) + E = null + if(!E) + var/list/organ_data = src.species.has_limbs[limb_type] + var/limb_path = organ_data["path"] + var/obj/item/organ/O = new limb_path(src) + organ_data["descriptor"] = O.name + to_chat(src, "You feel a slithering sensation as your [O.name] reform.") + src.update_body() diff --git a/code/modules/mob/living/carbon/human/species/station/prometheans.dm b/code/modules/mob/living/carbon/human/species/station/prometheans.dm index 863fb7d029..e7b4588e8f 100644 --- a/code/modules/mob/living/carbon/human/species/station/prometheans.dm +++ b/code/modules/mob/living/carbon/human/species/station/prometheans.dm @@ -28,9 +28,9 @@ var/datum/species/shapeshifter/promethean/prometheans breath_type = null poison_type = null - gluttonous = 2 + gluttonous = 1 virus_immune = 1 - blood_volume = 600 + blood_volume = 560 min_age = 1 max_age = 5 brute_mod = 0.5 @@ -73,7 +73,8 @@ var/datum/species/shapeshifter/promethean/prometheans /mob/living/carbon/human/proc/shapeshifter_select_shape, /mob/living/carbon/human/proc/shapeshifter_select_colour, /mob/living/carbon/human/proc/shapeshifter_select_hair, - /mob/living/carbon/human/proc/shapeshifter_select_gender + /mob/living/carbon/human/proc/shapeshifter_select_gender, + /mob/living/carbon/human/proc/regenerate ) valid_transform_species = list("Human", "Unathi", "Tajara", "Skrell", "Diona", "Teshari", "Monkey") @@ -130,42 +131,14 @@ var/datum/species/shapeshifter/promethean/prometheans var/obj/effect/decal/cleanable/C = locate() in T if(C) qdel(C) - //TODO: gain nutriment - - // Regenerate limbs and heal damage if we have any. Copied from Bay xenos code. - - // Theoretically the only internal organ a slime will have - // is the slime core. but we might as well be thorough. - for(var/obj/item/organ/I in H.internal_organs) - if(I.damage > 0) - I.damage = max(I.damage - heal_rate, 0) - if (prob(5)) - H << "You feel a soothing sensation within your [I.name]..." - return 1 - - // Replace completely missing limbs. - for(var/limb_type in has_limbs) - var/obj/item/organ/external/E = H.organs_by_name[limb_type] - if(E && (E.is_stump() || (E.status & (ORGAN_DESTROYED|ORGAN_DEAD|ORGAN_MUTATED)))) - E.removed() - qdel(E) - E = null - if(!E) - var/list/organ_data = has_limbs[limb_type] - var/limb_path = organ_data["path"] - var/obj/item/organ/O = new limb_path(H) - organ_data["descriptor"] = O.name - H << "You feel a slithering sensation as your [O.name] reforms." - H.update_body() - return 1 + H.nutrition += rand(15, 45) // Heal remaining damage. - if (H.getBruteLoss() || H.getFireLoss() || H.getOxyLoss() || H.getToxLoss()) + if(H.getBruteLoss() || H.getFireLoss() || H.getOxyLoss() || H.getToxLoss()) H.adjustBruteLoss(-heal_rate) H.adjustFireLoss(-heal_rate) H.adjustOxyLoss(-heal_rate) H.adjustToxLoss(-heal_rate) - return 1 /datum/species/shapeshifter/promethean/get_blood_colour(var/mob/living/carbon/human/H) return (H ? rgb(H.r_skin, H.g_skin, H.b_skin) : ..()) diff --git a/code/modules/mob/living/carbon/human/species/station/station.dm b/code/modules/mob/living/carbon/human/species/station/station.dm index d68a399f7f..28eb05bc25 100644 --- a/code/modules/mob/living/carbon/human/species/station/station.dm +++ b/code/modules/mob/living/carbon/human/species/station/station.dm @@ -246,7 +246,8 @@ ) inherent_verbs = list( - /mob/living/carbon/human/proc/diona_split_nymph + /mob/living/carbon/human/proc/diona_split_nymph, + /mob/living/carbon/human/proc/regenerate ) warning_low_pressure = 50 diff --git a/html/changelogs/Anewbe - Regenerate.yml b/html/changelogs/Anewbe - Regenerate.yml new file mode 100644 index 0000000000..ceb22cbc17 --- /dev/null +++ b/html/changelogs/Anewbe - Regenerate.yml @@ -0,0 +1,36 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +################################# + +# Your name. +author: Anewbe + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - rscadd: "Diona can regenerate organs and limbs."