From dc4c4977a495c928fd854a0f6b8d1b1e6b88f283 Mon Sep 17 00:00:00 2001 From: Crazylemon64 Date: Mon, 1 Feb 2016 21:11:11 -0800 Subject: [PATCH 01/21] Let's try this again --- .../mob/living/carbon/brain/brain_item.dm | 7 + code/modules/mob/living/carbon/human/human.dm | 2 + code/modules/mob/living/carbon/human/life.dm | 1 + .../living/carbon/human/species/species.dm | 17 ++- .../living/carbon/human/species/station.dm | 135 ++++++++++++++++-- code/modules/organs/organ_external.dm | 4 +- code/modules/organs/organ_stump.dm | 4 +- code/modules/organs/subtypes/slime.dm | 47 ++++++ code/modules/surgery/bones.dm | 2 +- paradise.dme | 1 + 10 files changed, 207 insertions(+), 13 deletions(-) create mode 100644 code/modules/organs/subtypes/slime.dm diff --git a/code/modules/mob/living/carbon/brain/brain_item.dm b/code/modules/mob/living/carbon/brain/brain_item.dm index 5a0132f6bd8..8cd5affe814 100644 --- a/code/modules/mob/living/carbon/brain/brain_item.dm +++ b/code/modules/mob/living/carbon/brain/brain_item.dm @@ -102,6 +102,13 @@ desc = "A complex, organic knot of jelly and crystalline particles." icon = 'icons/mob/slimes.dmi' icon_state = "green slime extract" + parent_organ = "chest" + +/obj/item/organ/brain/slime/take_damage(var/amount) + //Slimes are 50% more vulnerable to brain damage + src.damage = between(0, src.damage + (0.5*amount), max_damage) //Since they take the damage twice, this is +50% + return ..() + /obj/item/organ/brain/golem name = "chem" diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 57c29c3d51d..3ff04b2885e 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1461,6 +1461,8 @@ if(species.default_language) remove_language(species.default_language) + species.handle_pre_change(src) + species = all_species[new_species] if(oldspecies) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 8677aa80420..158ab7f8056 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -70,6 +70,7 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc handle_pain() handle_heartbeat() handle_heartattack() + species.handle_life(src) if(!client) species.handle_npc(src) diff --git a/code/modules/mob/living/carbon/human/species/species.dm b/code/modules/mob/living/carbon/human/species/species.dm index cfb04c5427d..c4660aae24c 100644 --- a/code/modules/mob/living/carbon/human/species/species.dm +++ b/code/modules/mob/living/carbon/human/species/species.dm @@ -613,4 +613,19 @@ It'll return null if the organ doesn't correspond, so include null checks when u /datum/species/proc/return_organ(var/organ_slot) if(!(organ_slot in has_organ)) return null - return has_organ[organ_slot] \ No newline at end of file + return has_organ[organ_slot] + +// Do species-specific reagent handling here +// Return 1 if it should do normal processing too +// Return 0 if it shouldn't deplete and do its normal effect +// Other return values will cause weird badness +/datum/species/proc/handle_reagents(var/mob/living/carbon/human/H, var/datum/reagent/R) + return 1 + +// For special snowflake species effects +// (Slime People changing color based on the reagents they consume) +/datum/species/proc/handle_life(var/mob/living/carbon/human/H) + return 1 + +/datum/species/proc/handle_pre_change(var/mob/living/carbon/human/H) + return 0 \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/species/station.dm b/code/modules/mob/living/carbon/human/species/station.dm index 349b28b6efb..12f2b8f168a 100644 --- a/code/modules/mob/living/carbon/human/species/station.dm +++ b/code/modules/mob/living/carbon/human/species/station.dm @@ -55,7 +55,7 @@ flesh_color = "#34AF10" reagent_tag = PROCESS_ORG base_color = "#066000" - + suicide_messages = list( "is attempting to bite their tongue off!", "is jamming their claws into their eye sockets!", @@ -106,7 +106,7 @@ reagent_tag = PROCESS_ORG flesh_color = "#AFA59E" base_color = "#333333" - + suicide_messages = list( "is attempting to bite their tongue off!", "is jamming their claws into their eye sockets!", @@ -147,7 +147,7 @@ reagent_tag = PROCESS_ORG flesh_color = "#966464" base_color = "#B43214" - + suicide_messages = list( "is attempting to bite their tongue off!", "is jamming their claws into their eye sockets!", @@ -224,7 +224,7 @@ flesh_color = "#808D11" reagent_tag = PROCESS_ORG - + suicide_messages = list( "is attempting to bite their tongue off!", "is jamming their claws into their eye sockets!", @@ -317,7 +317,7 @@ "eyes" = /obj/item/organ/eyes, "stack" = /obj/item/organ/stack/vox ) - + suicide_messages = list( "is attempting to bite their tongue off!", "is jamming their claws into their eye sockets!", @@ -343,7 +343,7 @@ dietflags = DIET_HERB blood_color = "#FB9800" reagent_tag = PROCESS_ORG - + suicide_messages = list( "is attempting to bite their antenna off!", "is jamming their claws into their eye sockets!", @@ -360,6 +360,17 @@ path = /mob/living/carbon/human/slime unarmed_type = /datum/unarmed_attack/punch + burn_mod = 1.5 // Slimes don't react well to extreme temperatures + + // More sensitive to the cold + cold_level_1 = 280 + cold_level_2 = 240 + cold_level_3 = 200 + + heat_level_1 = 340 + heat_level_2 = 360 + heat_level_3 = 400 + flags = IS_WHITELISTED | NO_BREATHE | HAS_LIPS | NO_INTORGANS | NO_SCAN clothing_flags = HAS_SOCKS bodyflags = HAS_SKIN_COLOR | NO_EYES @@ -371,11 +382,113 @@ has_organ = list( "brain" = /obj/item/organ/brain/slime ) - + + has_limbs = list( + "chest" = list("path" = /obj/item/organ/external/chest/slime), + "groin" = list("path" = /obj/item/organ/external/groin/slime), + "head" = list("path" = /obj/item/organ/external/head/slime), + "l_arm" = list("path" = /obj/item/organ/external/arm/slime), + "r_arm" = list("path" = /obj/item/organ/external/arm/right/slime), + "l_leg" = list("path" = /obj/item/organ/external/leg/slime), + "r_leg" = list("path" = /obj/item/organ/external/leg/right/slime), + "l_hand" = list("path" = /obj/item/organ/external/hand/slime), + "r_hand" = list("path" = /obj/item/organ/external/hand/right/slime), + "l_foot" = list("path" = /obj/item/organ/external/foot/slime), + "r_foot" = list("path" = /obj/item/organ/external/foot/right/slime) + ) + suicide_messages = list( "is melting into a puddle!", "is turning a dull, brown color and melting into a puddle!") +/datum/species/slime/handle_life(var/mob/living/carbon/human/H) + // Slowly shifting to the color of the reagents + if(H.reagents.total_volume > 0.1) + var/blood_amount = H.vessel.total_volume + var/r_color = mix_color_from_reagents(H.reagents.reagent_list) + var/new_body_color = BlendRGB(r_color, rgb(H.r_skin, H.g_skin, H.b_skin), blood_amount/(blood_amount+(H.reagents.total_volume))) + var/list/new_color_list = ReadRGB(new_body_color) + H.r_skin = new_color_list[1] + H.g_skin = new_color_list[2] + H.b_skin = new_color_list[3] + if(world.time % 200 == 42) // Once every 20 seconds - update_body is expensive + for(var/organname in H.organs_by_name) + var/obj/item/organ/external/E = H.organs_by_name[organname] + if(E.dna.species == "Slime People") + E.sync_colour_to_human(E) + H.update_body() + return ..() + +/mob/living/carbon/human/proc/regrow_limbs() + set category = "IC" + set name = "Regrow Limbs" + set desc = "Regrow one of your missing limbs at the cost of a large amount of hunger" + + var/const/hungercost = 200 + var/const/minhunger = 400 + + if(stat || paralysis || stunned || weakened) + src << "You cannot regenerate missing limbs in your current state." + return + + if(nutrition < minhunger) + src << "You're too hungry to regenerate a limb!" + return + + var/list/missing_limbs = list() + for(var/l in src.organs_by_name) + var/obj/item/organ/external/E = src.organs_by_name[l] + if(!istype(E) || istype(E, /obj/item/organ/external/stump)) + var/obj/item/organ/external/limb = src.species.has_limbs[l] + world << "[l] is missing!" + world << "Checking that [l]'s parent [initial(limb.parent_organ)] is in [src]'s organs!" + if(!(initial(limb.parent_organ) in src.organs_by_name)) + world << "[initial(limb.parent_organ)] is not in [src]'s organs!" + continue + world << "[initial(limb.parent_organ)] is in [src]'s organs!" + missing_limbs |= l + + if(missing_limbs.len == 0) + src << "You're not missing any limbs!" + return + + var/chosen_limb = input(src, "Choose a limb to regrow", "Limb Regrowth") as null|anything in missing_limbs + + if(do_after(src, 200, needhand=0)) + if(stat || paralysis || stunned || weakened) + src << "You cannot regenerate missing limbs in your current state." + return + + if(nutrition < minhunger) + src << "You're too hungry to regenerate a limb!" + return + + if(istype(src.organs[chosen_limb], /obj/item/organ/external) && !istype(src.organs[chosen_limb], /obj/item/organ/external/stump)) + src << "Your limb has already been replaced in some way!" + return + + if(istype(src.organs[chosen_limb], /obj/item/organ/external/stump)) + qdel(src.organs[chosen_limb]) + + var/limb_path = src.species.has_limbs[chosen_limb] + var/obj/item/organ/external/new_limb = new limb_path(src) + new_limb.owner = src // This line is probably unneeded but will shut up the compiler + src.update_body() + src.updatehealth() + src.UpdateDamageIcon() + nutrition -= hungercost + return + else + src << "You need to hold still in order to regrow a limb!" + +/datum/species/slime/handle_post_spawn(var/mob/living/carbon/human/H) + ..() + H.verbs += /mob/living/carbon/human/proc/regrow_limbs + +/datum/species/slime/handle_pre_change(var/mob/living/carbon/human/H) + ..() + H.verbs -= /mob/living/carbon/human/proc/regrow_limbs + /datum/species/grey name = "Grey" name_plural = "Greys" @@ -475,7 +588,7 @@ "l_foot" = list("path" = /obj/item/organ/external/diona/foot), "r_foot" = list("path" = /obj/item/organ/external/diona/foot/right) ) - + suicide_messages = list( "is losing branches!", "is pulling themselves apart!") @@ -572,7 +685,7 @@ "l_foot" = list("path" = /obj/item/organ/external/foot/ipc), "r_foot" = list("path" = /obj/item/organ/external/foot/right/ipc) ) - + suicide_messages = list( "is powering down!", "is smashing their own monitor!", @@ -587,3 +700,7 @@ /datum/species/machine/handle_post_spawn(var/mob/living/carbon/human/H) ..() H.verbs += /mob/living/carbon/human/proc/change_monitor + +/datum/species/machine/handle_pre_change(var/mob/living/carbon/human/H) + ..() + H.verbs -= /mob/living/carbon/human/proc/change_monitor \ No newline at end of file diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index f6c08a20d84..96762bf6acd 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -34,6 +34,7 @@ var/list/wounds = list() var/number_wounds = 0 // cache the number of wounds, which is NOT wounds.len! var/perma_injury = 0 + var/fail_at_full_damage = 0 var/obj/item/organ/external/parent @@ -146,6 +147,7 @@ // Robot parts also lack bones // This is so surgery isn't kaput, let's see how this does encased = null + fail_at_full_damage = 1 /**************************************************** DAMAGE PROCS @@ -208,7 +210,7 @@ burn = max(0, burn - can_inflict) //If there are still hurties to dispense if (burn || brute) - if (status & ORGAN_ROBOT && body_part != UPPER_TORSO && body_part != LOWER_TORSO) + if ((status & ORGAN_ROBOT || fail_at_full_damage) && body_part != UPPER_TORSO && body_part != LOWER_TORSO) droplimb(1) //Robot limbs just kinda fail at full damage. else //List organs we can pass it to diff --git a/code/modules/organs/organ_stump.dm b/code/modules/organs/organ_stump.dm index 1f9cdb1217b..c850575efde 100644 --- a/code/modules/organs/organ_stump.dm +++ b/code/modules/organs/organ_stump.dm @@ -1,6 +1,7 @@ /obj/item/organ/external/stump name = "limb stump" icon_name = "" + var/can_intake_reagents = 0 /obj/item/organ/external/stump/New(var/mob/living/carbon/holder, var/internal, var/obj/item/organ/external/limb) if(istype(limb)) @@ -23,4 +24,5 @@ qdel(src) /obj/item/organ/external/stump/is_usable() - return 0 \ No newline at end of file + return 0 + diff --git a/code/modules/organs/subtypes/slime.dm b/code/modules/organs/subtypes/slime.dm new file mode 100644 index 00000000000..90e57d5c185 --- /dev/null +++ b/code/modules/organs/subtypes/slime.dm @@ -0,0 +1,47 @@ +/obj/item/organ/external/head/slime + vital = 0 + max_damage = 50 + min_broken_damage = 30 + cannot_break = 1 + encased = null + fail_at_full_damage = 1 + +/obj/item/organ/external/chest/slime + encased = null + cannot_break = 1 + +/obj/item/organ/external/groin/slime + cannot_break = 1 + +/obj/item/organ/external/arm/slime + cannot_break = 1 + fail_at_full_damage = 1 + +/obj/item/organ/external/arm/right/slime + cannot_break = 1 + fail_at_full_damage = 1 + +/obj/item/organ/external/leg/slime + cannot_break = 1 + fail_at_full_damage = 1 + +/obj/item/organ/external/leg/right/slime + cannot_break = 1 + fail_at_full_damage = 1 + +/obj/item/organ/external/foot/slime + cannot_break = 1 + fail_at_full_damage = 1 + +/obj/item/organ/external/foot/right/slime + cannot_break = 1 + fail_at_full_damage = 1 + +/obj/item/organ/external/hand/slime + cannot_break = 1 + fail_at_full_damage = 1 + +/obj/item/organ/external/hand/right/slime + cannot_break = 1 + fail_at_full_damage = 1 + diff --git a/code/modules/surgery/bones.dm b/code/modules/surgery/bones.dm index 9bfb67034ab..f75101b0298 100644 --- a/code/modules/surgery/bones.dm +++ b/code/modules/surgery/bones.dm @@ -16,7 +16,7 @@ can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) - return affected && !(affected.status & ORGAN_ROBOT) && affected.open == 2 && affected.stage == 0 + return affected && !(affected.status & ORGAN_ROBOT) && !(affected.cannot_break) && affected.open == 2 && affected.stage == 0 begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/organ/external/affected = target.get_organ(target_zone) diff --git a/paradise.dme b/paradise.dme index e31271b9e11..5442ec1df3e 100644 --- a/paradise.dme +++ b/paradise.dme @@ -1575,6 +1575,7 @@ #include "code\modules\organs\subtypes\machine.dm" #include "code\modules\organs\subtypes\misc.dm" #include "code\modules\organs\subtypes\nucleation.dm" +#include "code\modules\organs\subtypes\slime.dm" #include "code\modules\organs\subtypes\standard.dm" #include "code\modules\organs\subtypes\unbreakable.dm" #include "code\modules\organs\subtypes\wryn.dm" From 45b5c1698c5a1f5728422c4ce510a6f7f6d4e625 Mon Sep 17 00:00:00 2001 From: Crazylemon64 Date: Tue, 2 Feb 2016 01:26:39 -0800 Subject: [PATCH 02/21] Some more changes, limb regrowth works --- code/__HELPERS/unsorted.dm | 5 +- .../mob/living/carbon/brain/brain_item.dm | 4 +- .../living/carbon/human/species/station.dm | 49 ++++++++++--------- code/modules/organs/organ_external.dm | 4 +- 4 files changed, 35 insertions(+), 27 deletions(-) diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index d6b0cf70932..be1a99c72df 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -760,7 +760,10 @@ proc/anim(turf/location as turf,target as mob|obj,a_icon,a_icon_state as text,fl var/image/progbar for (var/i = 1 to numticks) if(user.client) - progbar = make_progress_bar(i, numticks, target) + var/bar_target = target + if(bar_target == null) + bar_target = user + progbar = make_progress_bar(i, numticks, bar_target) user.client.images |= progbar sleep(delayfraction) if(!user || user.stat || user.weakened || user.stunned || !(user.loc == Uloc)) diff --git a/code/modules/mob/living/carbon/brain/brain_item.dm b/code/modules/mob/living/carbon/brain/brain_item.dm index 8cd5affe814..f2f9c44bec4 100644 --- a/code/modules/mob/living/carbon/brain/brain_item.dm +++ b/code/modules/mob/living/carbon/brain/brain_item.dm @@ -104,9 +104,9 @@ icon_state = "green slime extract" parent_organ = "chest" -/obj/item/organ/brain/slime/take_damage(var/amount) +/obj/item/organ/brain/slime/take_damage(var/amount, var/silent = 1) //Slimes are 50% more vulnerable to brain damage - src.damage = between(0, src.damage + (0.5*amount), max_damage) //Since they take the damage twice, this is +50% + damage = between(0, src.damage + (0.5*amount), max_damage) //Since they take the damage twice, this is +50% return ..() diff --git a/code/modules/mob/living/carbon/human/species/station.dm b/code/modules/mob/living/carbon/human/species/station.dm index 12f2b8f168a..9db1414c892 100644 --- a/code/modules/mob/living/carbon/human/species/station.dm +++ b/code/modules/mob/living/carbon/human/species/station.dm @@ -415,8 +415,8 @@ for(var/organname in H.organs_by_name) var/obj/item/organ/external/E = H.organs_by_name[organname] if(E.dna.species == "Slime People") - E.sync_colour_to_human(E) - H.update_body() + E.sync_colour_to_human(H) + H.update_icon = 1 return ..() /mob/living/carbon/human/proc/regrow_limbs() @@ -424,8 +424,8 @@ set name = "Regrow Limbs" set desc = "Regrow one of your missing limbs at the cost of a large amount of hunger" - var/const/hungercost = 200 - var/const/minhunger = 400 + var/const/hungercost = 125 + var/const/minhunger = 300 if(stat || paralysis || stunned || weakened) src << "You cannot regenerate missing limbs in your current state." @@ -436,23 +436,23 @@ return var/list/missing_limbs = list() - for(var/l in src.organs_by_name) - var/obj/item/organ/external/E = src.organs_by_name[l] + for(var/l in organs_by_name) + var/obj/item/organ/external/E = organs_by_name[l] if(!istype(E) || istype(E, /obj/item/organ/external/stump)) - var/obj/item/organ/external/limb = src.species.has_limbs[l] - world << "[l] is missing!" - world << "Checking that [l]'s parent [initial(limb.parent_organ)] is in [src]'s organs!" - if(!(initial(limb.parent_organ) in src.organs_by_name)) - world << "[initial(limb.parent_organ)] is not in [src]'s organs!" + var/list/limblist = species.has_limbs[l] + var/obj/item/organ/external/limb = limblist["path"] + var/parent_organ = initial(limb.parent_organ) + var/obj/item/organ/external/parentLimb = organs_by_name[parent_organ] + if(!istype(parentLimb,/obj/item/organ/external) || istype(parentLimb,/obj/item/organ/external/stump)) continue - world << "[initial(limb.parent_organ)] is in [src]'s organs!" - missing_limbs |= l + missing_limbs[initial(limb.name)] = l - if(missing_limbs.len == 0) + if(!missing_limbs.len) src << "You're not missing any limbs!" return - var/chosen_limb = input(src, "Choose a limb to regrow", "Limb Regrowth") as null|anything in missing_limbs + var/limb_select = input(src, "Choose a limb to regrow", "Limb Regrowth") as null|anything in missing_limbs + var/chosen_limb = missing_limbs[limb_select] if(do_after(src, 200, needhand=0)) if(stat || paralysis || stunned || weakened) @@ -463,23 +463,26 @@ src << "You're too hungry to regenerate a limb!" return - if(istype(src.organs[chosen_limb], /obj/item/organ/external) && !istype(src.organs[chosen_limb], /obj/item/organ/external/stump)) + var/O = organs_by_name[chosen_limb] + + if(istype(O, /obj/item/organ/external) && !istype(O, /obj/item/organ/external/stump)) src << "Your limb has already been replaced in some way!" return - if(istype(src.organs[chosen_limb], /obj/item/organ/external/stump)) - qdel(src.organs[chosen_limb]) + if(istype(O, /obj/item/organ/external/stump)) + qdel(O) - var/limb_path = src.species.has_limbs[chosen_limb] + var/limb_list = species.has_limbs[chosen_limb] + var/limb_path = limb_list["path"] var/obj/item/organ/external/new_limb = new limb_path(src) new_limb.owner = src // This line is probably unneeded but will shut up the compiler - src.update_body() - src.updatehealth() - src.UpdateDamageIcon() + update_body() + updatehealth() + UpdateDamageIcon() nutrition -= hungercost - return else src << "You need to hold still in order to regrow a limb!" + return /datum/species/slime/handle_post_spawn(var/mob/living/carbon/human/H) ..() diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index 96762bf6acd..07defb8ab8a 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -210,7 +210,7 @@ burn = max(0, burn - can_inflict) //If there are still hurties to dispense if (burn || brute) - if ((status & ORGAN_ROBOT || fail_at_full_damage) && body_part != UPPER_TORSO && body_part != LOWER_TORSO) + if (status & ORGAN_ROBOT && body_part != UPPER_TORSO && body_part != LOWER_TORSO) droplimb(1) //Robot limbs just kinda fail at full damage. else //List organs we can pass it to @@ -225,6 +225,8 @@ //And pass the pain around var/obj/item/organ/external/target = pick(possible_points) target.take_damage(brute, burn, sharp, edge, used_weapon, forbidden_limbs + src) + if(fail_at_full_damage && body_part != UPPER_TORSO && body_part != LOWER_TORSO) + droplimb() // less clean than a robot arm, doesn't buffer damage either // sync the organ's damage with its wounds src.update_damages() From ddb58b704ab003bae0abcbd9338e1dbcd5306c78 Mon Sep 17 00:00:00 2001 From: Crazylemon64 Date: Tue, 2 Feb 2016 03:15:58 -0800 Subject: [PATCH 03/21] Slime people change color based off of reagents inside them --- code/modules/mob/living/carbon/human/species/station.dm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/code/modules/mob/living/carbon/human/species/station.dm b/code/modules/mob/living/carbon/human/species/station.dm index 9db1414c892..6665700c11f 100644 --- a/code/modules/mob/living/carbon/human/species/station.dm +++ b/code/modules/mob/living/carbon/human/species/station.dm @@ -411,12 +411,14 @@ H.r_skin = new_color_list[1] H.g_skin = new_color_list[2] H.b_skin = new_color_list[3] - if(world.time % 200 == 42) // Once every 20 seconds - update_body is expensive + world << "[world.time % 200]" + if(world.time % 200 > 180) // Once every 20 seconds - update_body is expensive + // The weird time shenanigans are because reagents update only every 2 seconds for(var/organname in H.organs_by_name) var/obj/item/organ/external/E = H.organs_by_name[organname] if(E.dna.species == "Slime People") E.sync_colour_to_human(H) - H.update_icon = 1 + H.regenerate_icons() // Because update_icon didn't work return ..() /mob/living/carbon/human/proc/regrow_limbs() From 4005de8e7dc59d65d69a1982bd779dbcbf06c9f4 Mon Sep 17 00:00:00 2001 From: Crazylemon Date: Tue, 2 Feb 2016 18:10:51 -0800 Subject: [PATCH 04/21] Limb regrowth delay increase as well as visible messages --- code/modules/mob/living/carbon/human/species/station.dm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/code/modules/mob/living/carbon/human/species/station.dm b/code/modules/mob/living/carbon/human/species/station.dm index 6665700c11f..c1a92a1d6d1 100644 --- a/code/modules/mob/living/carbon/human/species/station.dm +++ b/code/modules/mob/living/carbon/human/species/station.dm @@ -411,7 +411,6 @@ H.r_skin = new_color_list[1] H.g_skin = new_color_list[2] H.b_skin = new_color_list[3] - world << "[world.time % 200]" if(world.time % 200 > 180) // Once every 20 seconds - update_body is expensive // The weird time shenanigans are because reagents update only every 2 seconds for(var/organname in H.organs_by_name) @@ -428,6 +427,7 @@ var/const/hungercost = 125 var/const/minhunger = 300 + var/const/regrowthdelay = 450 // 45 seconds if(stat || paralysis || stunned || weakened) src << "You cannot regenerate missing limbs in your current state." @@ -456,7 +456,8 @@ var/limb_select = input(src, "Choose a limb to regrow", "Limb Regrowth") as null|anything in missing_limbs var/chosen_limb = missing_limbs[limb_select] - if(do_after(src, 200, needhand=0)) + visible_message("[src] begins to hold still and concentrate on their missing [limb_select]...", "You begin to focus on regrowing your missing [limb_select]... (This will take [round(regrowthdelay/10)] seconds)") + if(do_after(src, regrowthdelay, needhand=0)) if(stat || paralysis || stunned || weakened) src << "You cannot regenerate missing limbs in your current state." return @@ -482,6 +483,7 @@ updatehealth() UpdateDamageIcon() nutrition -= hungercost + visible_message("[src] finishes regrowing their missing [limb_select]!", "You finish regrowing your [limb_select]") else src << "You need to hold still in order to regrow a limb!" return From b70dff2b0f2d81d4a6a3ae1157ebdce7aa2e59ac Mon Sep 17 00:00:00 2001 From: Crazylemon64 Date: Tue, 2 Feb 2016 18:48:05 -0800 Subject: [PATCH 05/21] Makes stump regrowth redistribute the damage --- .../mob/living/carbon/human/species/station.dm | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/code/modules/mob/living/carbon/human/species/station.dm b/code/modules/mob/living/carbon/human/species/station.dm index c1a92a1d6d1..9248300b180 100644 --- a/code/modules/mob/living/carbon/human/species/station.dm +++ b/code/modules/mob/living/carbon/human/species/station.dm @@ -466,19 +466,30 @@ src << "You're too hungry to regenerate a limb!" return - var/O = organs_by_name[chosen_limb] + var/obj/item/organ/external/O = organs_by_name[chosen_limb] - if(istype(O, /obj/item/organ/external) && !istype(O, /obj/item/organ/external/stump)) + if(istype(O) && !O.isStump()) src << "Your limb has already been replaced in some way!" return - if(istype(O, /obj/item/organ/external/stump)) + var/stored_brute = 0 + var/stored_burn = 0 + if(O.isStump()) + src << "You distribute the damaged tissue around your body, out of the way of your new pseudopod!" + var/obj/item/organ/external/doomedStump = O + stored_brute = doomedStump.brute_dam + stored_burn = doomedStump.burn_dam + if(stored_burn) + // I'm both lazy and want to give this ability a drawback. + src << "Moving the burnt tissue aside causes further damage to your membrane!" qdel(O) var/limb_list = species.has_limbs[chosen_limb] var/limb_path = limb_list["path"] var/obj/item/organ/external/new_limb = new limb_path(src) new_limb.owner = src // This line is probably unneeded but will shut up the compiler + adjustBruteLoss(stored_brute) + adjustFireLoss(stored_burn) update_body() updatehealth() UpdateDamageIcon() From f5884759ed3493ddff72eebb8526724d65049ff5 Mon Sep 17 00:00:00 2001 From: Crazylemon64 Date: Tue, 2 Feb 2016 18:57:53 -0800 Subject: [PATCH 06/21] fix my dumb --- .../living/carbon/human/species/station.dm | 23 +++++-------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/code/modules/mob/living/carbon/human/species/station.dm b/code/modules/mob/living/carbon/human/species/station.dm index 9b1ff4277a5..837d634c7aa 100644 --- a/code/modules/mob/living/carbon/human/species/station.dm +++ b/code/modules/mob/living/carbon/human/species/station.dm @@ -182,13 +182,6 @@ blood_color = "#1D2CBF" reagent_tag = PROCESS_ORG - suicide_messages = list( - "is attempting to bite their tongue off!", - "is jamming their thumbs into their eye sockets!", - "is twisting their own neck!", - "makes like a fish and suffocates!", - "is strangling themselves with their own tendrils!") - /datum/species/vox name = "Vox" name_plural = "Vox" @@ -406,8 +399,7 @@ suicide_messages = list( "is melting into a puddle!", - "is turning a dull, brown color and melting into a puddle!", - "is ripping out their own core!") + "is turning a dull, brown color and melting into a puddle!") /datum/species/slime/handle_life(var/mob/living/carbon/human/H) // Slowly shifting to the color of the reagents @@ -453,7 +445,7 @@ var/obj/item/organ/external/limb = limblist["path"] var/parent_organ = initial(limb.parent_organ) var/obj/item/organ/external/parentLimb = organs_by_name[parent_organ] - if(!istype(parentLimb,/obj/item/organ/external) || istype(parentLimb,/obj/item/organ/external/stump)) + if(!istype(parentLimb) || parentLimb.is_stump()) continue missing_limbs[initial(limb.name)] = l @@ -476,13 +468,13 @@ var/obj/item/organ/external/O = organs_by_name[chosen_limb] - if(istype(O) && !O.isStump()) + if(istype(O) && !O.is_stump()) src << "Your limb has already been replaced in some way!" return var/stored_brute = 0 var/stored_burn = 0 - if(O.isStump()) + if(O.is_stump()) src << "You distribute the damaged tissue around your body, out of the way of your new pseudopod!" var/obj/item/organ/external/doomedStump = O stored_brute = doomedStump.brute_dam @@ -617,8 +609,7 @@ suicide_messages = list( "is losing branches!", - "is pulling themselves apart!", - "pulls out a secret stash of herbicide and takes a hearty swig!") + "is pulling themselves apart!") /datum/species/diona/can_understand(var/mob/other) var/mob/living/simple_animal/diona/D = other @@ -717,9 +708,7 @@ "is powering down!", "is smashing their own monitor!", "is twisting their own neck!", - "is blocking their ventilation port!", - "is downloading extra RAM!", - "is frying their own circuits!") + "is blocking their ventilation port!") /datum/species/machine/handle_death(var/mob/living/carbon/human/H) H.h_style = "" From 7786a44de509bf68878ecaed88947944df1119ee Mon Sep 17 00:00:00 2001 From: Crazylemon64 Date: Tue, 2 Feb 2016 21:45:47 -0800 Subject: [PATCH 07/21] Makes burning slime limbs leave a burn stump Also prevents the color shift from triggering at low doses, to prevent meta-ing that you've been injected with chemicals via the icon flash whenever the icon is updated. --- .../living/carbon/human/species/station.dm | 35 ++++++++++--------- code/modules/organs/organ_external.dm | 7 +++- 2 files changed, 24 insertions(+), 18 deletions(-) diff --git a/code/modules/mob/living/carbon/human/species/station.dm b/code/modules/mob/living/carbon/human/species/station.dm index 837d634c7aa..1f574235500 100644 --- a/code/modules/mob/living/carbon/human/species/station.dm +++ b/code/modules/mob/living/carbon/human/species/station.dm @@ -402,8 +402,10 @@ "is turning a dull, brown color and melting into a puddle!") /datum/species/slime/handle_life(var/mob/living/carbon/human/H) + var/const/color_shift_trigger = 20 + var/const/icon_update_period = 200 // Slowly shifting to the color of the reagents - if(H.reagents.total_volume > 0.1) + if(H.reagents.total_volume > color_shift_trigger) var/blood_amount = H.vessel.total_volume var/r_color = mix_color_from_reagents(H.reagents.reagent_list) var/new_body_color = BlendRGB(r_color, rgb(H.r_skin, H.g_skin, H.b_skin), blood_amount/(blood_amount+(H.reagents.total_volume))) @@ -411,11 +413,10 @@ H.r_skin = new_color_list[1] H.g_skin = new_color_list[2] H.b_skin = new_color_list[3] - if(world.time % 200 > 180) // Once every 20 seconds - update_body is expensive - // The weird time shenanigans are because reagents update only every 2 seconds + if(world.time % icon_update_period > icon_update_period - 20) // The 20 is because this gets called every 2 seconds, from the mob controller for(var/organname in H.organs_by_name) var/obj/item/organ/external/E = H.organs_by_name[organname] - if(E.dna.species == "Slime People") + if(istype(E) && E.dna.species == "Slime People") E.sync_colour_to_human(H) H.regenerate_icons() // Because update_icon didn't work return ..() @@ -468,21 +469,21 @@ var/obj/item/organ/external/O = organs_by_name[chosen_limb] - if(istype(O) && !O.is_stump()) - src << "Your limb has already been replaced in some way!" - return - var/stored_brute = 0 var/stored_burn = 0 - if(O.is_stump()) - src << "You distribute the damaged tissue around your body, out of the way of your new pseudopod!" - var/obj/item/organ/external/doomedStump = O - stored_brute = doomedStump.brute_dam - stored_burn = doomedStump.burn_dam - if(stored_burn) - // I'm both lazy and want to give this ability a drawback. - src << "Moving the burnt tissue aside causes further damage to your membrane!" - qdel(O) + if(istype(O)) + if(!O.is_stump()) + src << "Your limb has already been replaced in some way!" + return + else + src << "You distribute the damaged tissue around your body, out of the way of your new pseudopod!" + var/obj/item/organ/external/doomedStump = O + stored_brute = doomedStump.brute_dam + stored_burn = doomedStump.burn_dam + if(stored_burn) + // I'm both lazy and want to give this ability a drawback. + src << "Moving the burnt tissue aside causes further damage to your membrane!" + qdel(O) var/limb_list = species.has_limbs[chosen_limb] var/limb_path = limb_list["path"] diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index 993b4a567f0..445892310dc 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -226,7 +226,12 @@ var/obj/item/organ/external/target = pick(possible_points) target.take_damage(brute, burn, sharp, edge, used_weapon, forbidden_limbs + src) if(fail_at_full_damage && body_part != UPPER_TORSO && body_part != LOWER_TORSO) - droplimb() // less clean than a robot arm, doesn't buffer damage either + var/losstype + if(burn > brute) + losstype = DROPLIMB_BURN + else + losstype = DROPLIMB_BLUNT + droplimb(0, losstype) // less clean than a robot arm, doesn't buffer damage either // sync the organ's damage with its wounds src.update_damages() From 63245142286621063a9f7f81b5bd6817159d869f Mon Sep 17 00:00:00 2001 From: Crazylemon64 Date: Tue, 2 Feb 2016 22:28:25 -0800 Subject: [PATCH 08/21] Slows down the rate of slime icon updating, and reduces intensity of color shift --- code/modules/mob/living/carbon/human/species/station.dm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/code/modules/mob/living/carbon/human/species/station.dm b/code/modules/mob/living/carbon/human/species/station.dm index 1f574235500..3e07c924a8e 100644 --- a/code/modules/mob/living/carbon/human/species/station.dm +++ b/code/modules/mob/living/carbon/human/species/station.dm @@ -402,13 +402,14 @@ "is turning a dull, brown color and melting into a puddle!") /datum/species/slime/handle_life(var/mob/living/carbon/human/H) - var/const/color_shift_trigger = 20 - var/const/icon_update_period = 200 + var/const/color_shift_trigger = 0.1 + var/const/icon_update_period = 600 // 1 minute + var/const/blood_scaling_factor = 5 // Used to adjust how much of an effect the blood has on the rate of color change. Higher is slower. // Slowly shifting to the color of the reagents if(H.reagents.total_volume > color_shift_trigger) var/blood_amount = H.vessel.total_volume var/r_color = mix_color_from_reagents(H.reagents.reagent_list) - var/new_body_color = BlendRGB(r_color, rgb(H.r_skin, H.g_skin, H.b_skin), blood_amount/(blood_amount+(H.reagents.total_volume))) + var/new_body_color = BlendRGB(r_color, rgb(H.r_skin, H.g_skin, H.b_skin), (blood_amount*blood_scaling_factor)/((blood_amount*blood_scaling_factor)+(H.reagents.total_volume))) var/list/new_color_list = ReadRGB(new_body_color) H.r_skin = new_color_list[1] H.g_skin = new_color_list[2] From ce4cc2e860684dfb084b9c496f8ccff21ce1a996 Mon Sep 17 00:00:00 2001 From: Crazylemon64 Date: Tue, 2 Feb 2016 22:59:11 -0800 Subject: [PATCH 09/21] Makes limb disintegration actually delete the limbs --- code/modules/organs/organ_external.dm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index 445892310dc..1f2b85f432d 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -695,6 +695,9 @@ Note that amputating the affected organ does in fact remove the infection from t throw_at(get_edge_target_turf(src,pick(alldirs)),rand(1,3),30) dir = 2 return + else + qdel(src) // If you flashed away to ashes, YOU FLASHED AWAY TO ASHES + return /**************************************************** HELPERS From 170df924f412940b39da4a3b27f418df44bb7822 Mon Sep 17 00:00:00 2001 From: Crazylemon64 Date: Tue, 2 Feb 2016 23:18:46 -0800 Subject: [PATCH 10/21] no git bad don't eat the suicide messages --- .../mob/living/carbon/human/species/station.dm | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/code/modules/mob/living/carbon/human/species/station.dm b/code/modules/mob/living/carbon/human/species/station.dm index 3e07c924a8e..43a3067f5ab 100644 --- a/code/modules/mob/living/carbon/human/species/station.dm +++ b/code/modules/mob/living/carbon/human/species/station.dm @@ -182,6 +182,13 @@ blood_color = "#1D2CBF" reagent_tag = PROCESS_ORG + suicide_messages = list( + "is attempting to bite their tongue off!", + "is jamming their thumbs into their eye sockets!", + "is twisting their own neck!", + "makes like a fish and suffocates!", + "is strangling themselves with their own tendrils!") + /datum/species/vox name = "Vox" name_plural = "Vox" @@ -399,6 +406,7 @@ suicide_messages = list( "is melting into a puddle!", + "is ripping out their own core!", "is turning a dull, brown color and melting into a puddle!") /datum/species/slime/handle_life(var/mob/living/carbon/human/H) @@ -611,6 +619,7 @@ suicide_messages = list( "is losing branches!", + "pulls out a secret stash of herbicide and takes a hearty swig!", "is pulling themselves apart!") /datum/species/diona/can_understand(var/mob/other) @@ -710,6 +719,8 @@ "is powering down!", "is smashing their own monitor!", "is twisting their own neck!", + "is downloading extra RAM!", + "is frying their own circuits!", "is blocking their ventilation port!") /datum/species/machine/handle_death(var/mob/living/carbon/human/H) From 3695799c97d76e89ba68e21d557d8261c0892e2f Mon Sep 17 00:00:00 2001 From: Crazylemon64 Date: Wed, 3 Feb 2016 03:59:23 -0800 Subject: [PATCH 11/21] Moves slime core back to head, and organs in a non-encased limb are more likely to take damage from combat now Are you happy now? --- .../mob/living/carbon/brain/brain_item.dm | 6 +-- .../living/carbon/human/species/station.dm | 11 +++-- code/modules/organs/organ_external.dm | 40 ++++++++++++------- code/modules/organs/subtypes/slime.dm | 23 +++++------ 4 files changed, 45 insertions(+), 35 deletions(-) diff --git a/code/modules/mob/living/carbon/brain/brain_item.dm b/code/modules/mob/living/carbon/brain/brain_item.dm index 19656df21f5..9477756cd1e 100644 --- a/code/modules/mob/living/carbon/brain/brain_item.dm +++ b/code/modules/mob/living/carbon/brain/brain_item.dm @@ -102,11 +102,11 @@ desc = "A complex, organic knot of jelly and crystalline particles." icon = 'icons/mob/slimes.dmi' icon_state = "green slime extract" - parent_organ = "chest" +// parent_organ = "chest" Hello I am from the ministry of rubber forehead aliens how are you /obj/item/organ/brain/slime/take_damage(var/amount, var/silent = 1) - //Slimes are 50% more vulnerable to brain damage - damage = between(0, src.damage + (0.5*amount), max_damage) //Since they take the damage twice, this is +50% + //Slimes are 150% more vulnerable to brain damage + damage = between(0, src.damage + (1.5*amount), max_damage) //Since they take the damage twice, this is +150% return ..() diff --git a/code/modules/mob/living/carbon/human/species/station.dm b/code/modules/mob/living/carbon/human/species/station.dm index 43a3067f5ab..924697e08cd 100644 --- a/code/modules/mob/living/carbon/human/species/station.dm +++ b/code/modules/mob/living/carbon/human/species/station.dm @@ -495,11 +495,14 @@ qdel(O) var/limb_list = species.has_limbs[chosen_limb] - var/limb_path = limb_list["path"] + var/obj/item/organ/external/limb_path = limb_list["path"] + // Parent check + var/obj/item/organ/external/potential_parent = organs_by_name[initial(limb_path.parent_organ)] + if(!istype(potential_parent) || potential_parent.is_stump()) + src << "You've lost the organ that you've been growing your new part on!" + return // No rayman for you var/obj/item/organ/external/new_limb = new limb_path(src) - new_limb.owner = src // This line is probably unneeded but will shut up the compiler - adjustBruteLoss(stored_brute) - adjustFireLoss(stored_burn) + new_limb.take_damage(stored_brute, stored_burn, 0, 0) update_body() updatehealth() UpdateDamageIcon() diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index 1f2b85f432d..acfaa22fd9d 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -34,6 +34,9 @@ var/list/wounds = list() var/number_wounds = 0 // cache the number of wounds, which is NOT wounds.len! var/perma_injury = 0 + // 0: Don't fail when at full damage + // 1: Neatly pop off at full damage, stop damage propogation + // 2: Disintegrate at full damage, continue damage propogation var/fail_at_full_damage = 0 @@ -139,16 +142,6 @@ parent.children = list() parent.children.Add(src) -/obj/item/organ/external/robotize() - ..() - //robot limbs take reduced damage - brute_mod = 0.66 - burn_mod = 0.66 - // Robot parts also lack bones - // This is so surgery isn't kaput, let's see how this does - encased = null - fail_at_full_damage = 1 - /**************************************************** DAMAGE PROCS ****************************************************/ @@ -163,8 +156,16 @@ brute *= brute_mod burn *= burn_mod + // Threshold needed to have a chance of hurting internal bits with something sharp + var/const/sharp_thresh_int_dmg = 5 + // Threshold needed to have a chance of hurting internal bits + var/const/thresh_int_dmg = 10 + // Probability of taking internal damage from sufficient force, while otherwise healthy + var/const/dmg_prob = 5 + // Probability of taking internal damage when hit while lacking encasing bones + var/const/no_bone_dmg_prob = 30 // High brute damage or sharp objects may damage internal organs - if(internal_organs && (brute_dam >= max_damage || (((sharp && brute >= 5) || brute >= 10) && prob(5)))) + if(internal_organs && (brute_dam >= max_damage || (((sharp && brute >= sharp_thresh_int_dmg) || brute >= thresh_int_dmg) && prob(dmg_prob)) || (!encased && prob(no_bone_dmg_prob)))) // Damage an internal organ if(internal_organs && internal_organs.len) var/obj/item/organ/I = pick(internal_organs) @@ -210,8 +211,8 @@ burn = max(0, burn - can_inflict) //If there are still hurties to dispense if (burn || brute) - if (status & ORGAN_ROBOT && body_part != UPPER_TORSO && body_part != LOWER_TORSO) - droplimb(1) //Robot limbs just kinda fail at full damage. + if (fail_at_full_damage == 1 && body_part != UPPER_TORSO && body_part != LOWER_TORSO) + droplimb(1) //Clean loss, just drop the limb and be done else //List organs we can pass it to var/list/obj/item/organ/external/possible_points = list() @@ -225,7 +226,7 @@ //And pass the pain around var/obj/item/organ/external/target = pick(possible_points) target.take_damage(brute, burn, sharp, edge, used_weapon, forbidden_limbs + src) - if(fail_at_full_damage && body_part != UPPER_TORSO && body_part != LOWER_TORSO) + if(fail_at_full_damage == 2 && body_part != UPPER_TORSO && body_part != LOWER_TORSO) var/losstype if(burn > brute) losstype = DROPLIMB_BURN @@ -787,6 +788,17 @@ Note that amputating the affected organ does in fact remove the infection from t status &= ~ORGAN_BROKEN return 1 +// I put these two next to each other to highlight that both exist. This should likely be resolved. +/obj/item/organ/external/robotize() + ..() + //robot limbs take reduced damage + brute_mod = 0.66 + burn_mod = 0.66 + // Robot parts also lack bones + // This is so surgery isn't kaput, let's see how this does + encased = null + fail_at_full_damage = 1 + /obj/item/organ/external/robotize(var/company) ..() diff --git a/code/modules/organs/subtypes/slime.dm b/code/modules/organs/subtypes/slime.dm index 90e57d5c185..ecbece572df 100644 --- a/code/modules/organs/subtypes/slime.dm +++ b/code/modules/organs/subtypes/slime.dm @@ -1,10 +1,6 @@ /obj/item/organ/external/head/slime - vital = 0 - max_damage = 50 - min_broken_damage = 30 - cannot_break = 1 encased = null - fail_at_full_damage = 1 + cannot_break = 1 /obj/item/organ/external/chest/slime encased = null @@ -15,33 +11,32 @@ /obj/item/organ/external/arm/slime cannot_break = 1 - fail_at_full_damage = 1 + fail_at_full_damage = 2 /obj/item/organ/external/arm/right/slime cannot_break = 1 - fail_at_full_damage = 1 + fail_at_full_damage = 2 /obj/item/organ/external/leg/slime cannot_break = 1 - fail_at_full_damage = 1 + fail_at_full_damage = 2 /obj/item/organ/external/leg/right/slime cannot_break = 1 - fail_at_full_damage = 1 + fail_at_full_damage = 2 /obj/item/organ/external/foot/slime cannot_break = 1 - fail_at_full_damage = 1 + fail_at_full_damage = 2 /obj/item/organ/external/foot/right/slime cannot_break = 1 - fail_at_full_damage = 1 + fail_at_full_damage = 2 /obj/item/organ/external/hand/slime cannot_break = 1 - fail_at_full_damage = 1 + fail_at_full_damage = 2 /obj/item/organ/external/hand/right/slime cannot_break = 1 - fail_at_full_damage = 1 - + fail_at_full_damage = 2 From c39059c36d187375e841165274e115b7d5d2c319 Mon Sep 17 00:00:00 2001 From: Crazylemon64 Date: Wed, 3 Feb 2016 22:08:09 -0800 Subject: [PATCH 12/21] Puts reagent recoloring on a toggle that's off by default Moderates increased burn damage down to 25% Can now regrow limbs even if you've lost both legs --- .../living/carbon/human/species/station.dm | 36 +++++++++++++++++-- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/code/modules/mob/living/carbon/human/species/station.dm b/code/modules/mob/living/carbon/human/species/station.dm index 924697e08cd..e0d50f9f691 100644 --- a/code/modules/mob/living/carbon/human/species/station.dm +++ b/code/modules/mob/living/carbon/human/species/station.dm @@ -367,7 +367,7 @@ path = /mob/living/carbon/human/slime unarmed_type = /datum/unarmed_attack/punch - burn_mod = 1.5 // Slimes don't react well to extreme temperatures + burn_mod = 1.25 // Slimes don't react well to extreme temperatures // More sensitive to the cold cold_level_1 = 280 @@ -409,12 +409,14 @@ "is ripping out their own core!", "is turning a dull, brown color and melting into a puddle!") + var/list/mob/living/carbon/human/recolor_list = list() + /datum/species/slime/handle_life(var/mob/living/carbon/human/H) var/const/color_shift_trigger = 0.1 var/const/icon_update_period = 600 // 1 minute var/const/blood_scaling_factor = 5 // Used to adjust how much of an effect the blood has on the rate of color change. Higher is slower. // Slowly shifting to the color of the reagents - if(H.reagents.total_volume > color_shift_trigger) + if((H in recolor_list) && H.reagents.total_volume > color_shift_trigger) var/blood_amount = H.vessel.total_volume var/r_color = mix_color_from_reagents(H.reagents.reagent_list) var/new_body_color = BlendRGB(r_color, rgb(H.r_skin, H.g_skin, H.b_skin), (blood_amount*blood_scaling_factor)/((blood_amount*blood_scaling_factor)+(H.reagents.total_volume))) @@ -430,6 +432,30 @@ H.regenerate_icons() // Because update_icon didn't work return ..() +/mob/living/carbon/human/proc/toggle_recolor(var/silent = 0) + var/datum/species/slime/S = all_species[get_species()] + if(!istype(S)) + if(!silent) + src << "You're not a slime person!" + return + + if(src in S.recolor_list) + S.recolor_list -= src + if(!silent) + src << "You adjust your internal chemistry to filter out pigments from things you consume." + else + S.recolor_list += src + if(!silent) + src << "You adjust your internal chemistry to permit pigments in chemicals you consume to tint you." + +/mob/living/carbon/human/verb/toggle_recolor_verb() + set category = "IC" + set name = "Toggle Reagent Recoloring" + set desc = "While active, you'll slowly adjust your body's color to that of the reagents inside of you, moderated by how much blood you have." + + toggle_recolor() + + /mob/living/carbon/human/proc/regrow_limbs() set category = "IC" set name = "Regrow Limbs" @@ -439,7 +465,7 @@ var/const/minhunger = 300 var/const/regrowthdelay = 450 // 45 seconds - if(stat || paralysis || stunned || weakened) + if(stat || paralysis || stunned) src << "You cannot regenerate missing limbs in your current state." return @@ -515,9 +541,13 @@ /datum/species/slime/handle_post_spawn(var/mob/living/carbon/human/H) ..() H.verbs += /mob/living/carbon/human/proc/regrow_limbs + H.verbs += /mob/living/carbon/human/verb/toggle_recolor_verb /datum/species/slime/handle_pre_change(var/mob/living/carbon/human/H) ..() + if(H in recolor_list) + H.toggle_recolor(silent = 1) + H.verbs -= /mob/living/carbon/human/verb/toggle_recolor_verb H.verbs -= /mob/living/carbon/human/proc/regrow_limbs /datum/species/grey From 53c12176db7854e47d2096cfcc7e854d34190a4f Mon Sep 17 00:00:00 2001 From: Crazylemon64 Date: Thu, 4 Feb 2016 12:36:49 -0800 Subject: [PATCH 13/21] Removes limb loss, but re-adds breaking bones Adjusts the fire damage weakness to an environmental cold weakness --- code/modules/mob/living/carbon/human/life.dm | 16 +++--- .../living/carbon/human/species/species.dm | 57 ++++++++++++------- .../living/carbon/human/species/station.dm | 43 ++++---------- code/modules/organs/subtypes/slime.dm | 42 -------------- paradise.dme | 1 - 5 files changed, 56 insertions(+), 103 deletions(-) delete mode 100644 code/modules/organs/subtypes/slime.dm diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 158ab7f8056..2d327d74b1d 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -458,19 +458,20 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc //Body temperature is too hot. fire_alert = max(fire_alert, 1) if(status_flags & GODMODE) return 1 //godmode + var/mult = species.hot_env_multiplier if(bodytemperature >= species.heat_level_1 && bodytemperature <= species.heat_level_2) - take_overall_damage(burn=HEAT_DAMAGE_LEVEL_1, used_weapon = "High Body Temperature") + take_overall_damage(burn=mult*HEAT_DAMAGE_LEVEL_1, used_weapon = "High Body Temperature") fire_alert = max(fire_alert, 2) if(bodytemperature > species.heat_level_2 && bodytemperature <= species.heat_level_3) - take_overall_damage(burn=HEAT_DAMAGE_LEVEL_2, used_weapon = "High Body Temperature") + take_overall_damage(burn=mult*HEAT_DAMAGE_LEVEL_2, used_weapon = "High Body Temperature") fire_alert = max(fire_alert, 2) if(bodytemperature > species.heat_level_3 && bodytemperature < INFINITY) if(on_fire) - take_overall_damage(burn=HEAT_DAMAGE_LEVEL_3, used_weapon = "Fire") + take_overall_damage(burn=mult*HEAT_DAMAGE_LEVEL_3, used_weapon = "Fire") fire_alert = max(fire_alert, 2) else - take_overall_damage(burn=HEAT_DAMAGE_LEVEL_2, used_weapon = "High Body Temperature") + take_overall_damage(burn=mult*HEAT_DAMAGE_LEVEL_2, used_weapon = "High Body Temperature") fire_alert = max(fire_alert, 2) else if(bodytemperature < species.cold_level_1) @@ -480,14 +481,15 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc if(stat == DEAD) return 1 //ZomgPonies -- No need for cold burn damage if dead if(!istype(loc, /obj/machinery/atmospherics/unary/cryo_cell)) + var/mult = species.cold_env_multiplier if(bodytemperature >= species.cold_level_2 && bodytemperature <= species.cold_level_1) - take_overall_damage(burn=COLD_DAMAGE_LEVEL_1, used_weapon = "Low Body Temperature") + take_overall_damage(burn=mult*COLD_DAMAGE_LEVEL_1, used_weapon = "Low Body Temperature") fire_alert = max(fire_alert, 1) if(bodytemperature >= species.cold_level_3 && bodytemperature < species.cold_level_2) - take_overall_damage(burn=COLD_DAMAGE_LEVEL_2, used_weapon = "Low Body Temperature") + take_overall_damage(burn=mult*COLD_DAMAGE_LEVEL_2, used_weapon = "Low Body Temperature") fire_alert = max(fire_alert, 1) if(bodytemperature > -INFINITY && bodytemperature < species.cold_level_3) - take_overall_damage(burn=COLD_DAMAGE_LEVEL_3, used_weapon = "Low Body Temperature") + take_overall_damage(burn=mult*COLD_DAMAGE_LEVEL_3, used_weapon = "Low Body Temperature") fire_alert = max(fire_alert, 1) // Account for massive pressure differences. Done by Polymorph diff --git a/code/modules/mob/living/carbon/human/species/species.dm b/code/modules/mob/living/carbon/human/species/species.dm index 26805f99f16..cdcd90d6523 100644 --- a/code/modules/mob/living/carbon/human/species/species.dm +++ b/code/modules/mob/living/carbon/human/species/species.dm @@ -32,10 +32,12 @@ var/cold_level_1 = 260 // Cold damage level 1 below this point. var/cold_level_2 = 200 // Cold damage level 2 below this point. var/cold_level_3 = 120 // Cold damage level 3 below this point. + var/cold_env_multiplier = 1 // Damage multiplier for being in a cold environment var/heat_level_1 = 360 // Heat damage level 1 above this point. var/heat_level_2 = 400 // Heat damage level 2 above this point. var/heat_level_3 = 460 // Heat damage level 3 above this point; used for body temperature + var/hot_env_multiplier = 1 // Damage multiplier for being in a hot environment var/heat_level_3_breathe = 1000 // Heat damage level 3 above this point; used for breathed air temperature var/body_temperature = 310.15 //non-IS_SYNTHETIC species will try to stabilize at this temperature. (also affects temperature processing) @@ -126,6 +128,7 @@ "r_foot" = list("path" = /obj/item/organ/external/foot/right) ) var/cyborg_type = "Cyborg" + var/list/proc/species_abilities = list() /datum/species/New() //If the species has eyes, they are the default vision organ @@ -287,33 +290,60 @@ switch(breath.temperature) if(-INFINITY to cold_level_3) - H.apply_damage(COLD_GAS_DAMAGE_LEVEL_3, BURN, "head", used_weapon = "Excessive Cold") + H.apply_damage(cold_env_multiplier*COLD_GAS_DAMAGE_LEVEL_3, BURN, "head", used_weapon = "Excessive Cold") H.fire_alert = max(H.fire_alert, 1) if(cold_level_3 to cold_level_2) - H.apply_damage(COLD_GAS_DAMAGE_LEVEL_2, BURN, "head", used_weapon = "Excessive Cold") + H.apply_damage(cold_env_multiplier*COLD_GAS_DAMAGE_LEVEL_2, BURN, "head", used_weapon = "Excessive Cold") H.fire_alert = max(H.fire_alert, 1) if(cold_level_2 to cold_level_1) - H.apply_damage(COLD_GAS_DAMAGE_LEVEL_1, BURN, "head", used_weapon = "Excessive Cold") + H.apply_damage(cold_env_multiplier*COLD_GAS_DAMAGE_LEVEL_1, BURN, "head", used_weapon = "Excessive Cold") H.fire_alert = max(H.fire_alert, 1) if(heat_level_1 to heat_level_2) - H.apply_damage(HEAT_GAS_DAMAGE_LEVEL_1, BURN, "head", used_weapon = "Excessive Heat") + H.apply_damage(hot_env_multiplier*HEAT_GAS_DAMAGE_LEVEL_1, BURN, "head", used_weapon = "Excessive Heat") H.fire_alert = max(H.fire_alert, 2) if(heat_level_2 to heat_level_3_breathe) - H.apply_damage(HEAT_GAS_DAMAGE_LEVEL_2, BURN, "head", used_weapon = "Excessive Heat") + H.apply_damage(hot_env_multiplier*HEAT_GAS_DAMAGE_LEVEL_2, BURN, "head", used_weapon = "Excessive Heat") H.fire_alert = max(H.fire_alert, 2) if(heat_level_3_breathe to INFINITY) - H.apply_damage(HEAT_GAS_DAMAGE_LEVEL_3, BURN, "head", used_weapon = "Excessive Heat") + H.apply_damage(hot_env_multiplier*HEAT_GAS_DAMAGE_LEVEL_3, BURN, "head", used_weapon = "Excessive Heat") H.fire_alert = max(H.fire_alert, 2) return /datum/species/proc/handle_post_spawn(var/mob/living/carbon/C) //Handles anything not already covered by basic species assignment. + grant_abilities(C) return +/datum/species/proc/grant_abilities(var/mob/living/carbon/human/H) + for(var/proc/ability in species_abilities) + H.verbs += ability + return + +/datum/species/proc/handle_pre_change(var/mob/living/carbon/human/H) + remove_abilities(H) + return + +/datum/species/proc/remove_abilities(var/mob/living/carbon/human/H) + for (var/proc/ability in species_abilities) + H.verbs -= ability + return + +// Do species-specific reagent handling here +// Return 1 if it should do normal processing too +// Return 0 if it shouldn't deplete and do its normal effect +// Other return values will cause weird badness +/datum/species/proc/handle_reagents(var/mob/living/carbon/human/H, var/datum/reagent/R) + return 1 + +// For special snowflake species effects +// (Slime People changing color based on the reagents they consume) +/datum/species/proc/handle_life(var/mob/living/carbon/human/H) + return 1 + /datum/species/proc/handle_dna(var/mob/living/carbon/C, var/remove) //Handles DNA mutations, as that doesn't work at init. Make sure you call genemutcheck on any blocks changed here return @@ -614,18 +644,3 @@ It'll return null if the organ doesn't correspond, so include null checks when u if(!(organ_slot in has_organ)) return null return has_organ[organ_slot] - -// Do species-specific reagent handling here -// Return 1 if it should do normal processing too -// Return 0 if it shouldn't deplete and do its normal effect -// Other return values will cause weird badness -/datum/species/proc/handle_reagents(var/mob/living/carbon/human/H, var/datum/reagent/R) - return 1 - -// For special snowflake species effects -// (Slime People changing color based on the reagents they consume) -/datum/species/proc/handle_life(var/mob/living/carbon/human/H) - return 1 - -/datum/species/proc/handle_pre_change(var/mob/living/carbon/human/H) - return 0 diff --git a/code/modules/mob/living/carbon/human/species/station.dm b/code/modules/mob/living/carbon/human/species/station.dm index e0d50f9f691..de84359b635 100644 --- a/code/modules/mob/living/carbon/human/species/station.dm +++ b/code/modules/mob/living/carbon/human/species/station.dm @@ -367,16 +367,11 @@ path = /mob/living/carbon/human/slime unarmed_type = /datum/unarmed_attack/punch - burn_mod = 1.25 // Slimes don't react well to extreme temperatures - // More sensitive to the cold cold_level_1 = 280 cold_level_2 = 240 cold_level_3 = 200 - - heat_level_1 = 340 - heat_level_2 = 360 - heat_level_3 = 400 + cold_env_multiplier = 3 flags = IS_WHITELISTED | NO_BREATHE | HAS_LIPS | NO_INTORGANS | NO_SCAN clothing_flags = HAS_SOCKS @@ -390,20 +385,6 @@ "brain" = /obj/item/organ/brain/slime ) - has_limbs = list( - "chest" = list("path" = /obj/item/organ/external/chest/slime), - "groin" = list("path" = /obj/item/organ/external/groin/slime), - "head" = list("path" = /obj/item/organ/external/head/slime), - "l_arm" = list("path" = /obj/item/organ/external/arm/slime), - "r_arm" = list("path" = /obj/item/organ/external/arm/right/slime), - "l_leg" = list("path" = /obj/item/organ/external/leg/slime), - "r_leg" = list("path" = /obj/item/organ/external/leg/right/slime), - "l_hand" = list("path" = /obj/item/organ/external/hand/slime), - "r_hand" = list("path" = /obj/item/organ/external/hand/right/slime), - "l_foot" = list("path" = /obj/item/organ/external/foot/slime), - "r_foot" = list("path" = /obj/item/organ/external/foot/right/slime) - ) - suicide_messages = list( "is melting into a puddle!", "is ripping out their own core!", @@ -411,6 +392,11 @@ var/list/mob/living/carbon/human/recolor_list = list() + species_abilities = list( + /mob/living/carbon/human/verb/toggle_recolor_verb, + /mob/living/carbon/human/proc/regrow_limbs + ) + /datum/species/slime/handle_life(var/mob/living/carbon/human/H) var/const/color_shift_trigger = 0.1 var/const/icon_update_period = 600 // 1 minute @@ -515,9 +501,6 @@ var/obj/item/organ/external/doomedStump = O stored_brute = doomedStump.brute_dam stored_burn = doomedStump.burn_dam - if(stored_burn) - // I'm both lazy and want to give this ability a drawback. - src << "Moving the burnt tissue aside causes further damage to your membrane!" qdel(O) var/limb_list = species.has_limbs[chosen_limb] @@ -756,15 +739,11 @@ "is frying their own circuits!", "is blocking their ventilation port!") + species_abilities = list( + /mob/living/carbon/human/proc/change_monitor + ) + /datum/species/machine/handle_death(var/mob/living/carbon/human/H) H.h_style = "" spawn(100) - if(H) H.update_hair() - -/datum/species/machine/handle_post_spawn(var/mob/living/carbon/human/H) - ..() - H.verbs += /mob/living/carbon/human/proc/change_monitor - -/datum/species/machine/handle_pre_change(var/mob/living/carbon/human/H) - ..() - H.verbs -= /mob/living/carbon/human/proc/change_monitor \ No newline at end of file + if(H) H.update_hair() \ No newline at end of file diff --git a/code/modules/organs/subtypes/slime.dm b/code/modules/organs/subtypes/slime.dm deleted file mode 100644 index ecbece572df..00000000000 --- a/code/modules/organs/subtypes/slime.dm +++ /dev/null @@ -1,42 +0,0 @@ -/obj/item/organ/external/head/slime - encased = null - cannot_break = 1 - -/obj/item/organ/external/chest/slime - encased = null - cannot_break = 1 - -/obj/item/organ/external/groin/slime - cannot_break = 1 - -/obj/item/organ/external/arm/slime - cannot_break = 1 - fail_at_full_damage = 2 - -/obj/item/organ/external/arm/right/slime - cannot_break = 1 - fail_at_full_damage = 2 - -/obj/item/organ/external/leg/slime - cannot_break = 1 - fail_at_full_damage = 2 - -/obj/item/organ/external/leg/right/slime - cannot_break = 1 - fail_at_full_damage = 2 - -/obj/item/organ/external/foot/slime - cannot_break = 1 - fail_at_full_damage = 2 - -/obj/item/organ/external/foot/right/slime - cannot_break = 1 - fail_at_full_damage = 2 - -/obj/item/organ/external/hand/slime - cannot_break = 1 - fail_at_full_damage = 2 - -/obj/item/organ/external/hand/right/slime - cannot_break = 1 - fail_at_full_damage = 2 diff --git a/paradise.dme b/paradise.dme index 5442ec1df3e..e31271b9e11 100644 --- a/paradise.dme +++ b/paradise.dme @@ -1575,7 +1575,6 @@ #include "code\modules\organs\subtypes\machine.dm" #include "code\modules\organs\subtypes\misc.dm" #include "code\modules\organs\subtypes\nucleation.dm" -#include "code\modules\organs\subtypes\slime.dm" #include "code\modules\organs\subtypes\standard.dm" #include "code\modules\organs\subtypes\unbreakable.dm" #include "code\modules\organs\subtypes\wryn.dm" From bf9b922446aac244cda432f7b5e6ac9cc8d6d63f Mon Sep 17 00:00:00 2001 From: Crazylemon64 Date: Thu, 4 Feb 2016 18:32:14 -0800 Subject: [PATCH 14/21] Actually lets you regrow limbs while missing legs --- code/modules/mob/living/carbon/human/species/station.dm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/modules/mob/living/carbon/human/species/station.dm b/code/modules/mob/living/carbon/human/species/station.dm index de84359b635..9ff0c71657e 100644 --- a/code/modules/mob/living/carbon/human/species/station.dm +++ b/code/modules/mob/living/carbon/human/species/station.dm @@ -480,7 +480,7 @@ visible_message("[src] begins to hold still and concentrate on their missing [limb_select]...", "You begin to focus on regrowing your missing [limb_select]... (This will take [round(regrowthdelay/10)] seconds)") if(do_after(src, regrowthdelay, needhand=0)) - if(stat || paralysis || stunned || weakened) + if(stat || paralysis || stunned) src << "You cannot regenerate missing limbs in your current state." return @@ -511,7 +511,8 @@ src << "You've lost the organ that you've been growing your new part on!" return // No rayman for you var/obj/item/organ/external/new_limb = new limb_path(src) - new_limb.take_damage(stored_brute, stored_burn, 0, 0) + adjustBruteLoss(stored_brute) + adjustFireLoss(stored_burn) update_body() updatehealth() UpdateDamageIcon() From f8769ff542a559846fdb412be7dba027be5d5f8b Mon Sep 17 00:00:00 2001 From: Crazylemon64 Date: Sat, 5 Mar 2016 02:59:53 -0800 Subject: [PATCH 15/21] Abandoned by time, I finally synchronize with the present. --- code/modules/mob/living/carbon/human/species/station.dm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/modules/mob/living/carbon/human/species/station.dm b/code/modules/mob/living/carbon/human/species/station.dm index 7add227c491..0b44e0c94b0 100644 --- a/code/modules/mob/living/carbon/human/species/station.dm +++ b/code/modules/mob/living/carbon/human/species/station.dm @@ -510,6 +510,8 @@ if(!istype(potential_parent) || potential_parent.is_stump()) src << "You've lost the organ that you've been growing your new part on!" return // No rayman for you + // Grah this line will leave a "not used" warning, in spite of the fact that the new() proc WILL do the thing. + // Bothersome. var/obj/item/organ/external/new_limb = new limb_path(src) adjustBruteLoss(stored_brute) adjustFireLoss(stored_burn) From 188b4b871facc1a9db19f8780c3c38ba1f1dbed9 Mon Sep 17 00:00:00 2001 From: Crazylemon64 Date: Tue, 8 Mar 2016 11:04:35 -0800 Subject: [PATCH 16/21] Finalized --- .../living/carbon/human/species/station.dm | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/code/modules/mob/living/carbon/human/species/station.dm b/code/modules/mob/living/carbon/human/species/station.dm index 0b44e0c94b0..514a43cdeb6 100644 --- a/code/modules/mob/living/carbon/human/species/station.dm +++ b/code/modules/mob/living/carbon/human/species/station.dm @@ -399,7 +399,7 @@ /datum/species/slime/handle_life(var/mob/living/carbon/human/H) var/const/color_shift_trigger = 0.1 - var/const/icon_update_period = 600 // 1 minute + var/const/icon_update_period = 200 // 20 seconds var/const/blood_scaling_factor = 5 // Used to adjust how much of an effect the blood has on the rate of color change. Higher is slower. // Slowly shifting to the color of the reagents if((H in recolor_list) && H.reagents.total_volume > color_shift_trigger) @@ -415,7 +415,8 @@ var/obj/item/organ/external/E = H.organs_by_name[organname] if(istype(E) && E.dna.species == "Slime People") E.sync_colour_to_human(H) - H.regenerate_icons() // Because update_icon didn't work + H.update_hair(0) + H.update_body() return ..() /mob/living/carbon/human/proc/toggle_recolor(var/silent = 0) @@ -478,8 +479,8 @@ var/limb_select = input(src, "Choose a limb to regrow", "Limb Regrowth") as null|anything in missing_limbs var/chosen_limb = missing_limbs[limb_select] - visible_message("[src] begins to hold still and concentrate on their missing [limb_select]...", "You begin to focus on regrowing your missing [limb_select]... (This will take [round(regrowthdelay/10)] seconds)") - if(do_after(src, regrowthdelay, needhand=0)) + visible_message("[src] begins to hold still and concentrate on their missing [limb_select]...", "You begin to focus on regrowing your missing [limb_select]... (This will take [round(regrowthdelay/10)] seconds, and you must hold still.)") + if(do_after(src, regrowthdelay, needhand=0, target = src)) if(stat || paralysis || stunned) src << "You cannot regenerate missing limbs in your current state." return @@ -513,28 +514,22 @@ // Grah this line will leave a "not used" warning, in spite of the fact that the new() proc WILL do the thing. // Bothersome. var/obj/item/organ/external/new_limb = new limb_path(src) + new_limb.open = 0 // This is just so that the compiler won't think that new_limb is unused, because the compiler is horribly stupid. adjustBruteLoss(stored_brute) adjustFireLoss(stored_burn) update_body() updatehealth() UpdateDamageIcon() nutrition -= hungercost - visible_message("[src] finishes regrowing their missing [limb_select]!", "You finish regrowing your [limb_select]") + visible_message("[src] finishes regrowing their missing [new_limb]!", "You finish regrowing your [limb_select]") else src << "You need to hold still in order to regrow a limb!" return -/datum/species/slime/handle_post_spawn(var/mob/living/carbon/human/H) - ..() - H.verbs += /mob/living/carbon/human/proc/regrow_limbs - H.verbs += /mob/living/carbon/human/verb/toggle_recolor_verb - /datum/species/slime/handle_pre_change(var/mob/living/carbon/human/H) ..() if(H in recolor_list) H.toggle_recolor(silent = 1) - H.verbs -= /mob/living/carbon/human/verb/toggle_recolor_verb - H.verbs -= /mob/living/carbon/human/proc/regrow_limbs /datum/species/grey name = "Grey" From 4f29b1b3eafa0d1a12caa21fee1aaf6c35061bb8 Mon Sep 17 00:00:00 2001 From: Crazylemon64 Date: Tue, 8 Mar 2016 16:56:09 -0800 Subject: [PATCH 17/21] Namespaced the things and undefined them when done --- .../living/carbon/human/species/station.dm | 37 ++++++++++++------- code/modules/surgery/organs/organ_external.dm | 15 +++++--- 2 files changed, 33 insertions(+), 19 deletions(-) diff --git a/code/modules/mob/living/carbon/human/species/station.dm b/code/modules/mob/living/carbon/human/species/station.dm index 514a43cdeb6..00bc2813053 100644 --- a/code/modules/mob/living/carbon/human/species/station.dm +++ b/code/modules/mob/living/carbon/human/species/station.dm @@ -398,19 +398,20 @@ ) /datum/species/slime/handle_life(var/mob/living/carbon/human/H) - var/const/color_shift_trigger = 0.1 - var/const/icon_update_period = 200 // 20 seconds - var/const/blood_scaling_factor = 5 // Used to adjust how much of an effect the blood has on the rate of color change. Higher is slower. +//This is allegedly for code "style". Like a plaid sweater? +#define DAAAAAAAAAAAAAAAAA_COLOR_SHIFT_TRIGGER 0.1 +#define DAAAAAAAAAAAAAAAAA_ICON_UPDATE_PERIOD 200 // 20 seconds +#define DAAAAAAAAAAAAAAAAA_BLOOD_SCALING_FACTOR 5 // Used to adjust how much of an effect the blood has on the rate of color change. Higher is slower. // Slowly shifting to the color of the reagents - if((H in recolor_list) && H.reagents.total_volume > color_shift_trigger) + if((H in recolor_list) && H.reagents.total_volume > DAAAAAAAAAAAAAAAAA_COLOR_SHIFT_TRIGGER) var/blood_amount = H.vessel.total_volume var/r_color = mix_color_from_reagents(H.reagents.reagent_list) - var/new_body_color = BlendRGB(r_color, rgb(H.r_skin, H.g_skin, H.b_skin), (blood_amount*blood_scaling_factor)/((blood_amount*blood_scaling_factor)+(H.reagents.total_volume))) + var/new_body_color = BlendRGB(r_color, rgb(H.r_skin, H.g_skin, H.b_skin), (blood_amount*DAAAAAAAAAAAAAAAAA_BLOOD_SCALING_FACTOR)/((blood_amount*DAAAAAAAAAAAAAAAAA_BLOOD_SCALING_FACTOR)+(H.reagents.total_volume))) var/list/new_color_list = ReadRGB(new_body_color) H.r_skin = new_color_list[1] H.g_skin = new_color_list[2] H.b_skin = new_color_list[3] - if(world.time % icon_update_period > icon_update_period - 20) // The 20 is because this gets called every 2 seconds, from the mob controller + if(world.time % DAAAAAAAAAAAAAAAAA_ICON_UPDATE_PERIOD > DAAAAAAAAAAAAAAAAA_ICON_UPDATE_PERIOD - 20) // The 20 is because this gets called every 2 seconds, from the mob controller for(var/organname in H.organs_by_name) var/obj/item/organ/external/E = H.organs_by_name[organname] if(istype(E) && E.dna.species == "Slime People") @@ -419,6 +420,10 @@ H.update_body() return ..() +#undefine DAAAAAAAAAAAAAAAAA_COLOR_SHIFT_TRIGGER +#undefine DAAAAAAAAAAAAAAAAA_ICON_UPDATE_PERIOD +#undefine DAAAAAAAAAAAAAAAAA_BLOOD_SCALING_FACTOR + /mob/living/carbon/human/proc/toggle_recolor(var/silent = 0) var/datum/species/slime/S = all_species[get_species()] if(!istype(S)) @@ -448,15 +453,15 @@ set name = "Regrow Limbs" set desc = "Regrow one of your missing limbs at the cost of a large amount of hunger" - var/const/hungercost = 125 - var/const/minhunger = 300 - var/const/regrowthdelay = 450 // 45 seconds +#define DAAAAAAAAAAAAAAAAA_HUNGERCOST 125 +#define DAAAAAAAAAAAAAAAAA_MINHUNGER 300 +#define DAAAAAAAAAAAAAAAAA_REGROWTHDELAY 450 // 45 seconds if(stat || paralysis || stunned) src << "You cannot regenerate missing limbs in your current state." return - if(nutrition < minhunger) + if(nutrition < DAAAAAAAAAAAAAAAAA_MINHUNGER) src << "You're too hungry to regenerate a limb!" return @@ -479,13 +484,13 @@ var/limb_select = input(src, "Choose a limb to regrow", "Limb Regrowth") as null|anything in missing_limbs var/chosen_limb = missing_limbs[limb_select] - visible_message("[src] begins to hold still and concentrate on their missing [limb_select]...", "You begin to focus on regrowing your missing [limb_select]... (This will take [round(regrowthdelay/10)] seconds, and you must hold still.)") - if(do_after(src, regrowthdelay, needhand=0, target = src)) + visible_message("[src] begins to hold still and concentrate on their missing [limb_select]...", "You begin to focus on regrowing your missing [limb_select]... (This will take [round(DAAAAAAAAAAAAAAAAA_REGROWTHDELAY/10)] seconds, and you must hold still.)") + if(do_after(src, DAAAAAAAAAAAAAAAAA_REGROWTHDELAY, needhand=0, target = src)) if(stat || paralysis || stunned) src << "You cannot regenerate missing limbs in your current state." return - if(nutrition < minhunger) + if(nutrition < DAAAAAAAAAAAAAAAAA_MINHUNGER) src << "You're too hungry to regenerate a limb!" return @@ -520,12 +525,16 @@ update_body() updatehealth() UpdateDamageIcon() - nutrition -= hungercost + nutrition -= DAAAAAAAAAAAAAAAAA_HUNGERCOST visible_message("[src] finishes regrowing their missing [new_limb]!", "You finish regrowing your [limb_select]") else src << "You need to hold still in order to regrow a limb!" return +#undefine DAAAAAAAAAAAAAAAAA_HUNGERCOST +#undefine DAAAAAAAAAAAAAAAAA_MINHUNGER +#undefine DAAAAAAAAAAAAAAAAA_REGROWTHDELAY + /datum/species/slime/handle_pre_change(var/mob/living/carbon/human/H) ..() if(H in recolor_list) diff --git a/code/modules/surgery/organs/organ_external.dm b/code/modules/surgery/organs/organ_external.dm index 63a958fe065..1cbca241391 100644 --- a/code/modules/surgery/organs/organ_external.dm +++ b/code/modules/surgery/organs/organ_external.dm @@ -170,15 +170,15 @@ burn *= burn_mod // Threshold needed to have a chance of hurting internal bits with something sharp - var/const/sharp_thresh_int_dmg = 5 +#define DAAAAAAAAAAAAAAAAA_SHARP_THRESH_INT_DMG 5 // Threshold needed to have a chance of hurting internal bits - var/const/thresh_int_dmg = 10 +#define DAAAAAAAAAAAAAAAAA_THRESH_INT_DMG 10 // Probability of taking internal damage from sufficient force, while otherwise healthy - var/const/dmg_prob = 5 +#define DAAAAAAAAAAAAAAAAA_DMG_PROB 5 // Probability of taking internal damage when hit while lacking encasing bones - var/const/no_bone_dmg_prob = 30 +#define DAAAAAAAAAAAAAAAAA_NO_BONE_DMG_PROB 30 // High brute damage or sharp objects may damage internal organs - if(internal_organs && (brute_dam >= max_damage || (((sharp && brute >= sharp_thresh_int_dmg) || brute >= thresh_int_dmg) && prob(dmg_prob)) || (!encased && prob(no_bone_dmg_prob)))) + if(internal_organs && (brute_dam >= max_damage || (((sharp && brute >= DAAAAAAAAAAAAAAAAA_SHARP_THRESH_INT_DMG) || brute >= DAAAAAAAAAAAAAAAAA_THRESH_INT_DMG) && prob(DAAAAAAAAAAAAAAAAA_DMG_PROB)) || (!encased && prob(DAAAAAAAAAAAAAAAAA_NO_BONE_DMG_PROB)))) // Damage an internal organ if(internal_organs && internal_organs.len) var/obj/item/organ/internal/I = pick(internal_organs) @@ -261,6 +261,11 @@ if(owner_old) owner_old.updatehealth() return update_icon() +#undefine DAAAAAAAAAAAAAAAAA_SHARP_THRESH_INT_DMG +#undefine DAAAAAAAAAAAAAAAAA_THRESH_INT_DMG +#undefine DAAAAAAAAAAAAAAAAA_DMG_PROB +#undefine DAAAAAAAAAAAAAAAAA_NO_BONE_DMG_PROB + /obj/item/organ/external/proc/heal_damage(brute, burn, internal = 0, robo_repair = 0) if(status & ORGAN_ROBOT && !robo_repair) return From 6c7447c12723aa01a9ca6adbabf124ea1848d8e2 Mon Sep 17 00:00:00 2001 From: Crazylemon64 Date: Tue, 8 Mar 2016 17:00:14 -0800 Subject: [PATCH 18/21] Makes the namespacing less ridiculous --- .../living/carbon/human/species/station.dm | 40 +++++++++---------- code/modules/surgery/organs/organ_external.dm | 18 ++++----- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/code/modules/mob/living/carbon/human/species/station.dm b/code/modules/mob/living/carbon/human/species/station.dm index 00bc2813053..ad06f968397 100644 --- a/code/modules/mob/living/carbon/human/species/station.dm +++ b/code/modules/mob/living/carbon/human/species/station.dm @@ -399,19 +399,19 @@ /datum/species/slime/handle_life(var/mob/living/carbon/human/H) //This is allegedly for code "style". Like a plaid sweater? -#define DAAAAAAAAAAAAAAAAA_COLOR_SHIFT_TRIGGER 0.1 -#define DAAAAAAAAAAAAAAAAA_ICON_UPDATE_PERIOD 200 // 20 seconds -#define DAAAAAAAAAAAAAAAAA_BLOOD_SCALING_FACTOR 5 // Used to adjust how much of an effect the blood has on the rate of color change. Higher is slower. +#define SLIMEPERSON_COLOR_SHIFT_TRIGGER 0.1 +#define SLIMEPERSON_ICON_UPDATE_PERIOD 200 // 20 seconds +#define SLIMEPERSON_BLOOD_SCALING_FACTOR 5 // Used to adjust how much of an effect the blood has on the rate of color change. Higher is slower. // Slowly shifting to the color of the reagents - if((H in recolor_list) && H.reagents.total_volume > DAAAAAAAAAAAAAAAAA_COLOR_SHIFT_TRIGGER) + if((H in recolor_list) && H.reagents.total_volume > SLIMEPERSON_COLOR_SHIFT_TRIGGER) var/blood_amount = H.vessel.total_volume var/r_color = mix_color_from_reagents(H.reagents.reagent_list) - var/new_body_color = BlendRGB(r_color, rgb(H.r_skin, H.g_skin, H.b_skin), (blood_amount*DAAAAAAAAAAAAAAAAA_BLOOD_SCALING_FACTOR)/((blood_amount*DAAAAAAAAAAAAAAAAA_BLOOD_SCALING_FACTOR)+(H.reagents.total_volume))) + var/new_body_color = BlendRGB(r_color, rgb(H.r_skin, H.g_skin, H.b_skin), (blood_amount*SLIMEPERSON_BLOOD_SCALING_FACTOR)/((blood_amount*SLIMEPERSON_BLOOD_SCALING_FACTOR)+(H.reagents.total_volume))) var/list/new_color_list = ReadRGB(new_body_color) H.r_skin = new_color_list[1] H.g_skin = new_color_list[2] H.b_skin = new_color_list[3] - if(world.time % DAAAAAAAAAAAAAAAAA_ICON_UPDATE_PERIOD > DAAAAAAAAAAAAAAAAA_ICON_UPDATE_PERIOD - 20) // The 20 is because this gets called every 2 seconds, from the mob controller + if(world.time % SLIMEPERSON_ICON_UPDATE_PERIOD > SLIMEPERSON_ICON_UPDATE_PERIOD - 20) // The 20 is because this gets called every 2 seconds, from the mob controller for(var/organname in H.organs_by_name) var/obj/item/organ/external/E = H.organs_by_name[organname] if(istype(E) && E.dna.species == "Slime People") @@ -420,9 +420,9 @@ H.update_body() return ..() -#undefine DAAAAAAAAAAAAAAAAA_COLOR_SHIFT_TRIGGER -#undefine DAAAAAAAAAAAAAAAAA_ICON_UPDATE_PERIOD -#undefine DAAAAAAAAAAAAAAAAA_BLOOD_SCALING_FACTOR +#undefine SLIMEPERSON_COLOR_SHIFT_TRIGGER +#undefine SLIMEPERSON_ICON_UPDATE_PERIOD +#undefine SLIMEPERSON_BLOOD_SCALING_FACTOR /mob/living/carbon/human/proc/toggle_recolor(var/silent = 0) var/datum/species/slime/S = all_species[get_species()] @@ -453,15 +453,15 @@ set name = "Regrow Limbs" set desc = "Regrow one of your missing limbs at the cost of a large amount of hunger" -#define DAAAAAAAAAAAAAAAAA_HUNGERCOST 125 -#define DAAAAAAAAAAAAAAAAA_MINHUNGER 300 -#define DAAAAAAAAAAAAAAAAA_REGROWTHDELAY 450 // 45 seconds +#define SLIMEPERSON_HUNGERCOST 125 +#define SLIMEPERSON_MINHUNGER 300 +#define SLIMEPERSON_REGROWTHDELAY 450 // 45 seconds if(stat || paralysis || stunned) src << "You cannot regenerate missing limbs in your current state." return - if(nutrition < DAAAAAAAAAAAAAAAAA_MINHUNGER) + if(nutrition < SLIMEPERSON_MINHUNGER) src << "You're too hungry to regenerate a limb!" return @@ -484,13 +484,13 @@ var/limb_select = input(src, "Choose a limb to regrow", "Limb Regrowth") as null|anything in missing_limbs var/chosen_limb = missing_limbs[limb_select] - visible_message("[src] begins to hold still and concentrate on their missing [limb_select]...", "You begin to focus on regrowing your missing [limb_select]... (This will take [round(DAAAAAAAAAAAAAAAAA_REGROWTHDELAY/10)] seconds, and you must hold still.)") - if(do_after(src, DAAAAAAAAAAAAAAAAA_REGROWTHDELAY, needhand=0, target = src)) + visible_message("[src] begins to hold still and concentrate on their missing [limb_select]...", "You begin to focus on regrowing your missing [limb_select]... (This will take [round(SLIMEPERSON_REGROWTHDELAY/10)] seconds, and you must hold still.)") + if(do_after(src, SLIMEPERSON_REGROWTHDELAY, needhand=0, target = src)) if(stat || paralysis || stunned) src << "You cannot regenerate missing limbs in your current state." return - if(nutrition < DAAAAAAAAAAAAAAAAA_MINHUNGER) + if(nutrition < SLIMEPERSON_MINHUNGER) src << "You're too hungry to regenerate a limb!" return @@ -525,15 +525,15 @@ update_body() updatehealth() UpdateDamageIcon() - nutrition -= DAAAAAAAAAAAAAAAAA_HUNGERCOST + nutrition -= SLIMEPERSON_HUNGERCOST visible_message("[src] finishes regrowing their missing [new_limb]!", "You finish regrowing your [limb_select]") else src << "You need to hold still in order to regrow a limb!" return -#undefine DAAAAAAAAAAAAAAAAA_HUNGERCOST -#undefine DAAAAAAAAAAAAAAAAA_MINHUNGER -#undefine DAAAAAAAAAAAAAAAAA_REGROWTHDELAY +#undefine SLIMEPERSON_HUNGERCOST +#undefine SLIMEPERSON_MINHUNGER +#undefine SLIMEPERSON_REGROWTHDELAY /datum/species/slime/handle_pre_change(var/mob/living/carbon/human/H) ..() diff --git a/code/modules/surgery/organs/organ_external.dm b/code/modules/surgery/organs/organ_external.dm index 1cbca241391..6c236c5fe3d 100644 --- a/code/modules/surgery/organs/organ_external.dm +++ b/code/modules/surgery/organs/organ_external.dm @@ -170,15 +170,15 @@ burn *= burn_mod // Threshold needed to have a chance of hurting internal bits with something sharp -#define DAAAAAAAAAAAAAAAAA_SHARP_THRESH_INT_DMG 5 +#define LIMB_SHARP_THRESH_INT_DMG 5 // Threshold needed to have a chance of hurting internal bits -#define DAAAAAAAAAAAAAAAAA_THRESH_INT_DMG 10 +#define LIMB_THRESH_INT_DMG 10 // Probability of taking internal damage from sufficient force, while otherwise healthy -#define DAAAAAAAAAAAAAAAAA_DMG_PROB 5 +#define LIMB_DMG_PROB 5 // Probability of taking internal damage when hit while lacking encasing bones -#define DAAAAAAAAAAAAAAAAA_NO_BONE_DMG_PROB 30 +#define LIMB_NO_BONE_DMG_PROB 30 // High brute damage or sharp objects may damage internal organs - if(internal_organs && (brute_dam >= max_damage || (((sharp && brute >= DAAAAAAAAAAAAAAAAA_SHARP_THRESH_INT_DMG) || brute >= DAAAAAAAAAAAAAAAAA_THRESH_INT_DMG) && prob(DAAAAAAAAAAAAAAAAA_DMG_PROB)) || (!encased && prob(DAAAAAAAAAAAAAAAAA_NO_BONE_DMG_PROB)))) + if(internal_organs && (brute_dam >= max_damage || (((sharp && brute >= LIMB_SHARP_THRESH_INT_DMG) || brute >= LIMB_THRESH_INT_DMG) && prob(LIMB_DMG_PROB)) || (!encased && prob(LIMB_NO_BONE_DMG_PROB)))) // Damage an internal organ if(internal_organs && internal_organs.len) var/obj/item/organ/internal/I = pick(internal_organs) @@ -261,10 +261,10 @@ if(owner_old) owner_old.updatehealth() return update_icon() -#undefine DAAAAAAAAAAAAAAAAA_SHARP_THRESH_INT_DMG -#undefine DAAAAAAAAAAAAAAAAA_THRESH_INT_DMG -#undefine DAAAAAAAAAAAAAAAAA_DMG_PROB -#undefine DAAAAAAAAAAAAAAAAA_NO_BONE_DMG_PROB +#undefine LIMB_SHARP_THRESH_INT_DMG +#undefine LIMB_THRESH_INT_DMG +#undefine LIMB_DMG_PROB +#undefine LIMB_NO_BONE_DMG_PROB /obj/item/organ/external/proc/heal_damage(brute, burn, internal = 0, robo_repair = 0) if(status & ORGAN_ROBOT && !robo_repair) From d6c71b446972e501c0964868e37d8bab49a887ef Mon Sep 17 00:00:00 2001 From: Crazylemon64 Date: Tue, 8 Mar 2016 17:04:18 -0800 Subject: [PATCH 19/21] Reverts the fix to the progress bar proc --- code/__HELPERS/unsorted.dm | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 1e17e84735d..899e8caa98a 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -658,10 +658,7 @@ proc/anim(turf/location as turf,target as mob|obj,a_icon,a_icon_state as text,fl var/image/progbar for (var/i = 1 to numticks) if(user.client) - var/bar_target = target - if(bar_target == null) - bar_target = user - progbar = make_progress_bar(i, numticks, bar_target) + progbar = make_progress_bar(i, numticks, target) user.client.images |= progbar sleep(delayfraction) if(!user || user.stat || user.weakened || user.stunned || !(user.loc == Uloc)) From bdf4b05e16be18a04525bd043af570662a330bf7 Mon Sep 17 00:00:00 2001 From: Crazylemon64 Date: Tue, 8 Mar 2016 17:05:14 -0800 Subject: [PATCH 20/21] Switches to a functional #undef statement --- .../mob/living/carbon/human/species/station.dm | 12 ++++++------ code/modules/surgery/organs/organ_external.dm | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/code/modules/mob/living/carbon/human/species/station.dm b/code/modules/mob/living/carbon/human/species/station.dm index ad06f968397..18d2727214f 100644 --- a/code/modules/mob/living/carbon/human/species/station.dm +++ b/code/modules/mob/living/carbon/human/species/station.dm @@ -420,9 +420,9 @@ H.update_body() return ..() -#undefine SLIMEPERSON_COLOR_SHIFT_TRIGGER -#undefine SLIMEPERSON_ICON_UPDATE_PERIOD -#undefine SLIMEPERSON_BLOOD_SCALING_FACTOR +#undef SLIMEPERSON_COLOR_SHIFT_TRIGGER +#undef SLIMEPERSON_ICON_UPDATE_PERIOD +#undef SLIMEPERSON_BLOOD_SCALING_FACTOR /mob/living/carbon/human/proc/toggle_recolor(var/silent = 0) var/datum/species/slime/S = all_species[get_species()] @@ -531,9 +531,9 @@ src << "You need to hold still in order to regrow a limb!" return -#undefine SLIMEPERSON_HUNGERCOST -#undefine SLIMEPERSON_MINHUNGER -#undefine SLIMEPERSON_REGROWTHDELAY +#undef SLIMEPERSON_HUNGERCOST +#undef SLIMEPERSON_MINHUNGER +#undef SLIMEPERSON_REGROWTHDELAY /datum/species/slime/handle_pre_change(var/mob/living/carbon/human/H) ..() diff --git a/code/modules/surgery/organs/organ_external.dm b/code/modules/surgery/organs/organ_external.dm index 6c236c5fe3d..98e372eb21e 100644 --- a/code/modules/surgery/organs/organ_external.dm +++ b/code/modules/surgery/organs/organ_external.dm @@ -261,10 +261,10 @@ if(owner_old) owner_old.updatehealth() return update_icon() -#undefine LIMB_SHARP_THRESH_INT_DMG -#undefine LIMB_THRESH_INT_DMG -#undefine LIMB_DMG_PROB -#undefine LIMB_NO_BONE_DMG_PROB +#undef LIMB_SHARP_THRESH_INT_DMG +#undef LIMB_THRESH_INT_DMG +#undef LIMB_DMG_PROB +#undef LIMB_NO_BONE_DMG_PROB /obj/item/organ/external/proc/heal_damage(brute, burn, internal = 0, robo_repair = 0) if(status & ORGAN_ROBOT && !robo_repair) From bfca35a21399ccab8a586c1fb8530eecf16ecaec Mon Sep 17 00:00:00 2001 From: Crazylemon64 Date: Tue, 8 Mar 2016 17:11:33 -0800 Subject: [PATCH 21/21] Lack of encasement no longer leaves organs vulnerable --- code/modules/surgery/organs/organ_external.dm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/code/modules/surgery/organs/organ_external.dm b/code/modules/surgery/organs/organ_external.dm index 98e372eb21e..cc142ae3fd0 100644 --- a/code/modules/surgery/organs/organ_external.dm +++ b/code/modules/surgery/organs/organ_external.dm @@ -175,10 +175,8 @@ #define LIMB_THRESH_INT_DMG 10 // Probability of taking internal damage from sufficient force, while otherwise healthy #define LIMB_DMG_PROB 5 - // Probability of taking internal damage when hit while lacking encasing bones -#define LIMB_NO_BONE_DMG_PROB 30 // High brute damage or sharp objects may damage internal organs - if(internal_organs && (brute_dam >= max_damage || (((sharp && brute >= LIMB_SHARP_THRESH_INT_DMG) || brute >= LIMB_THRESH_INT_DMG) && prob(LIMB_DMG_PROB)) || (!encased && prob(LIMB_NO_BONE_DMG_PROB)))) + if(internal_organs && (brute_dam >= max_damage || (((sharp && brute >= LIMB_SHARP_THRESH_INT_DMG) || brute >= LIMB_THRESH_INT_DMG) && prob(LIMB_DMG_PROB)))) // Damage an internal organ if(internal_organs && internal_organs.len) var/obj/item/organ/internal/I = pick(internal_organs)