From acfd99e33cb881e0c9a50ec8c28ab97500442b00 Mon Sep 17 00:00:00 2001 From: Chinsky Date: Sat, 21 Feb 2015 16:31:44 +0300 Subject: [PATCH] Surgery now shows up on mob, in all gory glory. --- .../mob/living/carbon/human/update_icons.dm | 57 +++++++++++------- code/modules/surgery/surgery.dm | 3 + icons/mob/surgery.dmi | Bin 0 -> 1829 bytes 3 files changed, 38 insertions(+), 22 deletions(-) create mode 100644 icons/mob/surgery.dmi diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index 6b2367724b..496e09d2eb 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -107,28 +107,29 @@ Please contact me on #coderbus IRC. ~Carn x //Human Overlays Indexes///////// #define MUTATIONS_LAYER 1 #define DAMAGE_LAYER 2 -#define UNIFORM_LAYER 3 -#define TAIL_LAYER 4 //bs12 specific. this hack is probably gonna come back to haunt me -#define ID_LAYER 5 -#define SHOES_LAYER 6 -#define GLOVES_LAYER 7 -#define SUIT_LAYER 8 -#define GLASSES_LAYER 9 -#define BELT_LAYER 10 //Possible make this an overlay of somethign required to wear a belt? -#define SUIT_STORE_LAYER 11 -#define BACK_LAYER 12 -#define HAIR_LAYER 13 //TODO: make part of head layer? -#define EARS_LAYER 14 -#define FACEMASK_LAYER 15 -#define HEAD_LAYER 16 -#define COLLAR_LAYER 17 -#define HANDCUFF_LAYER 18 -#define LEGCUFF_LAYER 19 -#define L_HAND_LAYER 20 -#define R_HAND_LAYER 21 -#define FIRE_LAYER 22 //If you're on fire -#define TARGETED_LAYER 23 //BS12: Layer for the target overlay from weapon targeting system -#define TOTAL_LAYERS 23 +#define SURGERY_LEVEL 3 //bs12 specific. +#define UNIFORM_LAYER 4 +#define TAIL_LAYER 5 //bs12 specific. this hack is probably gonna come back to haunt me +#define ID_LAYER 6 +#define SHOES_LAYER 7 +#define GLOVES_LAYER 8 +#define SUIT_LAYER 9 +#define GLASSES_LAYER 10 +#define BELT_LAYER 11 //Possible make this an overlay of somethign required to wear a belt? +#define SUIT_STORE_LAYER 12 +#define BACK_LAYER 13 +#define HAIR_LAYER 14 //TODO: make part of head layer? +#define EARS_LAYER 15 +#define FACEMASK_LAYER 16 +#define HEAD_LAYER 17 +#define COLLAR_LAYER 18 +#define HANDCUFF_LAYER 19 +#define LEGCUFF_LAYER 20 +#define L_HAND_LAYER 21 +#define R_HAND_LAYER 22 +#define FIRE_LAYER 23 //If you're on fire +#define TARGETED_LAYER 24 //BS12: Layer for the target overlay from weapon targeting system +#define TOTAL_LAYERS 24 ////////////////////////////////// /mob/living/carbon/human @@ -509,6 +510,7 @@ proc/get_damage_icon_part(damage_state, body_part) update_inv_legcuffed(0) update_inv_pockets(0) update_fire(0) + update_surgery(0) UpdateDamageIcon() update_icons() //Hud Stuff @@ -929,6 +931,16 @@ proc/get_damage_icon_part(damage_state, body_part) if(update_icons) update_icons() +/mob/living/carbon/human/proc/update_surgery(var/update_icons=1) + overlays_standing[SURGERY_LEVEL] = null + var/image/total = new + for(var/datum/organ/external/E in organs) + if(E.open) + var/image/I = image("icon"='icons/mob/surgery.dmi', "icon_state"="[E.name][round(E.open)]", "layer"=-SURGERY_LEVEL) + total.overlays += I + overlays_standing[SURGERY_LEVEL] = total + if(update_icons) update_icons() + // Used mostly for creating head items /mob/living/carbon/human/proc/generate_head_icon() //gender no longer matters for the mouth, although there should probably be seperate base head icons. @@ -967,6 +979,7 @@ proc/get_damage_icon_part(damage_state, body_part) //Human Overlays Indexes///////// #undef MUTATIONS_LAYER #undef DAMAGE_LAYER +#undef SURGERY_LEVEL #undef UNIFORM_LAYER #undef TAIL_LAYER #undef ID_LAYER diff --git a/code/modules/surgery/surgery.dm b/code/modules/surgery/surgery.dm index 825a4c582e..f44ae0fabd 100644 --- a/code/modules/surgery/surgery.dm +++ b/code/modules/surgery/surgery.dm @@ -103,6 +103,9 @@ proc/do_surgery(mob/living/carbon/M, mob/living/user, obj/item/tool) else // This failing silently was a pain. user << "\red You must remain close to your patient to conduct surgery." M.op_stage.in_progress = 0 // Clear the in-progress flag. + if (ishuman(M)) + var/mob/living/carbon/human/H = M + H.update_surgery() return 1 //don't want to do weapony things after surgery if (user.a_intent == "help") diff --git a/icons/mob/surgery.dmi b/icons/mob/surgery.dmi new file mode 100644 index 0000000000000000000000000000000000000000..20381e09090bfb3ca5f92717e6835482152e23e7 GIT binary patch literal 1829 zcmYk73pmsJAIE>3=s%Gh*CL{jayTWIxfF80Gj}o$bDb>9B^$y&DrrX!rjbIbxlFl@ z!bENfIdW|{V&9=3GG?e)XW0_ zog!eTEqUv87_Y*H2Qry;bYwD_-DjjgsAfjR!XT!iNjo zbaR3Lrc0Bd{LN63yZ22C7&16E0&z1U<~jf*7B~LUCen3E>P}d)i0$_1e)Tmw^Zt={ z=D#ngiKwO9arSikM_z4dk{M|jOqKQEhsL(Jws6MD)JL1swG@?=Ka1)M6*KNXI|qhT zgh@Y~&k&XBh395o9I{$NKM)Gb%R6#%Q|alHPn(QVH8(Bac2I2emx!5%&!dIwj}LCU zEMA>%3VvE67!Qd(nX3a=i0#AFRrBsxJb7&`VnjGxx;eHF9<=&hXgnAbYb5l=&{z=a*A>vL@+< zYYxAFR;8D=Q;VD=wF|m^Z!b*U{S!n=Is3fqMor_{_5>xLg5+*W4>o*%v$&UndT}v2 zPUcAl9>G#k&=x`JSzhQJ(KCZhU16NZc52*^zsG!XuKus{*i%7hp8Kucou8*tBls&H zs~zZxIWRSJB?9~>2f-uWuOY`@(VI)zy+ zGlukq%TClpaERJzzWJYa{YxAda+oEt5w3-AVmGUJOUfC(JL1hXuQG{T)cvC@?eg={ z?PwMm!gxp97+30+)!kprY5tr@Zn!mbsZqThH3u4`fE4ac_|oFmvYEDY)cS-n+WB|R zlCoJ7UFmxCOs^3Kj#mB3?v9=;ZMXJFWz;vd=#_eX$uDFO62ly5lq)<=#I>&n^V!fY z7WA4QYZ;cwvXzfO&XwZ_$JVCZwNfW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