From 4f29b1b3eafa0d1a12caa21fee1aaf6c35061bb8 Mon Sep 17 00:00:00 2001 From: Crazylemon64 Date: Tue, 8 Mar 2016 16:56:09 -0800 Subject: [PATCH] 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