From 57f5c5d15fc5db605160960d5ff7b823a5499748 Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Wed, 1 Apr 2015 05:18:32 -0700 Subject: [PATCH 01/13] Fixes #8702 --- code/modules/mob/living/carbon/human/human.dm | 4 ++-- code/modules/organs/organ_icon.dm | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 9c3057c52d8..a9f3b1a6c48 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1119,8 +1119,6 @@ species = all_species[new_species] - species.create_organs(src) - if(species.language) add_language(species.language) @@ -1137,6 +1135,8 @@ g_skin = 0 b_skin = 0 + species.create_organs(src) + species.handle_post_spawn(src) maxHealth = species.total_health diff --git a/code/modules/organs/organ_icon.dm b/code/modules/organs/organ_icon.dm index d5b6bf2a4e1..ba9cbc42c36 100644 --- a/code/modules/organs/organ_icon.dm +++ b/code/modules/organs/organ_icon.dm @@ -16,7 +16,7 @@ var/global/list/limb_icon_cache = list() /obj/item/organ/external/proc/sync_colour_to_human(var/mob/living/carbon/human/human) s_tone = null s_col = null - if(human.s_tone && (human.species.flags & HAS_SKIN_TONE)) + if(!isnull(human.s_tone) && (human.species.flags & HAS_SKIN_TONE)) s_tone = human.s_tone if(human.species.flags & HAS_SKIN_COLOR) s_col = list(human.r_skin, human.g_skin, human.b_skin) From ed54a8aaa7680892790e069c8ef6e62dddec543e Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Wed, 1 Apr 2015 05:35:59 -0700 Subject: [PATCH 02/13] Fixes #8693 --- code/modules/mob/inventory.dm | 6 +++--- code/modules/mob/living/carbon/carbon.dm | 9 ++++----- code/modules/mob/living/carbon/human/human.dm | 5 +++++ code/modules/mob/living/living.dm | 5 +++++ 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index ea56c749b80..829ee6e86d0 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -151,7 +151,7 @@ var/list/slot_equipment_priority = list( \ remove_from_mob(W) if(!W) return 1 // self destroying objects (tk, grabs) - + W.forceMove(Target) update_icons() return 1 @@ -173,11 +173,11 @@ var/list/slot_equipment_priority = list( \ /* Removes the object from any slots the mob might have, calling the appropriate icon update proc. Does nothing else. - + DO NOT CALL THIS PROC DIRECTLY. It is meant to be called only by other inventory procs. It's probably okay to use it if you are transferring the item between slots on the same mob, but chances are you're safer calling remove_from_mob() or drop_from_inventory() anyways. - + As far as I can tell the proc exists so that mobs with different inventory slots can override the search through all the slots, without having to duplicate the rest of the item dropping. */ diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 63eba6e781d..da10a9ea00d 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -31,10 +31,9 @@ var/d = rand(round(I.force / 4), I.force) if(istype(src, /mob/living/carbon/human)) var/mob/living/carbon/human/H = src - var/organ = H.get_organ("chest") - if (istype(organ, /obj/item/organ/external)) - var/obj/item/organ/external/temp = organ - if(temp.take_damage(d, 0)) + var/obj/item/organ/external/organ = H.get_organ("chest") + if (istype(organ)) + if(organ.take_damage(d, 0)) H.UpdateDamageIcon() H.updatehealth() else @@ -328,7 +327,7 @@ if(!item) return //Grab processing has a chance of returning null - + src.remove_from_mob(item) item.loc = src.loc diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index a9f3b1a6c48..12c326606a0 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1361,3 +1361,8 @@ U << "You pop [S]'s [current_limb.joint] back in!" S << "[U] pops your [current_limb.joint] back in!" current_limb.undislocate() + +/mob/living/carbon/human/drop_from_inventory(var/obj/item/W, var/atom/Target = null) + if(W in organs) + return + ..() \ No newline at end of file diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 00802c5da91..0bf49782972 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -967,6 +967,11 @@ default behaviour is: /mob/living/proc/slip(var/slipped_on,stun_duration=8) return 0 +/mob/living/carbon/drop_from_inventory(var/obj/item/W, var/atom/Target = null) + if(W in internal_organs) + return + ..() + /mob/living/carbon/proc/spin(spintime, speed) spawn() var/D = dir From 03d5c2a5cd4c4c074c7c79456fbe007e63e0ffea Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Wed, 1 Apr 2015 05:55:34 -0700 Subject: [PATCH 03/13] Fixes #8619 --- code/game/gamemodes/gameticker.dm | 1 - 1 file changed, 1 deletion(-) diff --git a/code/game/gamemodes/gameticker.dm b/code/game/gamemodes/gameticker.dm index 544776d1447..64a824e7695 100644 --- a/code/game/gamemodes/gameticker.dm +++ b/code/game/gamemodes/gameticker.dm @@ -98,7 +98,6 @@ var/global/datum/controller/gameticker/ticker src.mode = config.pick_mode(master_mode) if(!mode_started && !src.mode.can_start()) world << "Unable to start [mode.name]. Not enough players, [mode.required_players] players needed. Reverting to pre-game lobby." - del(mode) current_state = GAME_STATE_PREGAME job_master.ResetOccupations() return 0 From 5983f01d22d6d7471d1a07083b5675218854ea07 Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Wed, 1 Apr 2015 05:56:46 -0700 Subject: [PATCH 04/13] Fixes #8618 --- code/modules/mob/mob.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index e4405c57672..482ec2e3a19 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -729,7 +729,7 @@ note dizziness decrements automatically in the mob's Life() proc. stat(null,"Location:\t([x], [y], [z])") stat(null,"CPU:\t[world.cpu]") stat(null,"Instances:\t[world.contents.len]") - if(statpanel("Status") && processScheduler.getIsRunning()) + if(statpanel("Status") && processScheduler && processScheduler.getIsRunning()) var/datum/controller/process/process process = processScheduler.getProcess("ticker") From 8475be5d4ea851c043304dbe19e48a9091388f32 Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Wed, 1 Apr 2015 06:10:07 -0700 Subject: [PATCH 05/13] Fixes a few incidental bugs with the antag and organ changes. --- code/game/gamemodes/gameticker.dm | 1 + code/modules/mob/living/carbon/human/human.dm | 6 ++++-- code/modules/organs/organ_external.dm | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/code/game/gamemodes/gameticker.dm b/code/game/gamemodes/gameticker.dm index 64a824e7695..8ad65194d18 100644 --- a/code/game/gamemodes/gameticker.dm +++ b/code/game/gamemodes/gameticker.dm @@ -99,6 +99,7 @@ var/global/datum/controller/gameticker/ticker if(!mode_started && !src.mode.can_start()) world << "Unable to start [mode.name]. Not enough players, [mode.required_players] players needed. Reverting to pre-game lobby." current_state = GAME_STATE_PREGAME + mode = null job_master.ResetOccupations() return 0 diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 12c326606a0..59fcdeaa94b 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -20,6 +20,8 @@ else set_species() + name = species.get_random_name(gender) + var/datum/reagents/R = new/datum/reagents(1000) reagents = R R.my_atom = src @@ -326,8 +328,8 @@ //Returns "Unknown" if facially disfigured and real_name if not. Useful for setting name when polyacided or when updating a human's name variable /mob/living/carbon/human/proc/get_face_name() - var/obj/item/organ/external/head/head = get_organ("head") - if( !head || head.disfigured || (head.status & ORGAN_DESTROYED) || !real_name || (HUSK in mutations) ) //disfigured. use id-name if possible + var/obj/item/organ/external/head = get_organ("head") + if(!head || head.disfigured || (head.status & ORGAN_DESTROYED) || !real_name || (HUSK in mutations) ) //disfigured. use id-name if possible return "Unknown" return real_name diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index b6f14b64bce..ec8a8b293dd 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -18,7 +18,7 @@ var/icon/mob_icon var/gendered_icon = 0 var/limb_name - var/disfigured = 1 + var/disfigured = 0 var/cannot_amputate var/cannot_break var/s_tone From 93a63134b17468602d33d1a7ed4403c1586721e9 Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Wed, 1 Apr 2015 16:56:59 -0700 Subject: [PATCH 06/13] Fixes #8711 --- code/game/antagonist/antagonist_build.dm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/game/antagonist/antagonist_build.dm b/code/game/antagonist/antagonist_build.dm index f0f92c62b7a..dc6800c7509 100644 --- a/code/game/antagonist/antagonist_build.dm +++ b/code/game/antagonist/antagonist_build.dm @@ -28,7 +28,9 @@ // This could use work. if(flags & ANTAG_CLEAR_EQUIPMENT) for(var/obj/item/thing in player.contents) - del(thing) + player.drop_from_inventory(thing) + if(thing.loc != player) + del(thing) return 1 if(flags & ANTAG_SET_APPEARANCE) From 6e0e98469cafb87e12be9c04789034dc36377895 Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Wed, 1 Apr 2015 16:59:48 -0700 Subject: [PATCH 07/13] Fixes #8709 --- code/modules/mob/living/carbon/brain/brain_item.dm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/code/modules/mob/living/carbon/brain/brain_item.dm b/code/modules/mob/living/carbon/brain/brain_item.dm index d2aa61e635b..6272f5cc410 100644 --- a/code/modules/mob/living/carbon/brain/brain_item.dm +++ b/code/modules/mob/living/carbon/brain/brain_item.dm @@ -2,6 +2,9 @@ name = "brain" health = 400 //They need to live awhile longer than other organs. desc = "A piece of juicy meat found in a person's head." + organ_tag = "brain" + parent_organ = "head" + vital = 1 icon_state = "brain2" force = 1.0 w_class = 2.0 From c3eb6102b40dc2c4fabe265badc0dd0220107307 Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Wed, 1 Apr 2015 17:06:49 -0700 Subject: [PATCH 08/13] Added a few null checks. --- code/game/antagonist/antagonist_build.dm | 1 + code/game/antagonist/outsider/deathsquad.dm | 5 +++-- code/modules/organs/organ_external.dm | 24 ++++++--------------- code/modules/projectiles/targeting.dm | 10 ++++----- code/modules/surgery/organs_internal.dm | 6 ++++-- 5 files changed, 20 insertions(+), 26 deletions(-) diff --git a/code/game/antagonist/antagonist_build.dm b/code/game/antagonist/antagonist_build.dm index dc6800c7509..34631d36fba 100644 --- a/code/game/antagonist/antagonist_build.dm +++ b/code/game/antagonist/antagonist_build.dm @@ -82,6 +82,7 @@ /datum/antagonist/proc/create_id(var/assignment, var/mob/living/carbon/human/player) var/obj/item/weapon/card/id/W = new id_type(player) + if(!W) return W.name = "[player.real_name]'s ID Card" W.access |= default_access W.assignment = "[assignment]" diff --git a/code/game/antagonist/outsider/deathsquad.dm b/code/game/antagonist/outsider/deathsquad.dm index 05fb6d1ec9b..73c2c7fd78a 100644 --- a/code/game/antagonist/outsider/deathsquad.dm +++ b/code/game/antagonist/outsider/deathsquad.dm @@ -44,8 +44,9 @@ var/datum/antagonist/deathsquad/deathsquad player.implant_loyalty(player) var/obj/item/weapon/card/id/id = create_id("Asset Protection", player) - id.access |= get_all_accesses() - id.icon_state = "centcom" + if(id) + id.access |= get_all_accesses() + id.icon_state = "centcom" create_radio(DTH_FREQ, player) /datum/antagonist/deathsquad/apply(var/datum/mind/player) diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index ec8a8b293dd..eba5430fd47 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -3,13 +3,16 @@ ****************************************************/ /obj/item/organ/external name = "external" + min_broken_damage = 30 + max_damage = 0 + dir = SOUTH + organ_tag = "limb" + var/icon_name = null var/body_part = null var/icon_position = 0 - var/model var/force_icon - var/damage_state = "00" var/brute_dam = 0 var/burn_dam = 0 @@ -26,38 +29,25 @@ var/list/wounds = list() var/number_wounds = 0 // cache the number of wounds, which is NOT wounds.len! var/perma_injury = 0 - var/obj/item/organ/external/parent var/list/obj/item/organ/external/children - - // Internal organs of this body part - var/list/internal_organs = list() - + var/list/internal_organs = list() // Internal organs of this body part var/damage_msg = "\red You feel an intense pain" var/broken_description - var/open = 0 var/stage = 0 var/cavity = 0 var/sabotaged = 0 // If a prosthetic limb is emagged, it will detonate when it fails. var/encased // Needs to be opened with a saw to access the organs. - var/obj/item/hidden = null var/list/implants = list() - - // how often wounds should be updated, a higher number means less often - var/wound_update_accuracy = 1 - + var/wound_update_accuracy = 1 // how often wounds should be updated, a higher number means less often var/joint = "joint" // Descriptive string used in dislocation. var/amputation_point // Descriptive string used in amputation. var/dislocated = 0 // If you target a joint, you can dislocate the limb, causing temporary damage to the organ. var/can_grasp var/can_stand - min_broken_damage = 30 - max_damage = 0 - dir = SOUTH - /obj/item/organ/external/attackby(obj/item/weapon/W as obj, mob/user as mob) switch(stage) if(0) diff --git a/code/modules/projectiles/targeting.dm b/code/modules/projectiles/targeting.dm index 388b53a2566..4e49a785e76 100644 --- a/code/modules/projectiles/targeting.dm +++ b/code/modules/projectiles/targeting.dm @@ -23,7 +23,7 @@ //Removing the lock and the buttons. /obj/item/weapon/gun/dropped(mob/user as mob) stop_aim() - if (user.client) + if(user && user.client) user.client.remove_gun_icons() return ..() @@ -47,7 +47,7 @@ /obj/item/weapon/gun/proc/PreFire(atom/A as mob|obj|turf|area, mob/living/user as mob|obj, params) //Lets not spam it. if(lock_time > world.time - 2) return - + user.set_dir(get_cardinal_dir(src, A)) if(isliving(A) && !(A in aim_targets)) Aim(A) //Clicked a mob, aim at them @@ -58,7 +58,7 @@ if(isliving(M) && (M in view(user)) && !(M in aim_targets)) Aim(M) //Aha! Aim at them! return 1 - + return 0 //Aiming at the target mob. @@ -83,12 +83,12 @@ if(src != M.get_active_hand()) stop_aim() return - + //reflex firing is disabled when help intent is set if (M.a_intent == I_HELP) M << "\red You refrain from firing your [src] as your intent is set to help." return - + M.last_move_intent = world.time var/firing_check = can_hit(T,usr) //0 if it cannot hit them, 1 if it is capable of hitting, and 2 if a special check is preventing it from firing. if(firing_check > 0) diff --git a/code/modules/surgery/organs_internal.dm b/code/modules/surgery/organs_internal.dm index bb0a6314c83..3f02eb8651d 100644 --- a/code/modules/surgery/organs_internal.dm +++ b/code/modules/surgery/organs_internal.dm @@ -343,9 +343,11 @@ var/o_a = (O.gender == PLURAL) ? "" : "a " var/o_do = (O.gender == PLURAL) ? "don't" : "doesn't" - if(target.species.has_organ[O.organ_tag]) + if(O.organ_tag == "limb") + return 0 + else if(target.species.has_organ[O.organ_tag]) - if(!O.health) + if(O.is_damaged()) user << "\red \The [O.organ_tag] [o_is] in no state to be transplanted." return 2 From 294a1ff1f12d7a90cc02b848ec56680fd0889961 Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Wed, 1 Apr 2015 17:27:06 -0700 Subject: [PATCH 09/13] Should fix #8710 --- code/modules/organs/organ_external.dm | 6 ++++-- code/modules/surgery/organs_internal.dm | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index eba5430fd47..de2d5443380 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -640,8 +640,8 @@ Note that amputating the affected organ does in fact remove the infection from t wounds.Cut() if(parent) var/datum/wound/W - if(max_damage < 50) - W = new/datum/wound/lost_limb/small(max_damage) + if(clean || max_damage < 50) + W = new/datum/wound/lost_limb/small(max_damage/2) else W = new/datum/wound/lost_limb(max_damage) parent.children -= src @@ -930,6 +930,7 @@ Note that amputating the affected organ does in fact remove the infection from t gendered_icon = 1 cannot_amputate = 1 parent_organ = null + encased = "ribcage" /obj/item/organ/external/groin name = "lower body" @@ -1051,6 +1052,7 @@ Note that amputating the affected organ does in fact remove the infection from t joint = "jaw" amputation_point = "neck" gendered_icon = 1 + encased = "skull" /obj/item/organ/external/head/removed() if(owner) diff --git a/code/modules/surgery/organs_internal.dm b/code/modules/surgery/organs_internal.dm index 3f02eb8651d..8f5d7155dd8 100644 --- a/code/modules/surgery/organs_internal.dm +++ b/code/modules/surgery/organs_internal.dm @@ -357,7 +357,7 @@ user << "\red \The [target] already has [o_a][O.organ_tag]." return 2 - if(O && affected.name == O.parent_organ) + if(O && affected.limb_name == O.parent_organ) organ_compatible = 1 else user << "\red \The [O.organ_tag] [o_do] normally go in \the [affected.name]." From 3cc34ab55e7b74fc59762a70580f07a9930663a0 Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Wed, 1 Apr 2015 17:38:15 -0700 Subject: [PATCH 10/13] Organ tweaks/fixes. --- .../modules/mob/living/carbon/human/species/outsider/vox.dm | 2 +- code/modules/mob/living/carbon/human/species/species.dm | 2 +- code/modules/organs/organ_internal.dm | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/code/modules/mob/living/carbon/human/species/outsider/vox.dm b/code/modules/mob/living/carbon/human/species/outsider/vox.dm index 853fb4e8d47..c037d81fb73 100644 --- a/code/modules/mob/living/carbon/human/species/outsider/vox.dm +++ b/code/modules/mob/living/carbon/human/species/outsider/vox.dm @@ -45,7 +45,7 @@ "heart" = /obj/item/organ/heart, "lungs" = /obj/item/organ/lungs, "liver" = /obj/item/organ/liver, - "kidneys" = /obj/item/organ/kidney, + "kidneys" = /obj/item/organ/kidneys, "brain" = /obj/item/organ/brain, "eyes" = /obj/item/organ/eyes, "stack" = /obj/item/organ/stack/vox diff --git a/code/modules/mob/living/carbon/human/species/species.dm b/code/modules/mob/living/carbon/human/species/species.dm index 09f3360d45e..b97e8ceed67 100644 --- a/code/modules/mob/living/carbon/human/species/species.dm +++ b/code/modules/mob/living/carbon/human/species/species.dm @@ -110,7 +110,7 @@ "heart" = /obj/item/organ/heart, "lungs" = /obj/item/organ/lungs, "liver" = /obj/item/organ/liver, - "kidneys" = /obj/item/organ/kidney, + "kidneys" = /obj/item/organ/kidneys, "brain" = /obj/item/organ/brain, "appendix" = /obj/item/organ/appendix, "eyes" = /obj/item/organ/eyes diff --git a/code/modules/organs/organ_internal.dm b/code/modules/organs/organ_internal.dm index c552631abfd..46e22e1e5fa 100644 --- a/code/modules/organs/organ_internal.dm +++ b/code/modules/organs/organ_internal.dm @@ -44,7 +44,7 @@ organ_tag = "kidneys" parent_organ = "groin" -/obj/item/organ/kidney/process() +/obj/item/organ/kidneys/process() ..() @@ -61,7 +61,6 @@ else if(is_broken()) owner.adjustToxLoss(0.3 * PROCESS_ACCURACY) - /obj/item/organ/eyes name = "eyeballs" icon_state = "eyes" @@ -113,7 +112,7 @@ name = "liver" icon_state = "liver" organ_tag = "liver" - parent_organ = "chest" + parent_organ = "groin" /obj/item/organ/liver/process() @@ -175,6 +174,7 @@ name = "appendix" icon_state = "appendix" parent_organ = "groin" + organ_tag = "appendix" /obj/item/organ/appendix/removed() From 84b903cf69b332e4d8755351978cfd5498fe447f Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Wed, 1 Apr 2015 17:57:28 -0700 Subject: [PATCH 11/13] Fixes #8702 properly. --- code/game/dna/dna2_helpers.dm | 2 +- code/modules/mob/living/carbon/brain/brain_item.dm | 4 +++- code/modules/mob/living/carbon/human/appearance.dm | 9 +++++++-- code/modules/mob/new_player/new_player.dm | 1 + code/modules/organs/organ.dm | 1 + code/modules/organs/organ_external.dm | 1 + code/modules/organs/organ_icon.dm | 2 ++ code/modules/surgery/robolimbs.dm | 8 +++++++- 8 files changed, 23 insertions(+), 5 deletions(-) diff --git a/code/game/dna/dna2_helpers.dm b/code/game/dna/dna2_helpers.dm index 9bfdf9f0b65..e1fda4965c3 100644 --- a/code/game/dna/dna2_helpers.dm +++ b/code/game/dna/dna2_helpers.dm @@ -165,7 +165,7 @@ if((0 < beard) && (beard <= facial_hair_styles_list.len)) H.f_style = facial_hair_styles_list[beard] - H.update_body(0) + H.force_update_limbs() H.update_hair() return 1 diff --git a/code/modules/mob/living/carbon/brain/brain_item.dm b/code/modules/mob/living/carbon/brain/brain_item.dm index 6272f5cc410..05ceed79162 100644 --- a/code/modules/mob/living/carbon/brain/brain_item.dm +++ b/code/modules/mob/living/carbon/brain/brain_item.dm @@ -49,7 +49,7 @@ /obj/item/organ/brain/removed(var/mob/living/user) - ..() + name = "[owner.real_name]'s brain" var/mob/living/simple_animal/borer/borer = owner.has_brain_worms() @@ -60,6 +60,8 @@ if(istype(B) && istype(owner)) B.transfer_identity(owner) + ..() + /obj/item/organ/brain/replaced(var/mob/living/target) if(target.key) diff --git a/code/modules/mob/living/carbon/human/appearance.dm b/code/modules/mob/living/carbon/human/appearance.dm index 311942ca021..e2ef586f05c 100644 --- a/code/modules/mob/living/carbon/human/appearance.dm +++ b/code/modules/mob/living/carbon/human/appearance.dm @@ -117,7 +117,7 @@ g_skin = green b_skin = blue - update_body() + force_update_limbs() return 1 /mob/living/carbon/human/proc/change_skin_tone(var/tone) @@ -126,7 +126,7 @@ s_tone = tone - update_body() + force_update_limbs() return 1 /mob/living/carbon/human/proc/update_dna() @@ -186,3 +186,8 @@ /proc/q() var/mob/living/carbon/human/H = usr H.change_appearance(APPEARANCE_ALL) + +/mob/living/carbon/human/proc/force_update_limbs() + for(var/obj/item/organ/external/O in organs) + O.sync_colour_to_human(src) + update_body(0) \ No newline at end of file diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index 90e201b3828..1d67b712f51 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -473,6 +473,7 @@ //new_character.dna.UpdateSE() // Do the initial caching of the player's body icons. + new_character.force_update_limbs() new_character.regenerate_icons() new_character.key = key //Manually transfer the key to log them in diff --git a/code/modules/organs/organ.dm b/code/modules/organs/organ.dm index 5d307fffcf2..51ff1379ab1 100644 --- a/code/modules/organs/organ.dm +++ b/code/modules/organs/organ.dm @@ -235,6 +235,7 @@ var/list/organ_cache = list() owner.internal_organs_by_name[organ_tag] = null owner.internal_organs_by_name -= organ_tag + owner.internal_organs_by_name -= null owner.internal_organs -= src var/obj/item/organ/external/affected = owner.get_organ(parent_organ) diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index de2d5443380..d8ba25d750b 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -1056,6 +1056,7 @@ Note that amputating the affected organ does in fact remove the infection from t /obj/item/organ/external/head/removed() if(owner) + name = "[owner.real_name]'s head" owner.u_equip(owner.glasses) owner.u_equip(owner.head) owner.u_equip(owner.l_ear) diff --git a/code/modules/organs/organ_icon.dm b/code/modules/organs/organ_icon.dm index ba9cbc42c36..b0e23df3d25 100644 --- a/code/modules/organs/organ_icon.dm +++ b/code/modules/organs/organ_icon.dm @@ -16,6 +16,8 @@ var/global/list/limb_icon_cache = list() /obj/item/organ/external/proc/sync_colour_to_human(var/mob/living/carbon/human/human) s_tone = null s_col = null + if(status & ORGAN_ROBOT) + return if(!isnull(human.s_tone) && (human.species.flags & HAS_SKIN_TONE)) s_tone = human.s_tone if(human.species.flags & HAS_SKIN_COLOR) diff --git a/code/modules/surgery/robolimbs.dm b/code/modules/surgery/robolimbs.dm index 5b524288f9c..8d7b31c59b9 100644 --- a/code/modules/surgery/robolimbs.dm +++ b/code/modules/surgery/robolimbs.dm @@ -39,8 +39,14 @@ if(L.part) for(var/part_name in L.part) - if(!isnull(target.get_organ(part_name))) continue + world << "Checking [part_name]" + if(!isnull(target.get_organ(part_name))) + world << "target has organ there" + continue var/list/organ_data = target.species.has_limbs["[target_zone]"] + if(!organ_data) + world << "target species has no limb for that part" + continue var/new_limb_type = organ_data["path"] var/obj/item/organ/external/new_limb = new new_limb_type(target) new_limb.robotize(L.model_info) From 8def76f8498a538160f3f36733c7c28e8d95e531 Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Wed, 1 Apr 2015 18:06:46 -0700 Subject: [PATCH 12/13] Removing some debugs. --- code/modules/mob/living/carbon/human/human.dm | 3 ++- code/modules/surgery/robolimbs.dm | 3 --- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 59fcdeaa94b..1e693fd63fc 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -20,7 +20,8 @@ else set_species() - name = species.get_random_name(gender) + if(species) + name = species.get_random_name(gender) var/datum/reagents/R = new/datum/reagents(1000) reagents = R diff --git a/code/modules/surgery/robolimbs.dm b/code/modules/surgery/robolimbs.dm index 8d7b31c59b9..e845d8bb7b7 100644 --- a/code/modules/surgery/robolimbs.dm +++ b/code/modules/surgery/robolimbs.dm @@ -39,13 +39,10 @@ if(L.part) for(var/part_name in L.part) - world << "Checking [part_name]" if(!isnull(target.get_organ(part_name))) - world << "target has organ there" continue var/list/organ_data = target.species.has_limbs["[target_zone]"] if(!organ_data) - world << "target species has no limb for that part" continue var/new_limb_type = organ_data["path"] var/obj/item/organ/external/new_limb = new new_limb_type(target) From 1673e8d51482c8c4bd52a6ee445747ea4aebb1d0 Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Wed, 1 Apr 2015 20:54:34 -0700 Subject: [PATCH 13/13] Added organs to the processing list when removed, oops. --- code/modules/organs/organ.dm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/modules/organs/organ.dm b/code/modules/organs/organ.dm index 51ff1379ab1..f97df890809 100644 --- a/code/modules/organs/organ.dm +++ b/code/modules/organs/organ.dm @@ -242,6 +242,7 @@ var/list/organ_cache = list() if(affected) affected.internal_organs -= src loc = owner.loc + processing_objects |= src rejecting = null var/datum/reagent/blood/organ_blood = locate(/datum/reagent/blood) in reagents.reagent_list if(!organ_blood || !organ_blood.data["blood_DNA"]) @@ -270,6 +271,7 @@ var/list/organ_cache = list() transplant_data["blood_DNA"] = transplant_blood.data["blood_DNA"] owner = target + processing_objects -= src target.internal_organs |= src affected.internal_organs |= src target.internal_organs_by_name[organ_tag] = src