Merge pull request #2964 from Anewbe/regenerate

Diona can regrow limbs
This commit is contained in:
Anewbe
2017-01-28 14:13:45 -06:00
committed by GitHub
5 changed files with 125 additions and 82 deletions

View File

@@ -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 << "<span class='warning'>You need to recover before you can use this ability.</span>"
return
if(world.time < next_sonar_ping)
src << "<span class='warning'>You need another moment to focus.</span>"
return
if(is_deaf() || is_below_sound_pressure(get_turf(src)))
src << "<span class='warning'>You are for all intents and purposes currently deaf!</span>"
return
next_sonar_ping += 10 SECONDS
var/heard_something = FALSE
src << "<span class='notice'>You take a moment to listen in to your environment...</span>"
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 += "<span class='notice'>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 += "</span>"
src << jointext(feedback,null)
if(!heard_something)
src << "<span class='notice'>You hear no movement but your own.</span>"
#undef HUMAN_EATING_NO_ISSUE
#undef HUMAN_EATING_NO_MOUTH
#undef HUMAN_EATING_BLOCKED_MOUTH

View File

@@ -175,3 +175,84 @@
output += "[IO.name] - <span style='color:green;'>OK</span>\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 << "<span class='warning'>You need to recover before you can use this ability.</span>"
return
if(world.time < next_sonar_ping)
src << "<span class='warning'>You need another moment to focus.</span>"
return
if(is_deaf() || is_below_sound_pressure(get_turf(src)))
src << "<span class='warning'>You are for all intents and purposes currently deaf!</span>"
return
next_sonar_ping += 10 SECONDS
var/heard_something = FALSE
src << "<span class='notice'>You take a moment to listen in to your environment...</span>"
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 += "<span class='notice'>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 += "</span>"
src << jointext(feedback,null)
if(!heard_something)
src << "<span class='notice'>You hear no movement but your own.</span>"
/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, "<span class='warning'>You lack the biomass regrow anything!</span>")
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, "<span class='notice'>You feel a soothing sensation within your [I.name]...</span>")
// 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, "<span class='notice'>You feel a slithering sensation as your [O.name] reform.</span>")
src.update_body()

View File

@@ -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 << "<span class='notice'>You feel a soothing sensation within your [I.name]...</span>"
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 << "<span class='notice'>You feel a slithering sensation as your [O.name] reforms.</span>"
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) : ..())

View File

@@ -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