diff --git a/code/WorkInProgress/Cib/MedicalSideEffects.dm b/code/WorkInProgress/Cib/MedicalSideEffects.dm index c11f62a78ef..15580c4bd2e 100644 --- a/code/WorkInProgress/Cib/MedicalSideEffects.dm +++ b/code/WorkInProgress/Cib/MedicalSideEffects.dm @@ -23,7 +23,8 @@ /datum/medical_effect/proc/cure(mob/living/carbon/human/H) for(var/R in cures) if(H.reagents.has_reagent(R)) - H <<"\red [cure_message]" + if (cure_message) + H <<"\blue [cure_message]" return 1 return 0 @@ -39,16 +40,21 @@ M.start = life_tick return - var/list/L = typesof(/datum/medical_effect)-/datum/medical_effect - for(var/T in L) - var/datum/medical_effect/M = new T - if(M.name == name) - M.strength = strength - M.start = life_tick - side_effects += M + var/T = side_effects[name] + if (!T) + return + + var/datum/medical_effect/M = new T + if(M.name == name) + M.strength = strength + M.start = life_tick + side_effects += M /mob/living/carbon/human/proc/handle_medical_side_effects() + //Going to handle those things only every few ticks. + if(life_tick % 15 != 0) + return 0 var/list/L = typesof(/datum/medical_effect)-/datum/medical_effect for(var/T in L) @@ -60,18 +66,14 @@ for (var/datum/medical_effect/M in side_effects) if (!M) continue var/strength_percent = sin((life_tick - M.start) / 2) -// log_debug ("[src], tick [life_tick] : Processing [M], Current phase: [strength_percent]") // Only do anything if the effect is currently strong enough if(strength_percent >= 0.4) - log_debug ("[src], tick [life_tick] : Active phase ; strength [M.strength]") if (M.cure(src) || M.strength > 50) -// log_debug ("[src], tick [life_tick] : [M] cured or reached end of lifecycle") side_effects -= M - del(M) + M = null else if(life_tick % 45 == 0) -// log_debug ("[src], tick [life_tick] : Activating [M] ") M.on_life(src, strength_percent*M.strength) // Effect slowly growing stronger M.strength+=0.08 @@ -92,7 +94,6 @@ H.custom_pain("You feel a throbbing pain in your head!",1) if(31 to INFINITY) H.custom_pain("You feel an excrutiating pain in your head!",1) - H.adjustBrainLoss(1) // BAD STOMACH // =========== @@ -110,7 +111,6 @@ H.custom_pain("Your stomach hurts.",0) if(31 to INFINITY) H.custom_pain("You feel sick.",1) - H.adjustToxLoss(1) // CRAMPS // ====== @@ -129,7 +129,6 @@ if(31 to INFINITY) H.emote("me",1,"flinches as all the muscles in their body cramp up.") H.custom_pain("There's pain all over your body.",1) - H.adjustToxLoss(1) // ITCH // ==== @@ -148,4 +147,3 @@ if(31 to INFINITY) H.emote("me",1,"shivers slightly.") H.custom_pain("This itch makes it really hard to concentrate.",1) - H.adjustToxLoss(1) \ No newline at end of file diff --git a/code/__HELPERS/global_lists.dm b/code/__HELPERS/global_lists.dm index 956e6be2557..ce8d788f25f 100644 --- a/code/__HELPERS/global_lists.dm +++ b/code/__HELPERS/global_lists.dm @@ -15,6 +15,7 @@ var/global/list/chemical_reactions_list //list of all /datum/chemical_reactio var/global/list/chemical_reagents_list //list of all /datum/reagent datums indexed by reagent id. Used by chemistry stuff var/global/list/landmarks_list = list() //list of all landmarks created var/global/list/surgery_steps = list() //list of all surgery steps |BS12 +var/global/list/side_effects = list() //list of all medical sideeffects types by thier names |BS12 var/global/list/mechas_list = list() //list of all mechs. Used by hostile mobs target tracking. //Languages/species/whitelist. @@ -75,6 +76,13 @@ var/global/list/backbaglist = list("Nothing", "Backpack", "Satchel", "Satchel Al surgery_steps += S sort_surgeries() + //Medical side effects. List all effects by their names + paths = typesof(/datum/medical_effect)-/datum/medical_effect + for(var/T in paths) + var/datum/medical_effect/M = new T + side_effects[M.name] = T + + //Languages and species. paths = typesof(/datum/language)-/datum/language for(var/T in paths) diff --git a/code/game/objects/items/weapons/cards_ids.dm b/code/game/objects/items/weapons/cards_ids.dm index c0339639955..2ca53be3ee7 100644 --- a/code/game/objects/items/weapons/cards_ids.dm +++ b/code/game/objects/items/weapons/cards_ids.dm @@ -127,7 +127,7 @@ icon_state = "id" item_state = "card-id" var/access = list() - var/registered_name = null // The name registered_name on the card + var/registered_name = "Unknown" // The name registered_name on the card slot_flags = SLOT_ID var/blood_type = "\[UNSET\]" @@ -280,4 +280,4 @@ assignment = "General" New() access = get_all_centcom_access() - ..() \ No newline at end of file + ..() diff --git a/code/modules/organs/organ.dm b/code/modules/organs/organ.dm index 45828edc2aa..33ce1131c54 100644 --- a/code/modules/organs/organ.dm +++ b/code/modules/organs/organ.dm @@ -91,7 +91,7 @@ I.take_damage(rand(3,5)) //Special effects for limbs. - if(E.name in list("l_hand","l_arm","r_hand","r_arm")) + if(E.name in list("l_hand","l_arm","r_hand","r_arm") && (broken||malfunction)) var/obj/item/c_hand //Getting what's in this hand if(E.name == "l_hand" || E.name == "l_arm") c_hand = l_hand @@ -99,8 +99,7 @@ c_hand = r_hand if (c_hand) - if (broken||malfunction) - u_equip(c_hand) + u_equip(c_hand) if(broken) emote("me", 1, "screams in pain and drops what they were holding in their [E.display_name?"[E.display_name]":"[E]"]!") @@ -124,35 +123,11 @@ paralysis = 10 //Check arms and legs for existence - var/canstand_l = 1 //Can stand on left leg - var/canstand_r = 1 //Can stand on right leg - var/hasleg_l = 1 //Have left leg - var/hasleg_r = 1 //Have right leg - var/hasarm_l = 1 //Have left arm - var/hasarm_r = 1 //Have right arm - var/datum/organ/external/E - E = get_organ("l_leg") - if(E.status & ORGAN_DESTROYED && !(E.status & ORGAN_SPLINTED)) - canstand_l = 0 - hasleg_l = 0 - E = get_organ("r_leg") - if(E.status & ORGAN_DESTROYED && !(E.status & ORGAN_SPLINTED)) - canstand_r = 0 - hasleg_r = 0 - E = get_organ("l_foot") - if(E.status & ORGAN_DESTROYED && !(E.status & ORGAN_SPLINTED)) - canstand_l = 0 - E = get_organ("r_foot") - if(E.status & ORGAN_DESTROYED && !(E.status & ORGAN_SPLINTED)) - canstand_r = 0 - E = get_organ("l_arm") - if(E.status & ORGAN_DESTROYED && !(E.status & ORGAN_SPLINTED)) - hasarm_l = 0 - E = get_organ("r_arm") - if(E.status & ORGAN_DESTROYED && !(E.status & ORGAN_SPLINTED)) - hasarm_r = 0 + can_stand = 2 //can stand on both legs + var/datum/organ/external/E = organs_by_name["l_foot"] + if(E.status & ORGAN_DESTROYED) + can_stand-- - // Can stand if have at least one full leg (with leg and foot parts present) - // Has limbs to move around if at least one arm or leg is at least partially there - can_stand = canstand_l||canstand_r - has_limbs = hasleg_l||hasleg_r||hasarm_l||hasarm_r + E = organs_by_name["r_foot"] + if(E.status & ORGAN_DESTROYED) + can_stand-- diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index 7658aa303a5..a671584ed43 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -203,7 +203,6 @@ This function completely restores a damaged organ to perfect condition. implants -= implanted_object owner.updatehealth() - update_icon() /datum/organ/external/proc/createwound(var/type = CUT, var/damage) @@ -290,7 +289,6 @@ This function completely restores a damaged organ to perfect condition. perma_injury = 0 update_germs() - update_icon() return //Updating germ levels. Handles organ germ levels and necrosis. @@ -383,6 +381,8 @@ This function completely restores a damaged organ to perfect condition. // sync the organ's damage with its wounds src.update_damages() + if (update_icon()) + owner.UpdateDamageIcon(1) //Updates brute_damn and burn_damn from wound damages. Updates BLEEDING status. /datum/organ/external/proc/update_damages() @@ -415,10 +415,6 @@ This function completely restores a damaged organ to perfect condition. var/n_is = damage_state_text() if (n_is != damage_state) damage_state = n_is - if(status & ORGAN_DESTROYED) - owner.update_body(1) - else - owner.UpdateDamageIcon(1) return 1 return 0 @@ -550,7 +546,7 @@ This function completely restores a damaged organ to perfect condition. var/lol = pick(cardinal) step(organ,lol) - owner.regenerate_icons() + owner.update_body(1) /**************************************************** diff --git a/code/modules/surgery/appendix.dm b/code/modules/surgery/appendix.dm index 54a26427fcf..ede75704ee0 100644 --- a/code/modules/surgery/appendix.dm +++ b/code/modules/surgery/appendix.dm @@ -31,8 +31,8 @@ return ..() && target.op_stage.appendix == 0 begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - user.visible_message("[user] starts to separating [target]'s appendix from the abdominal wall with \the [tool].", \ - "You start to separating [target]'s appendix from the abdominal wall with \the [tool]." ) + user.visible_message("[user] starts to separate [target]'s appendix from the abdominal wall with \the [tool].", \ + "You start to separate [target]'s appendix from the abdominal wall with \the [tool]." ) target.custom_pain("The pain in your abdomen is living hell!",1) ..() diff --git a/code/modules/surgery/bones.dm b/code/modules/surgery/bones.dm index 75e3b6e0997..d0d30cfd209 100644 --- a/code/modules/surgery/bones.dm +++ b/code/modules/surgery/bones.dm @@ -88,8 +88,8 @@ return affected.name == "head" && affected.open == 2 && affected.stage == 1 begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - user.visible_message("[user] is beginning piece together [target]'s skull with \the [tool]." , \ - "You are beginning piece together [target]'s skull with \the [tool].") + user.visible_message("[user] is beginning to piece together [target]'s skull with \the [tool]." , \ + "You are beginning to piece together [target]'s skull with \the [tool].") ..() end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) diff --git a/code/modules/surgery/braincore.dm b/code/modules/surgery/braincore.dm index c95904dcd7c..d94615c953f 100644 --- a/code/modules/surgery/braincore.dm +++ b/code/modules/surgery/braincore.dm @@ -27,8 +27,8 @@ ..() end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - user.visible_message("\blue [user] has cut through [target]'s skull open with \the [tool].", \ - "\blue You have cut through [target]'s skull open with \the [tool].") + user.visible_message("\blue [user] has cut [target]'s skull open with \the [tool].", \ + "\blue You have cut [target]'s skull open with \the [tool].") target.brain_op_stage = 2 fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) @@ -122,13 +122,13 @@ return ..() && target.brain_op_stage == 2 begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - user.visible_message("[user] starts taking out bone chips out of [target]'s brain with \the [tool].", \ - "You start taking out bone chips out of [target]'s brain with \the [tool].") + user.visible_message("[user] starts taking bone chips out of [target]'s brain with \the [tool].", \ + "You start taking bone chips out of [target]'s brain with \the [tool].") ..() end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - user.visible_message("\blue [user] takes out all bone chips out of [target]'s brain with \the [tool].", \ - "\blue You take out all bone chips out of [target]'s brain with \the [tool].") + user.visible_message("\blue [user] takes out all the bone chips in [target]'s brain with \the [tool].", \ + "\blue You take out all the bone chips in [target]'s brain with \the [tool].") target.brain_op_stage = 3 @@ -189,12 +189,12 @@ return ..() && target.brain_op_stage == 0 begin_step(mob/user, mob/living/carbon/slime/target, target_zone, obj/item/tool) - user.visible_message("[user] starts cutting [target]'s flesh with \the [tool].", \ - "You start cutting [target]'s flesh with \the [tool].") + user.visible_message("[user] starts cutting through [target]'s flesh with \the [tool].", \ + "You start cutting through [target]'s flesh with \the [tool].") end_step(mob/living/user, mob/living/carbon/slime/target, target_zone, obj/item/tool) - user.visible_message("\blue [user] cuts [target]'s flesh with \the [tool].", \ - "\blue You cut [target]'s flesh with \the [tool], exposing the cores") + user.visible_message("\blue [user] cuts through [target]'s flesh with \the [tool].", \ + "\blue You cut through [target]'s flesh with \the [tool], exposing the cores.") target.brain_op_stage = 1 fail_step(mob/living/user, mob/living/carbon/slime/target, target_zone, obj/item/tool) @@ -219,8 +219,8 @@ "You start cutting [target]'s silky innards apart with \the [tool].") end_step(mob/living/user, mob/living/carbon/slime/target, target_zone, obj/item/tool) - user.visible_message("\blue [user] cuts [target]'s innards apart with \the [tool], exposing the cores", \ - "\blue You cut [target]'s innards apart with \the [tool], exposing the cores") + user.visible_message("\blue [user] cuts [target]'s innards apart with \the [tool], exposing the cores.", \ + "\blue You cut [target]'s innards apart with \the [tool], exposing the cores.") target.brain_op_stage = 2 fail_step(mob/living/user, mob/living/carbon/slime/target, target_zone, obj/item/tool) @@ -256,5 +256,5 @@ fail_step(mob/living/user, mob/living/carbon/slime/target, target_zone, obj/item/tool) - user.visible_message("\red [user]'s hand slips, failing to cut core out!", \ - "\red Your hand slips, failing to cut core out!") \ No newline at end of file + user.visible_message("\red [user]'s hand slips, causing \him to miss the core!", \ + "\red Your hand slips, causing you to miss the core!") \ No newline at end of file diff --git a/code/modules/surgery/face.dm b/code/modules/surgery/face.dm index e215487d0b7..b3569b08873 100644 --- a/code/modules/surgery/face.dm +++ b/code/modules/surgery/face.dm @@ -85,13 +85,13 @@ return ..() && target.op_stage.face == 2 begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - user.visible_message("[user] starts pulling skin on [target]'s face back in place with \the [tool].", \ - "You start pulling skin on [target]'s face back in place with \the [tool].") + user.visible_message("[user] starts pulling the skin on [target]'s face back in place with \the [tool].", \ + "You start pulling the skin on [target]'s face back in place with \the [tool].") ..() end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - user.visible_message("\blue [user] pulls skin on [target]'s face back in place with \the [tool].", \ - "\blue You pull skin on [target]'s face back in place with \the [tool].") + user.visible_message("\blue [user] pulls the skin on [target]'s face back in place with \the [tool].", \ + "\blue You pull the skin on [target]'s face back in place with \the [tool].") target.op_stage.face = 3 fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) diff --git a/code/modules/surgery/generic.dm b/code/modules/surgery/generic.dm index ede924d8b48..9ebf546d449 100644 --- a/code/modules/surgery/generic.dm +++ b/code/modules/surgery/generic.dm @@ -52,8 +52,8 @@ fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/datum/organ/external/affected = target.get_organ(target_zone) - user.visible_message("\red [user]'s hand slips, slicing open [target]'s [affected.display_name] in a wrong spot with \the [tool]!", \ - "\red Your hand slips, slicing open [target]'s [affected.display_name] in a wrong spot with \the [tool]!") + user.visible_message("\red [user]'s hand slips, slicing open [target]'s [affected.display_name] in the wrong place with \the [tool]!", \ + "\red Your hand slips, slicing open [target]'s [affected.display_name] in the wrong place with \the [tool]!") affected.createwound(CUT, 10) /datum/surgery_step/generic/clamp_bleeders @@ -133,14 +133,14 @@ fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/datum/organ/external/affected = target.get_organ(target_zone) - var/msg = "\red [user]'s hand slips, tearing the edges of incision on [target]'s [affected.display_name] with \the [tool]!" - var/self_msg = "\red Your hand slips, tearing the edges of incision on [target]'s [affected.display_name] with \the [tool]!" + var/msg = "\red [user]'s hand slips, tearing the edges of the incision on [target]'s [affected.display_name] with \the [tool]!" + var/self_msg = "\red Your hand slips, tearing the edges of the incision on [target]'s [affected.display_name] with \the [tool]!" if (target_zone == "chest") - msg = "\red [user]'s hand slips, damaging several organs [target]'s torso with \the [tool]!" - self_msg = "\red Your hand slips, damaging several organs [target]'s torso with \the [tool]!" + msg = "\red [user]'s hand slips, damaging several organs in [target]'s torso with \the [tool]!" + self_msg = "\red Your hand slips, damaging several organs in [target]'s torso with \the [tool]!" if (target_zone == "groin") - msg = "\red [user]'s hand slips, damaging several organs [target]'s lower abdomen with \the [tool]" - self_msg = "\red Your hand slips, damaging several organs [target]'s lower abdomen with \the [tool]!" + msg = "\red [user]'s hand slips, damaging several organs in [target]'s lower abdomen with \the [tool]" + self_msg = "\red Your hand slips, damaging several organs in [target]'s lower abdomen with \the [tool]!" user.visible_message(msg, self_msg) target.apply_damage(12, BRUTE, affected) diff --git a/code/modules/surgery/implant.dm b/code/modules/surgery/implant.dm index edc89ac0ac2..01d54bedaaf 100644 --- a/code/modules/surgery/implant.dm +++ b/code/modules/surgery/implant.dm @@ -123,7 +123,7 @@ user.visible_message("\blue [user] puts \the [tool] inside [target]'s [get_cavity(affected)] cavity.", \ "\blue You put \the [tool] inside [target]'s [get_cavity(affected)] cavity." ) if (tool.w_class > get_max_wclass(affected)/2 && prob(50)) - user << "\red You tear some vessels trying to fit such big object in this cavity." + user << "\red You tear some blood vessels trying to fit such a big object in this cavity." var/datum/wound/internal_bleeding/I = new (15) affected.wounds += I affected.owner.custom_pain("You feel something rip in your [affected.display_name]!", 1) diff --git a/code/modules/surgery/ribcage.dm b/code/modules/surgery/ribcage.dm index 48a22b27e1a..747d8a4363d 100644 --- a/code/modules/surgery/ribcage.dm +++ b/code/modules/surgery/ribcage.dm @@ -31,8 +31,8 @@ ..() end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - user.visible_message("\blue [user] has cut through [target]'s ribcage open with \the [tool].", \ - "\blue You have cut through [target]'s ribcage open with \the [tool].") + user.visible_message("\blue [user] has cut [target]'s ribcage open with \the [tool].", \ + "\blue You have cut [target]'s ribcage open with \the [tool].") target.op_stage.ribcage = 1 fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) @@ -111,14 +111,14 @@ target.op_stage.ribcage = 1 fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) - var/msg = "\red [user]'s hand slips, bending [target]'s ribcage in a wrong shape!" - var/self_msg = "\red Your hand slips, bending [target]'s ribcage in a wrong shape!" + var/msg = "\red [user]'s hand slips, bending [target]'s ribs the wrong way!" + var/self_msg = "\red Your hand slips, bending [target]'s ribs the wrong way!" user.visible_message(msg, self_msg) var/datum/organ/external/chest/affected = target.get_organ("chest") affected.createwound(BRUISE, 20) affected.fracture() if (prob(40)) - user.visible_message("\red Rib pierces the lung!") + user.visible_message("\red A rib pierces the lung!") target.rupture_lung() /datum/surgery_step/ribcage/mend_ribcage diff --git a/code/modules/surgery/robolimbs.dm b/code/modules/surgery/robolimbs.dm index 97db2846220..8faa6b65113 100644 --- a/code/modules/surgery/robolimbs.dm +++ b/code/modules/surgery/robolimbs.dm @@ -46,7 +46,7 @@ if (affected.parent) affected = affected.parent user.visible_message("\red [user]'s hand slips, cutting [target]'s [affected.display_name] open!", \ - "\red Your hand slips, cutting [target]'s [affected.display_name] open!") + "\red Your hand slips, cutting [target]'s [affected.display_name] open!") affected.createwound(CUT, 10) @@ -65,8 +65,8 @@ begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/datum/organ/external/affected = target.get_organ(target_zone) - user.visible_message("[user] is beginning reposition flesh and nerve endings where where [target]'s [affected.display_name] used to be with [tool].", \ - "You start repositioning flesh and nerve endings where where [target]'s [affected.display_name] used to be with [tool].") + user.visible_message("[user] is beginning to reposition flesh and nerve endings where where [target]'s [affected.display_name] used to be with [tool].", \ + "You start repositioning flesh and nerve endings where [target]'s [affected.display_name] used to be with [tool].") ..() end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) @@ -101,8 +101,8 @@ begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/datum/organ/external/affected = target.get_organ(target_zone) - user.visible_message("[user] starts adjusting area around [target]'s [affected.display_name] with \the [tool].", \ - "You start adjusting area around [target]'s [affected.display_name] with \the [tool]..") + user.visible_message("[user] starts adjusting the area around [target]'s [affected.display_name] with \the [tool].", \ + "You start adjusting the area around [target]'s [affected.display_name] with \the [tool].") ..() end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) @@ -140,14 +140,14 @@ begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/datum/organ/external/affected = target.get_organ(target_zone) - user.visible_message("[user] starts attaching [tool] where [target]'s [affected.display_name] used to be.", \ - "You start attaching [tool] where [target]'s [affected.display_name] used to be.") + user.visible_message("[user] starts attaching \the [tool] where [target]'s [affected.display_name] used to be.", \ + "You start attaching \the [tool] where [target]'s [affected.display_name] used to be.") end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/obj/item/robot_parts/L = tool var/datum/organ/external/affected = target.get_organ(target_zone) - user.visible_message("\blue [user] has attached [tool] where [target]'s [affected.display_name] used to be.", \ - "\blue You have attached [tool] where [target]'s [affected.display_name] used to be.") + user.visible_message("\blue [user] has attached \the [tool] where [target]'s [affected.display_name] used to be.", \ + "\blue You have attached \the [tool] where [target]'s [affected.display_name] used to be.") affected.robotize() if(L.sabotaged) affected.sabotaged = 1