diff --git a/code/__DEFINES/dcs/signals.dm b/code/__DEFINES/dcs/signals.dm index 7db67c3072..e9d62a3e1d 100644 --- a/code/__DEFINES/dcs/signals.dm +++ b/code/__DEFINES/dcs/signals.dm @@ -357,7 +357,7 @@ #define COMSIG_PROJECTILE_SELF_ON_HIT "projectile_self_on_hit" // from base of /obj/item/projectile/proc/on_hit(): (atom/movable/firer, atom/target, Angle) #define COMSIG_PROJECTILE_ON_HIT "projectile_on_hit" // from base of /obj/item/projectile/proc/on_hit(): (atom/movable/firer, atom/target, Angle) #define COMSIG_PROJECTILE_BEFORE_FIRE "projectile_before_fire" // from base of /obj/item/projectile/proc/fire(): (obj/item/projectile, atom/original_target) -#define COMSIG_PROJECTILE_FIRE "projectile_fire" ///from the base of /obj/projectile/proc/fire(): () +#define COMSIG_PROJECTILE_FIRE "projectile_fire" ///from the base of /obj/item/projectile/proc/fire(): () #define COMSIG_PROJECTILE_RANGE_OUT "projectile_range_out" // sent to targets during the process_hit proc of projectiles #define COMSIG_EMBED_TRY_FORCE "item_try_embed" // sent when trying to force an embed (mainly for projectiles, only used in the embed element) #define COMSIG_PROJECTILE_PREHIT "com_proj_prehit" ///sent to targets during the process_hit proc of projectiles @@ -367,6 +367,7 @@ // /mob/living/carbon/human signals #define COMSIG_HUMAN_MELEE_UNARMED_ATTACK "human_melee_unarmed_attack" //from mob/living/carbon/human/UnarmedAttack(): (atom/target) #define COMSIG_HUMAN_MELEE_UNARMED_ATTACKBY "human_melee_unarmed_attackby" //from mob/living/carbon/human/UnarmedAttack(): (mob/living/carbon/human/attacker) +#define COMSIG_HUMAN_EARLY_UNARMED_ATTACK "human_early_unarmed_attack" #define COMSIG_HUMAN_DISARM_HIT "human_disarm_hit" //Hit by successful disarm attack (mob/living/carbon/human/attacker,zone_targeted) #define COMSIG_HUMAN_PREFS_COPIED_TO "human_prefs_copied_to" //from datum/preferences/copy_to(): (datum/preferences, icon_updates, roundstart_checks) #define COMSIG_HUMAN_HARDSET_DNA "human_hardset_dna" //from mob/living/carbon/human/hardset_dna(): (ui, list/mutation_index, newreal_name, newblood_type, datum/species, newfeatures) diff --git a/code/__DEFINES/mobs.dm b/code/__DEFINES/mobs.dm index ddb901f24c..52657e9104 100644 --- a/code/__DEFINES/mobs.dm +++ b/code/__DEFINES/mobs.dm @@ -12,6 +12,8 @@ #define MOVE_INTENT_RUN "run" //Blood levels +#define BLOOD_VOLUME_MAX_LETHAL 2150 +#define BLOOD_VOLUME_EXCESS 2100 #define BLOOD_VOLUME_MAXIMUM 2000 #define BLOOD_VOLUME_SLIME_SPLIT 1120 #define BLOOD_VOLUME_NORMAL 560 diff --git a/code/__HELPERS/do_after.dm b/code/__HELPERS/do_after.dm index f1f483c345..614c3d73c4 100644 --- a/code/__HELPERS/do_after.dm +++ b/code/__HELPERS/do_after.dm @@ -166,6 +166,8 @@ var/target_loc = target.loc + LAZYADD(user.do_afters, target) + var/holding = user.get_active_held_item() var/datum/progressbar/progbar if (progress) @@ -183,6 +185,9 @@ break if(uninterruptible) continue + if(!(target in user.do_afters)) + . = FALSE + break if(drifting && !user.inertia_dir) drifting = 0 @@ -191,9 +196,10 @@ if((!drifting && user.loc != user_loc) || target.loc != target_loc || (!ignorehelditem && user.get_active_held_item() != holding) || user.incapacitated() || user.lying || (extra_checks && !extra_checks.Invoke())) . = 0 break - if (progress) + if(progress) qdel(progbar) - + if(!QDELETED(target)) + LAZYREMOVE(user.do_afters, target) //some additional checks as a callback for for do_afters that want to break on losing health or on the mob taking action /mob/proc/break_do_after_checks(list/checked_health, check_clicks) @@ -216,6 +222,9 @@ if(target && !isturf(target)) Tloc = target.loc + if(target) + LAZYADD(user.do_afters, target) + var/atom/Uloc = user.loc var/drifting = 0 @@ -260,6 +269,10 @@ . = 0 break + if(target && !(target in user.do_afters)) + . = FALSE + break + if(needhand) //This might seem like an odd check, but you can still need a hand even when it's empty //i.e the hand is used to pull some item/tool out of the construction @@ -270,8 +283,10 @@ if(user.get_active_held_item() != holding) . = 0 break - if (progress) + if(progress) qdel(progbar) + if(!QDELETED(target)) + LAZYREMOVE(user.do_afters, target) /mob/proc/do_after_coefficent() // This gets added to the delay on a do_after, default 1 . = 1 @@ -291,6 +306,7 @@ var/list/originalloc = list() for(var/atom/target in targets) originalloc[target] = target.loc + LAZYADD(user.do_afters, target) var/holding = user.get_active_held_item() var/datum/progressbar/progbar @@ -321,3 +337,7 @@ break mainloop if(progbar) qdel(progbar) + for(var/thing in targets) + var/atom/target = thing + if(!QDELETED(target)) + LAZYREMOVE(user.do_afters, target) diff --git a/code/datums/mind.dm b/code/datums/mind.dm index 9e426843e4..cb99fdc5a3 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -93,7 +93,6 @@ return language_holder /datum/mind/proc/transfer_to(mob/new_character, var/force_key_move = 0) - var/original_character = null var/old_character = current var/signals = SEND_SIGNAL(new_character, COMSIG_MOB_PRE_PLAYER_CHANGE, new_character, old_character) | SEND_SIGNAL(src, COMSIG_PRE_MIND_TRANSFER, new_character, old_character) if(signals & COMPONENT_STOP_MIND_TRANSFER) diff --git a/code/datums/wounds/_wounds.dm b/code/datums/wounds/_wounds.dm index d70a4ebdb2..b1ba49b7ab 100644 --- a/code/datums/wounds/_wounds.dm +++ b/code/datums/wounds/_wounds.dm @@ -206,8 +206,6 @@ /// Additional beneficial effects when the wound is gained, in case you want to give a temporary boost to allow the victim to try an escape or last stand /datum/wound/proc/second_wind() - if(HAS_TRAIT(victim, TRAIT_NOMETABOLISM)) - return switch(severity) if(WOUND_SEVERITY_MODERATE) diff --git a/code/datums/wounds/bones.dm b/code/datums/wounds/bones.dm new file mode 100644 index 0000000000..93ca9c5b67 --- /dev/null +++ b/code/datums/wounds/bones.dm @@ -0,0 +1,453 @@ + +/* + Bones +*/ +// TODO: well, a lot really, but i'd kill to get overlays and a bonebreaking effect like Blitz: The League, similar to electric shock skeletons + +/* + Base definition +*/ +/datum/wound/brute/bone + sound_effect = 'sound/effects/crack1.ogg' + wound_type = WOUND_LIST_BONE + + /// The item we're currently splinted with, if there is one + var/obj/item/stack/splinted + + /// Have we been taped? + var/taped + /// Have we been bone gel'd? + var/gelled + /// If we did the gel + surgical tape healing method for fractures, how many regen points we need + var/regen_points_needed + /// Our current counter for gel + surgical tape regeneration + var/regen_points_current + /// If we suffer severe head booboos, we can get brain traumas tied to them + var/datum/brain_trauma/active_trauma + /// What brain trauma group, if any, we can draw from for head wounds + var/brain_trauma_group + /// If we deal brain traumas, when is the next one due? + var/next_trauma_cycle + /// How long do we wait +/- 20% for the next trauma? + var/trauma_cycle_cooldown + /// If this is a chest wound and this is set, we have this chance to cough up blood when hit in the chest + var/chance_internal_bleeding = 0 + +/* + Overwriting of base procs +*/ +/datum/wound/brute/bone/wound_injury(datum/wound/old_wound = null) + if(limb.body_zone == BODY_ZONE_HEAD && brain_trauma_group) + processes = TRUE + active_trauma = victim.gain_trauma_type(brain_trauma_group, TRAUMA_RESILIENCE_WOUND) + next_trauma_cycle = world.time + (rand(100-WOUND_BONE_HEAD_TIME_VARIANCE, 100+WOUND_BONE_HEAD_TIME_VARIANCE) * 0.01 * trauma_cycle_cooldown) + + RegisterSignal(victim, COMSIG_HUMAN_EARLY_UNARMED_ATTACK, .proc/attack_with_hurt_hand) + if(limb.held_index && victim.get_item_for_held_index(limb.held_index) && (disabling || prob(30 * severity))) + var/obj/item/I = victim.get_item_for_held_index(limb.held_index) + if(istype(I, /obj/item/offhand)) + I = victim.get_inactive_held_item() + + if(I && victim.dropItemToGround(I)) + victim.visible_message("[victim] drops [I] in shock!", "The force on your [limb.name] causes you to drop [I]!", vision_distance=COMBAT_MESSAGE_RANGE) + + update_inefficiencies() + +/datum/wound/brute/bone/remove_wound(ignore_limb, replaced) + limp_slowdown = 0 + QDEL_NULL(active_trauma) + if(victim) + UnregisterSignal(victim, COMSIG_HUMAN_EARLY_UNARMED_ATTACK) + return ..() + +/datum/wound/brute/bone/handle_process() + . = ..() + if(limb.body_zone == BODY_ZONE_HEAD && brain_trauma_group && world.time > next_trauma_cycle) + if(active_trauma) + QDEL_NULL(active_trauma) + else + active_trauma = victim.gain_trauma_type(brain_trauma_group, TRAUMA_RESILIENCE_WOUND) + next_trauma_cycle = world.time + (rand(100-WOUND_BONE_HEAD_TIME_VARIANCE, 100+WOUND_BONE_HEAD_TIME_VARIANCE) * 0.01 * trauma_cycle_cooldown) + + if(!regen_points_needed) + return + + regen_points_current++ + if(prob(severity * 2)) + victim.take_bodypart_damage(rand(2, severity * 2), stamina=rand(2, severity * 2.5), wound_bonus=CANT_WOUND) + if(prob(33)) + to_chat(victim, "You feel a sharp pain in your body as your bones are reforming!") + + if(regen_points_current > regen_points_needed) + if(!victim || !limb) + qdel(src) + return + to_chat(victim, "Your [limb.name] has recovered from your fracture!") + remove_wound() + +/// If we're a human who's punching something with a broken arm, we might hurt ourselves doing so +/datum/wound/brute/bone/proc/attack_with_hurt_hand(mob/M, atom/target, proximity) + if(victim.get_active_hand() != limb || victim.a_intent == INTENT_HELP || !ismob(target) || severity <= WOUND_SEVERITY_MODERATE) + return + + // With a severe or critical wound, you have a 15% or 30% chance to proc pain on hit + if(prob((severity - 1) * 15)) + // And you have a 70% or 50% chance to actually land the blow, respectively + if(prob(70 - 20 * (severity - 1))) + to_chat(victim, "The fracture in your [limb.name] shoots with pain as you strike [target]!") + limb.receive_damage(brute=rand(1,5)) + else + victim.visible_message("[victim] weakly strikes [target] with [victim.p_their()] broken [limb.name], recoiling from pain!", \ + "You fail to strike [target] as the fracture in your [limb.name] lights up in unbearable pain!", vision_distance=COMBAT_MESSAGE_RANGE) + victim.emote("scream") + victim.Stun(0.5 SECONDS) + limb.receive_damage(brute=rand(3,7)) + return COMPONENT_NO_ATTACK_HAND + +/datum/wound/brute/bone/receive_damage(wounding_type, wounding_dmg, wound_bonus) + if(!victim) + return + + if(limb.body_zone == BODY_ZONE_CHEST && victim.blood_volume && prob(chance_internal_bleeding + wounding_dmg)) + var/blood_bled = rand(1, wounding_dmg * (severity == WOUND_SEVERITY_CRITICAL ? 2 : 1.5)) // 12 brute toolbox can cause up to 18/24 bleeding with a severe/critical chest wound + switch(blood_bled) + if(1 to 6) + victim.bleed(blood_bled, TRUE) + if(7 to 13) + victim.visible_message("[victim] coughs up a bit of blood from the blow to [victim.p_their()] chest.", "You cough up a bit of blood from the blow to your chest.") + victim.bleed(blood_bled, TRUE) + if(14 to 19) + victim.visible_message("[victim] spits out a string of blood from the blow to [victim.p_their()] chest!", "You spit out a string of blood from the blow to your chest!") + new /obj/effect/temp_visual/dir_setting/bloodsplatter(victim.loc, victim.dir) + victim.bleed(blood_bled) + if(20 to INFINITY) + victim.visible_message("[victim] chokes up a spray of blood from the blow to [victim.p_their()] chest!", "You choke up on a spray of blood from the blow to your chest!") + victim.bleed(blood_bled) + new /obj/effect/temp_visual/dir_setting/bloodsplatter(victim.loc, victim.dir) + victim.add_splatter_floor(get_step(victim.loc, victim.dir)) + + if(!(wounding_type in list(WOUND_SHARP, WOUND_BURN)) || !splinted || wound_bonus == CANT_WOUND) + return + + splinted.take_damage(wounding_dmg, damage_type = (wounding_type == WOUND_SHARP ? BRUTE : BURN), sound_effect = FALSE) + if(QDELETED(splinted)) + var/destroyed_verb = (wounding_type == WOUND_SHARP ? "torn" : "burned") + victim.visible_message("The splint securing [victim]'s [limb.name] is [destroyed_verb] away!", "The splint securing your [limb.name] is [destroyed_verb] away!", vision_distance=COMBAT_MESSAGE_RANGE) + splinted = null + treat_priority = TRUE + update_inefficiencies() + + +/datum/wound/brute/bone/get_examine_description(mob/user) + if(!splinted && !gelled && !taped) + return ..() + + var/msg = "" + if(!splinted) + msg = "[victim.p_their(TRUE)] [limb.name] [examine_desc]" + else + var/splint_condition = "" + // how much life we have left in these bandages + switch(splinted.obj_integrity / splinted.max_integrity * 100) + if(0 to 25) + splint_condition = "just barely " + if(25 to 50) + splint_condition = "loosely " + if(50 to 75) + splint_condition = "mostly " + if(75 to INFINITY) + splint_condition = "tightly " + + msg = "[victim.p_their(TRUE)] [limb.name] is [splint_condition] fastened in a splint of [splinted.name]" + + if(taped) + msg += ", and appears to be reforming itself under some surgical tape!" + else if(gelled) + msg += ", with fizzing flecks of blue bone gel sparking off the bone!" + else + msg += "!" + return "[msg]" + +/* + New common procs for /datum/wound/brute/bone/ +*/ + +/datum/wound/brute/bone/proc/update_inefficiencies() + if(limb.body_zone in list(BODY_ZONE_L_LEG, BODY_ZONE_R_LEG)) + if(splinted) + limp_slowdown = initial(limp_slowdown) * splinted.splint_factor + else + limp_slowdown = initial(limp_slowdown) + victim.apply_status_effect(STATUS_EFFECT_LIMP) + else if(limb.body_zone in list(BODY_ZONE_L_ARM, BODY_ZONE_R_ARM)) + if(splinted) + interaction_efficiency_penalty = 1 + ((interaction_efficiency_penalty - 1) * splinted.splint_factor) + else + interaction_efficiency_penalty = interaction_efficiency_penalty + + if(initial(disabling) && splinted) + disabling = FALSE + else if(initial(disabling)) + disabling = TRUE + + limb.update_wounds() + +/* + BEWARE OF REDUNDANCY AHEAD THAT I MUST PARE DOWN +*/ + +/datum/wound/brute/bone/proc/splint(obj/item/stack/I, mob/user) + if(splinted && splinted.splint_factor >= I.splint_factor) + to_chat(user, "The splint already on [user == victim ? "your" : "[victim]'s"] [limb.name] is better than you can do with [I].") + return + + user.visible_message("[user] begins splinting [victim]'s [limb.name] with [I].", "You begin splinting [user == victim ? "your" : "[victim]'s"] [limb.name] with [I]...") + + if(!do_after(user, base_treat_time * (user == victim ? 1.5 : 1), target = victim, extra_checks=CALLBACK(src, .proc/still_exists))) + return + + user.visible_message("[user] finishes splinting [victim]'s [limb.name]!", "You finish splinting [user == victim ? "your" : "[victim]'s"] [limb.name]!") + treat_priority = FALSE + splinted = new I.type(limb) + splinted.amount = 1 + I.use(1) + update_inefficiencies() + +/* + Moderate (Joint Dislocation) +*/ + +/datum/wound/brute/bone/moderate + name = "Joint Dislocation" + desc = "Patient's bone has been unset from socket, causing pain and reduced motor function." + treat_text = "Recommended application of bonesetter to affected limb, though manual relocation by applying an aggressive grab to the patient and helpfully interacting with afflicted limb may suffice." + examine_desc = "is awkwardly jammed out of place" + occur_text = "jerks violently and becomes unseated" + severity = WOUND_SEVERITY_MODERATE + viable_zones = list(BODY_ZONE_L_ARM, BODY_ZONE_R_ARM, BODY_ZONE_L_LEG, BODY_ZONE_R_LEG) + interaction_efficiency_penalty = 1.5 + limp_slowdown = 3 + threshold_minimum = 35 + threshold_penalty = 15 + treatable_tool = TOOL_BONESET + status_effect_type = /datum/status_effect/wound/bone/moderate + scarring_descriptions = list("light discoloring", "a slight blue tint") + +/datum/wound/brute/bone/moderate/crush() + if(prob(33)) + victim.visible_message("[victim]'s dislocated [limb.name] pops back into place!", "Your dislocated [limb.name] pops back into place! Ow!") + remove_wound() + +/datum/wound/brute/bone/moderate/try_handling(mob/living/carbon/human/user) + if(user.pulling != victim || user.zone_selected != limb.body_zone || user.a_intent == INTENT_GRAB) + return FALSE + + if(user.grab_state == GRAB_PASSIVE) + to_chat(user, "You must have [victim] in an aggressive grab to manipulate [victim.p_their()] [lowertext(name)]!") + return TRUE + + if(user.grab_state >= GRAB_AGGRESSIVE) + user.visible_message("[user] begins twisting and straining [victim]'s dislocated [limb.name]!", "You begin twisting and straining [victim]'s dislocated [limb.name]...", ignored_mobs=victim) + to_chat(victim, "[user] begins twisting and straining your dislocated [limb.name]!") + if(user.a_intent == INTENT_HELP) + chiropractice(user) + else + malpractice(user) + return TRUE + +/// If someone is snapping our dislocated joint back into place by hand with an aggro grab and help intent +/datum/wound/brute/bone/moderate/proc/chiropractice(mob/living/carbon/human/user) + var/time = base_treat_time + + if(!do_after(user, time, target=victim, extra_checks = CALLBACK(src, .proc/still_exists))) + return + + if(prob(65)) + user.visible_message("[user] snaps [victim]'s dislocated [limb.name] back into place!", "You snap [victim]'s dislocated [limb.name] back into place!", ignored_mobs=victim) + to_chat(victim, "[user] snaps your dislocated [limb.name] back into place!") + victim.emote("scream") + limb.receive_damage(brute=20, wound_bonus=CANT_WOUND) + qdel(src) + else + user.visible_message("[user] wrenches [victim]'s dislocated [limb.name] around painfully!", "You wrench [victim]'s dislocated [limb.name] around painfully!", ignored_mobs=victim) + to_chat(victim, "[user] wrenches your dislocated [limb.name] around painfully!") + limb.receive_damage(brute=10, wound_bonus=CANT_WOUND) + chiropractice(user) + +/// If someone is snapping our dislocated joint into a fracture by hand with an aggro grab and harm or disarm intent +/datum/wound/brute/bone/moderate/proc/malpractice(mob/living/carbon/human/user) + var/time = base_treat_time + + if(!do_after(user, time, target=victim, extra_checks = CALLBACK(src, .proc/still_exists))) + return + + if(prob(65)) + user.visible_message("[user] snaps [victim]'s dislocated [limb.name] with a sickening crack!", "You snap [victim]'s dislocated [limb.name] with a sickening crack!", ignored_mobs=victim) + to_chat(victim, "[user] snaps your dislocated [limb.name] with a sickening crack!") + victim.emote("scream") + limb.receive_damage(brute=25, wound_bonus=30) + else + user.visible_message("[user] wrenches [victim]'s dislocated [limb.name] around painfully!", "You wrench [victim]'s dislocated [limb.name] around painfully!", ignored_mobs=victim) + to_chat(victim, "[user] wrenches your dislocated [limb.name] around painfully!") + limb.receive_damage(brute=10, wound_bonus=CANT_WOUND) + malpractice(user) + + +/datum/wound/brute/bone/moderate/treat(obj/item/I, mob/user) + if(victim == user) + victim.visible_message("[user] begins resetting [victim.p_their()] [limb.name] with [I].", "You begin resetting your [limb.name] with [I]...") + else + user.visible_message("[user] begins resetting [victim]'s [limb.name] with [I].", "You begin resetting [victim]'s [limb.name] with [I]...") + + if(!do_after(user, base_treat_time * (user == victim ? 1.5 : 1), target = victim, extra_checks=CALLBACK(src, .proc/still_exists))) + return + + if(victim == user) + limb.receive_damage(brute=15, wound_bonus=CANT_WOUND) + victim.visible_message("[user] finishes resetting [victim.p_their()] [limb.name]!", "You reset your [limb.name]!") + else + limb.receive_damage(brute=10, wound_bonus=CANT_WOUND) + user.visible_message("[user] finishes resetting [victim]'s [limb.name]!", "You finish resetting [victim]'s [limb.name]!", victim) + to_chat(victim, "[user] resets your [limb.name]!") + + victim.emote("scream") + qdel(src) + +/* + Severe (Hairline Fracture) +*/ + +/datum/wound/brute/bone/severe + name = "Hairline Fracture" + desc = "Patient's bone has suffered a crack in the foundation, causing serious pain and reduced limb functionality." + treat_text = "Recommended light surgical application of bone gel, though splinting will prevent worsening situation." + examine_desc = "appears bruised and grotesquely swollen" + + occur_text = "sprays chips of bone and develops a nasty looking bruise" + severity = WOUND_SEVERITY_SEVERE + interaction_efficiency_penalty = 2 + limp_slowdown = 6 + threshold_minimum = 60 + threshold_penalty = 30 + treatable_by = list(/obj/item/stack/sticky_tape/surgical, /obj/item/stack/medical/gauze, /obj/item/stack/medical/bone_gel) + status_effect_type = /datum/status_effect/wound/bone/severe + treat_priority = TRUE + scarring_descriptions = list("a faded, fist-sized bruise", "a vaguely triangular peel scar") + brain_trauma_group = BRAIN_TRAUMA_MILD + trauma_cycle_cooldown = 1.5 MINUTES + chance_internal_bleeding = 40 + +/datum/wound/brute/bone/critical + name = "Compound Fracture" + desc = "Patient's bones have suffered multiple gruesome fractures, causing significant pain and near uselessness of limb." + treat_text = "Immediate binding of affected limb, followed by surgical intervention ASAP." + examine_desc = "has a cracked bone sticking out of it" + occur_text = "cracks apart, exposing broken bones to open air" + severity = WOUND_SEVERITY_CRITICAL + interaction_efficiency_penalty = 4 + limp_slowdown = 9 + sound_effect = 'sound/effects/crack2.ogg' + threshold_minimum = 115 + threshold_penalty = 50 + disabling = TRUE + treatable_by = list(/obj/item/stack/sticky_tape/surgical, /obj/item/stack/medical/gauze, /obj/item/stack/medical/bone_gel) + status_effect_type = /datum/status_effect/wound/bone/critical + treat_priority = TRUE + scarring_descriptions = list("a section of janky skin lines and badly healed scars", "a large patch of uneven skin tone", "a cluster of calluses") + brain_trauma_group = BRAIN_TRAUMA_SEVERE + trauma_cycle_cooldown = 2.5 MINUTES + chance_internal_bleeding = 60 + +// doesn't make much sense for "a" bone to stick out of your head +/datum/wound/brute/bone/critical/apply_wound(obj/item/bodypart/L, silent, datum/wound/old_wound, smited) + if(L.body_zone == BODY_ZONE_HEAD) + occur_text = "splits open, exposing a bare, cracked skull through the flesh and blood" + examine_desc = "has an unsettling indent, with bits of skull poking out" + . = ..() + +/// if someone is using bone gel on our wound +/datum/wound/brute/bone/proc/gel(obj/item/stack/medical/bone_gel/I, mob/user) + if(gelled) + to_chat(user, "[user == victim ? "Your" : "[victim]'s"] [limb.name] is already coated with bone gel!") + return + + user.visible_message("[user] begins hastily applying [I] to [victim]'s' [limb.name]...", "You begin hastily applying [I] to [user == victim ? "your" : "[victim]'s"] [limb.name], disregarding the warning label...") + + if(!do_after(user, base_treat_time * 1.5 * (user == victim ? 1.5 : 1), target = victim, extra_checks=CALLBACK(src, .proc/still_exists))) + return + + I.use(1) + victim.emote("scream") + if(user != victim) + user.visible_message("[user] finishes applying [I] to [victim]'s [limb.name], emitting a fizzing noise!", "You finish applying [I] to [victim]'s [limb.name]!", ignored_mobs=victim) + to_chat(victim, "[user] finishes applying [I] to your [limb.name], and you can feel the bones exploding with pain as they begin melting and reforming!") + else + var/painkiller_bonus = 0 + if(victim.drunkenness) + painkiller_bonus += 5 + if(victim.reagents && victim.reagents.has_reagent(/datum/reagent/medicine/morphine)) + painkiller_bonus += 10 + if(victim.reagents && victim.reagents.has_reagent(/datum/reagent/determination)) + painkiller_bonus += 5 + + if(prob(25 + (20 * severity - 2) - painkiller_bonus)) // 25%/45% chance to fail self-applying with severe and critical wounds, modded by painkillers + victim.visible_message("[victim] fails to finish applying [I] to [victim.p_their()] [limb.name], passing out from the pain!", "You black out from the pain of applying [I] to your [limb.name] before you can finish!") + victim.AdjustUnconscious(5 SECONDS) + return + victim.visible_message("[victim] finishes applying [I] to [victim.p_their()] [limb.name], grimacing from the pain!", "You finish applying [I] to your [limb.name], and your bones explode in pain!") + + limb.receive_damage(30, stamina=100, wound_bonus=CANT_WOUND) + if(!gelled) + gelled = TRUE + +/// if someone is using surgical tape on our wound +/datum/wound/brute/bone/proc/tape(obj/item/stack/sticky_tape/surgical/I, mob/user) + if(!gelled) + to_chat(user, "[user == victim ? "Your" : "[victim]'s"] [limb.name] must be coated with bone gel to perform this emergency operation!") + return + if(taped) + to_chat(user, "[user == victim ? "Your" : "[victim]'s"] [limb.name] is already wrapped in [I.name] and reforming!") + return + + user.visible_message("[user] begins applying [I] to [victim]'s' [limb.name]...", "You begin applying [I] to [user == victim ? "your" : "[victim]'s"] [limb.name]...") + + if(!do_after(user, base_treat_time * (user == victim ? 1.5 : 1), target = victim, extra_checks=CALLBACK(src, .proc/still_exists))) + return + + regen_points_current = 0 + regen_points_needed = 30 SECONDS * (user == victim ? 1.5 : 1) * (severity - 1) + I.use(1) + if(user != victim) + user.visible_message("[user] finishes applying [I] to [victim]'s [limb.name], emitting a fizzing noise!", "You finish applying [I] to [victim]'s [limb.name]!", ignored_mobs=victim) + to_chat(victim, "[user] finishes applying [I] to your [limb.name], you immediately begin to feel your bones start to reform!") + else + victim.visible_message("[victim] finishes applying [I] to [victim.p_their()] [limb.name], !", "You finish applying [I] to your [limb.name], and you immediately begin to feel your bones start to reform!") + + taped = TRUE + processes = TRUE + +/datum/wound/brute/bone/treat(obj/item/I, mob/user) + if(istype(I, /obj/item/stack/medical/bone_gel)) + gel(I, user) + else if(istype(I, /obj/item/stack/sticky_tape/surgical)) + tape(I, user) + else if(istype(I, /obj/item/stack/medical/gauze)) + splint(I, user) + +/datum/wound/brute/bone/get_scanner_description(mob/user) + . = ..() + + . += "
" + + if(!gelled) + . += "Alternative Treatment: Apply bone gel directly to injured limb, then apply surgical tape to begin bone regeneration. This is both excruciatingly painful and slow, and only recommended in dire circumstances.\n" + else if(!taped) + . += "Continue Alternative Treatment: Apply surgical tape directly to injured limb to begin bone regeneration. Note, this is both excruciatingly painful and slow.\n" + else + . += "Note: Bone regeneration in effect. Bone is [round(regen_points_current/regen_points_needed)]% regenerated.\n" + + if(limb.body_zone == BODY_ZONE_HEAD) + . += "Cranial Trauma Detected: Patient will suffer random bouts of [severity == WOUND_SEVERITY_SEVERE ? "mild" : "severe"] brain traumas until bone is repaired." + else if(limb.body_zone == BODY_ZONE_CHEST && victim.blood_volume) + . += "Ribcage Trauma Detected: Further trauma to chest is likely to worsen internal bleeding until bone is repaired." + . += "
" diff --git a/code/datums/wounds/burns.dm b/code/datums/wounds/burns.dm new file mode 100644 index 0000000000..feff9bf4de --- /dev/null +++ b/code/datums/wounds/burns.dm @@ -0,0 +1,323 @@ + + + +// TODO: well, a lot really, but specifically I want to add potential fusing of clothing/equipment on the affected area, and limb infections, though those may go in body part code +/datum/wound/burn + a_or_from = "from" + wound_type = WOUND_LIST_BURN + processes = TRUE + sound_effect = 'sound/effects/sizzle1.ogg' + + treatable_by = list(/obj/item/stack/medical/gauze, /obj/item/stack/medical/ointment, /obj/item/stack/medical/mesh) // sterilizer and alcohol will require reagent treatments, coming soon + + // Flesh damage vars + /// How much damage to our flesh we currently have. Once both this and infestation reach 0, the wound is considered healed + var/flesh_damage = 5 + /// Our current counter for how much flesh regeneration we have stacked from regenerative mesh/synthflesh/whatever, decrements each tick and lowers flesh_damage + var/flesh_healing = 0 + + // Infestation vars (only for severe and critical) + /// How quickly infection breeds on this burn if we don't have disinfectant + var/infestation_rate = 0 + /// Our current level of infection + var/infestation = 0 + /// Our current level of sanitization/anti-infection, from disinfectants/alcohol/UV lights. While positive, totally pauses and slowly reverses infestation effects each tick + var/sanitization = 0 + + /// Once we reach infestation beyond WOUND_INFESTATION_SEPSIS, we get this many warnings before the limb is completely paralyzed (you'd have to ignore a really bad burn for a really long time for this to happen) + var/strikes_to_lose_limb = 3 + + /// The current bandage we have for this wound (maybe move bandages to the limb?) + var/obj/item/stack/current_bandage + +/datum/wound/burn/handle_process() + . = ..() + if(strikes_to_lose_limb == 0) + victim.adjustToxLoss(0.5) + if(prob(1)) + victim.visible_message("The infection on the remnants of [victim]'s [limb.name] shift and bubble nauseatingly!", "You can feel the infection on the remnants of your [limb.name] coursing through your veins!") + return + + if(victim.reagents) + if(victim.reagents.has_reagent(/datum/reagent/medicine/spaceacillin)) + sanitization += 0.9 + if(victim.reagents.has_reagent(/datum/reagent/space_cleaner/sterilizine/)) + sanitization += 0.9 + if(victim.reagents.has_reagent(/datum/reagent/medicine/mine_salve)) + sanitization += 0.3 + flesh_healing += 0.5 + + if(current_bandage) + current_bandage.absorption_capacity -= WOUND_BURN_SANITIZATION_RATE + if(current_bandage.absorption_capacity <= 0) + victim.visible_message("Pus soaks through \the [current_bandage] on [victim]'s [limb.name].", "Pus soaks through \the [current_bandage] on your [limb.name].", vision_distance=COMBAT_MESSAGE_RANGE) + QDEL_NULL(current_bandage) + treat_priority = TRUE + + if(flesh_healing > 0) + var/bandage_factor = (current_bandage ? current_bandage.splint_factor : 1) + flesh_damage = max(0, flesh_damage - 1) + flesh_healing = max(0, flesh_healing - bandage_factor) // good bandages multiply the length of flesh healing + + // here's the check to see if we're cleared up + if((flesh_damage <= 0) && (infestation <= 1)) + to_chat(victim, "The burns on your [limb.name] have cleared up!") + qdel(src) + return + + // sanitization is checked after the clearing check but before the rest, because we freeze the effects of infection while we have sanitization + if(sanitization > 0) + var/bandage_factor = (current_bandage ? current_bandage.splint_factor : 1) + infestation = max(0, infestation - WOUND_BURN_SANITIZATION_RATE) + sanitization = max(0, sanitization - (WOUND_BURN_SANITIZATION_RATE * bandage_factor)) + return + + infestation += infestation_rate + + switch(infestation) + if(0 to WOUND_INFECTION_MODERATE) + if(WOUND_INFECTION_MODERATE to WOUND_INFECTION_SEVERE) + if(prob(30)) + victim.adjustToxLoss(0.2) + if(prob(6)) + to_chat(victim, "The blisters on your [limb.name] ooze a strange pus...") + if(WOUND_INFECTION_SEVERE to WOUND_INFECTION_CRITICAL) + if(!disabling && prob(2)) + to_chat(victim, "Your [limb.name] completely locks up, as you struggle for control against the infection!") + disabling = TRUE + else if(disabling && prob(8)) + to_chat(victim, "You regain sensation in your [limb.name], but it's still in terrible shape!") + disabling = FALSE + else if(prob(20)) + victim.adjustToxLoss(0.5) + if(WOUND_INFECTION_CRITICAL to WOUND_INFECTION_SEPTIC) + if(!disabling && prob(3)) + to_chat(victim, "You suddenly lose all sensation of the festering infection in your [limb.name]!") + disabling = TRUE + else if(disabling && prob(3)) + to_chat(victim, "You can barely feel your [limb.name] again, and you have to strain to retain motor control!") + disabling = FALSE + else if(prob(1)) + to_chat(victim, "You contemplate life without your [limb.name]...") + victim.adjustToxLoss(0.75) + else if(prob(4)) + victim.adjustToxLoss(1) + if(WOUND_INFECTION_SEPTIC to INFINITY) + if(prob(infestation)) + switch(strikes_to_lose_limb) + if(3 to INFINITY) + to_chat(victim, "The skin on your [limb.name] is literally dripping off, you feel awful!") + if(2) + to_chat(victim, "The infection in your [limb.name] is literally dripping off, you feel horrible!") + if(1) + to_chat(victim, "Infection has just about completely claimed your [limb.name]!") + if(0) + to_chat(victim, "The last of the nerve endings in your [limb.name] wither away, as the infection completely paralyzes your joint connector.") + threshold_penalty = 120 // piss easy to destroy + var/datum/brain_trauma/severe/paralysis/sepsis = new (limb.body_zone) + victim.gain_trauma(sepsis) + strikes_to_lose_limb-- + +/datum/wound/burn/get_examine_description(mob/user) + if(strikes_to_lose_limb <= 0) + return "[victim.p_their(TRUE)] [limb.name] is completely dead and unrecognizable as organic." + + var/condition = "" + if(current_bandage) + var/bandage_condition + switch(current_bandage.absorption_capacity) + if(0 to 1.25) + bandage_condition = "nearly ruined " + if(1.25 to 2.75) + bandage_condition = "badly worn " + if(2.75 to 4) + bandage_condition = "slightly pus-stained " + if(4 to INFINITY) + bandage_condition = "clean " + + condition += " underneath a dressing of [bandage_condition] [current_bandage.name]" + else + switch(infestation) + if(WOUND_INFECTION_MODERATE to WOUND_INFECTION_SEVERE) + condition += ", with small spots of discoloration along the nearby veins!" + if(WOUND_INFECTION_SEVERE to WOUND_INFECTION_CRITICAL) + condition += ", with dark clouds spreading outwards under the skin!" + if(WOUND_INFECTION_CRITICAL to WOUND_INFECTION_SEPTIC) + condition += ", with streaks of rotten infection pulsating outward!" + if(WOUND_INFECTION_SEPTIC to INFINITY) + return "[victim.p_their(TRUE)] [limb.name] is a mess of char and rot, skin literally dripping off the bone with infection!" + else + condition += "!" + + return "[victim.p_their(TRUE)] [limb.name] [examine_desc][condition]" + +/datum/wound/burn/get_scanner_description(mob/user) + if(strikes_to_lose_limb == 0) + var/oopsie = "Type: [name]\nSeverity: [severity_text()]" + oopsie += "
Infection Level: The infection is total. The bodypart is lost. Amputate or augment limb immediately.
" + return oopsie + + . = ..() + . += "
" + + if(infestation <= sanitization && flesh_damage <= flesh_healing) + . += "No further treatment required: Burns will heal shortly." + else + switch(infestation) + if(WOUND_INFECTION_MODERATE to WOUND_INFECTION_SEVERE) + . += "Infection Level: Moderate\n" + if(WOUND_INFECTION_SEVERE to WOUND_INFECTION_CRITICAL) + . += "Infection Level: Severe\n" + if(WOUND_INFECTION_CRITICAL to WOUND_INFECTION_SEPTIC) + . += "Infection Level: CRITICAL\n" + if(WOUND_INFECTION_SEPTIC to INFINITY) + . += "Infection Level: LOSS IMMINENT\n" + if(infestation > sanitization) + . += "\tSurgical debridement, antiobiotics/sterilizers, or regenerative mesh will rid infection. Paramedic UV penlights are also effective.\n" + + if(flesh_damage > 0) + . += "Flesh damage detected: Please apply ointment or regenerative mesh to allow recovery.\n" + . += "
" + +/* + new burn common procs +*/ + +/// if someone is using ointment on our burns +/datum/wound/burn/proc/ointment(obj/item/stack/medical/ointment/I, mob/user) + user.visible_message("[user] begins applying [I] to [victim]'s [limb.name]...", "You begin applying [I] to [user == victim ? "your" : "[victim]'s"] [limb.name]...") + if(!do_after(user, (user == victim ? I.self_delay : I.other_delay), extra_checks = CALLBACK(src, .proc/still_exists))) + return + + limb.heal_damage(I.heal_brute, I.heal_burn) + user.visible_message("[user] applies [I] to [victim].", "You apply [I] to [user == victim ? "your" : "[victim]'s"] [limb.name].") + I.use(1) + sanitization += I.sanitization + flesh_healing += I.flesh_regeneration + + if((infestation <= 0 || sanitization >= infestation) && (flesh_damage <= 0 || flesh_healing > flesh_damage)) + to_chat(user, "You've done all you can with [I], now you must wait for the flesh on [victim]'s [limb.name] to recover.") + else + try_treating(I, user) + +/// for use in the burn dressing surgery since we don't want to make them do another do_after obviously +/datum/wound/burn/proc/force_bandage(obj/item/stack/medical/gauze/I, mob/user) + QDEL_NULL(current_bandage) + current_bandage = new I.type(limb) + current_bandage.amount = 1 + treat_priority = FALSE + sanitization += I.sanitization + I.use(1) + +/// if someone is wrapping gauze on our burns +/datum/wound/burn/proc/bandage(obj/item/stack/medical/gauze/I, mob/user) + if(current_bandage) + if(current_bandage.absorption_capacity > I.absorption_capacity + 1) + to_chat(user, "The [current_bandage] on [victim]'s [limb.name] is still in better condition than your [I.name]!") + return + user.visible_message("[user] begins to redress the burns on [victim]'s [limb.name] with [I]...", "You begin redressing the burns on [user == victim ? "your" : "[victim]'s"] [limb.name] with [I]...") + else + user.visible_message("[user] begins to dress the burns on [victim]'s [limb.name] with [I]...", "You begin dressing the burns on [user == victim ? "your" : "[victim]'s"] [limb.name] with [I]...") + + if(!do_after(user, (user == victim ? I.self_delay : I.other_delay), target=victim, extra_checks = CALLBACK(src, .proc/still_exists))) + return + + user.visible_message("[user] applies [I] to [victim].", "You apply [I] to [user == victim ? "your" : "[victim]'s"] [limb.name].") + QDEL_NULL(current_bandage) + current_bandage = new I.type(limb) + current_bandage.amount = 1 + treat_priority = FALSE + sanitization += I.sanitization + I.use(1) + +/// if someone is using mesh on our burns +/datum/wound/burn/proc/mesh(obj/item/stack/medical/mesh/I, mob/user) + user.visible_message("[user] begins wrapping [victim]'s [limb.name] with [I]...", "You begin wrapping [user == victim ? "your" : "[victim]'s"] [limb.name] with [I]...") + if(!do_after(user, (user == victim ? I.self_delay : I.other_delay), target=victim, extra_checks = CALLBACK(src, .proc/still_exists))) + return + + limb.heal_damage(I.heal_brute, I.heal_burn) + user.visible_message("[user] applies [I] to [victim].", "You apply [I] to [user == victim ? "your" : "[victim]'s"] [limb.name].") + I.use(1) + sanitization += I.sanitization + flesh_healing += I.flesh_regeneration + + if(sanitization >= infestation && flesh_healing > flesh_damage) + to_chat(user, "You've done all you can with [I], now you must wait for the flesh on [victim]'s [limb.name] to recover.") + else + try_treating(I, user) + +/// Paramedic UV penlights +/datum/wound/burn/proc/uv(obj/item/flashlight/pen/paramedic/I, mob/user) + if(I.uv_cooldown > world.time) + to_chat(user, "[I] is still recharging!") + return + if(infestation <= 0 || infestation < sanitization) + to_chat(user, "There's no infection to treat on [victim]'s [limb.name]!") + return + + user.visible_message("[user] flashes the burns on [victim]'s [limb] with [I].", "You flash the burns on [user == victim ? "your" : "[victim]'s"] [limb.name] with [I].", vision_distance=COMBAT_MESSAGE_RANGE) + sanitization += I.uv_power + I.uv_cooldown = world.time + I.uv_cooldown_length + +/datum/wound/burn/treat(obj/item/I, mob/user) + if(istype(I, /obj/item/stack/medical/gauze)) + bandage(I, user) + else if(istype(I, /obj/item/stack/medical/ointment)) + ointment(I, user) + else if(istype(I, /obj/item/stack/medical/mesh)) + mesh(I, user) + else if(istype(I, /obj/item/flashlight/pen/paramedic)) + uv(I, user) + +/// basic support for instabitaluri/synthflesh healing flesh damage, more chem support in the future +/datum/wound/burn/proc/regenerate_flesh(amount) + flesh_healing += amount * 0.5 // 20u patch will heal 10 flesh standard + +// we don't even care about first degree burns, straight to second +/datum/wound/burn/moderate + name = "Second Degree Burns" + desc = "Patient is suffering considerable burns with mild skin penetration, weakening limb integrity and increased burning sensations." + treat_text = "Recommended application of topical ointment or regenerative mesh to affected region." + examine_desc = "is badly burned and breaking out in blisters" + occur_text = "breaks out with violent red burns" + severity = WOUND_SEVERITY_MODERATE + damage_mulitplier_penalty = 1.1 + threshold_minimum = 40 + threshold_penalty = 30 // burns cause significant decrease in limb integrity compared to other wounds + status_effect_type = /datum/status_effect/wound/burn/moderate + flesh_damage = 5 + scarring_descriptions = list("small amoeba-shaped skinmarks", "a faded streak of depressed skin") + +/datum/wound/burn/severe + name = "Third Degree Burns" + desc = "Patient is suffering extreme burns with full skin penetration, creating serious risk of infection and greatly reduced limb integrity." + treat_text = "Recommended immediate disinfection and excision of any infected skin, followed by bandaging and ointment." + examine_desc = "appears seriously charred, with aggressive red splotches" + occur_text = "chars rapidly, exposing ruined tissue and spreading angry red burns" + severity = WOUND_SEVERITY_SEVERE + damage_mulitplier_penalty = 1.2 + threshold_minimum = 80 + threshold_penalty = 40 + status_effect_type = /datum/status_effect/wound/burn/severe + treatable_by = list(/obj/item/flashlight/pen/paramedic, /obj/item/stack/medical/gauze, /obj/item/stack/medical/ointment, /obj/item/stack/medical/mesh) + infestation_rate = 0.05 // appx 13 minutes to reach sepsis without any treatment + flesh_damage = 12.5 + scarring_descriptions = list("a large, jagged patch of faded skin", "random spots of shiny, smooth skin", "spots of taut, leathery skin") + +/datum/wound/burn/critical + name = "Catastrophic Burns" + desc = "Patient is suffering near complete loss of tissue and significantly charred muscle and bone, creating life-threatening risk of infection and negligible limb integrity." + treat_text = "Immediate surgical debriding of any infected skin, followed by potent tissue regeneration formula and bandaging." + examine_desc = "is a ruined mess of blanched bone, melted fat, and charred tissue" + occur_text = "vaporizes as flesh, bone, and fat melt together in a horrifying mess" + severity = WOUND_SEVERITY_CRITICAL + damage_mulitplier_penalty = 1.3 + sound_effect = 'sound/effects/sizzle2.ogg' + threshold_minimum = 140 + threshold_penalty = 80 + status_effect_type = /datum/status_effect/wound/burn/critical + treatable_by = list(/obj/item/flashlight/pen/paramedic, /obj/item/stack/medical/gauze, /obj/item/stack/medical/ointment, /obj/item/stack/medical/mesh) + infestation_rate = 0.15 // appx 4.33 minutes to reach sepsis without any treatment + flesh_damage = 20 + scarring_descriptions = list("massive, disfiguring keloid scars", "several long streaks of badly discolored and malformed skin", "unmistakeable splotches of dead tissue from serious burns") diff --git a/code/datums/wounds/cuts.dm b/code/datums/wounds/cuts.dm index 5f9d754238..578c8b9ddf 100644 --- a/code/datums/wounds/cuts.dm +++ b/code/datums/wounds/cuts.dm @@ -129,7 +129,7 @@ if(user.pulling != victim || user.zone_selected != limb.body_zone || user.a_intent == INTENT_GRAB) return FALSE - if(!isfelinid(user)) + if(!iscatperson(user)) return FALSE lick_wounds(user) diff --git a/code/game/objects/items/grenades/flashbang.dm b/code/game/objects/items/grenades/flashbang.dm index 16e8046ee2..bd25169fe4 100644 --- a/code/game/objects/items/grenades/flashbang.dm +++ b/code/game/objects/items/grenades/flashbang.dm @@ -62,11 +62,11 @@ /obj/item/grenade/stingbang/breaker name = "breakbang" - shrapnel_type = /obj/projectile/bullet/pellet/stingball/breaker + shrapnel_type = /obj/item/projectile/bullet/pellet/stingball/breaker /obj/item/grenade/stingbang/shred name = "shredbang" - shrapnel_type = /obj/projectile/bullet/pellet/stingball/shred + shrapnel_type = /obj/item/projectile/bullet/pellet/stingball/shred /obj/item/grenade/stingbang/prime(mob/living/lanced_by) if(iscarbon(loc)) diff --git a/code/game/objects/items/shrapnel.dm b/code/game/objects/items/shrapnel.dm index de8bf9459d..b74b0563b7 100644 --- a/code/game/objects/items/shrapnel.dm +++ b/code/game/objects/items/shrapnel.dm @@ -67,13 +67,13 @@ ricochets_max = 6 ricochet_chance = 110 -/obj/projectile/bullet/pellet/stingball/breaker +/obj/item/projectile/bullet/pellet/stingball/breaker name = "breakbang pellet" damage = 10 wound_bonus = 40 sharpness = FALSE -/obj/projectile/bullet/pellet/stingball/shred +/obj/item/projectile/bullet/pellet/stingball/shred name = "shredbang pellet" damage = 10 wound_bonus = 30 diff --git a/code/game/objects/items/stacks/medical.dm b/code/game/objects/items/stacks/medical.dm index 8a0f4fe13a..1e70b4bd80 100644 --- a/code/game/objects/items/stacks/medical.dm +++ b/code/game/objects/items/stacks/medical.dm @@ -120,7 +120,7 @@ gender = PLURAL singular_name = "medical gauze" icon_state = "gauze" - var/heal_brute = 5 + heal_brute = 5 self_delay = 50 other_delay = 20 amount = 6 @@ -241,7 +241,7 @@ heal_burn = 5 flesh_regeneration = 2.5 sanitization = 0.3 - grind_results = list(/datum/reagent/medicine/C2/lenturi = 10) + grind_results = list(/datum/reagent/medicine/kelotane = 10) /obj/item/stack/medical/ointment/heal(mob/living/M, mob/user) if(M.stat == DEAD) @@ -336,7 +336,7 @@ amount = 4 self_delay = 20 - grind_results = list(/datum/reagent/medicine/C2/libital = 10) + grind_results = list(/datum/reagent/medicine/bicaridine = 10) novariants = TRUE /obj/item/stack/medical/bone_gel/attack(mob/living/M, mob/user) diff --git a/code/game/objects/items/storage/firstaid.dm b/code/game/objects/items/storage/firstaid.dm index fb1313fc70..0d3d2beb8b 100644 --- a/code/game/objects/items/storage/firstaid.dm +++ b/code/game/objects/items/storage/firstaid.dm @@ -57,8 +57,7 @@ /obj/item/stack/medical/gauze = 1, /obj/item/stack/medical/suture/emergency = 1, /obj/item/stack/medical/ointment = 1, - /obj/item/reagent_containers/hypospray/medipen/ekit = 2, - /obj/item/storage/pill_bottle/iron = 1) + /obj/item/reagent_containers/hypospray/medipen/ekit = 2) generate_items_inside(items_inside,src) /obj/item/storage/firstaid/ancient diff --git a/code/game/objects/items/tanks/tanks.dm b/code/game/objects/items/tanks/tanks.dm index e69b2b6272..a4cc2af838 100644 --- a/code/game/objects/items/tanks/tanks.dm +++ b/code/game/objects/items/tanks/tanks.dm @@ -143,7 +143,6 @@ if(prob(50)) step(W, pick(GLOB.alldirs)) ADD_TRAIT(H, TRAIT_DISFIGURED, TRAIT_GENERIC) - H.bleed_rate = 5 H.gib_animation() sleep(3) H.adjustBruteLoss(1000) //to make the body super-bloody diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm index 50c58b0ade..c03fd53da3 100644 --- a/code/game/objects/structures/tables_racks.dm +++ b/code/game/objects/structures/tables_racks.dm @@ -541,7 +541,7 @@ change_construction_value(-2) return ..() -/obj/structure/table/reinforced/brass/tablepush(mob/living/user, mob/living/pushed_mob) +/obj/structure/table/reinforced/brass/tablelimbsmash(mob/living/user, mob/living/pushed_mob) .= ..() playsound(src, 'sound/magic/clockwork/fellowship_armory.ogg', 50, TRUE) @@ -565,7 +565,7 @@ buildstack = /obj/item/stack/tile/bronze canSmoothWith = list(/obj/structure/table/reinforced/brass, /obj/structure/table/bronze) -/obj/structure/table/bronze/tablepush(mob/living/user, mob/living/pushed_mob) +/obj/structure/table/bronze/tablelimbsmash(mob/living/user, mob/living/pushed_mob) ..() playsound(src, 'sound/magic/clockwork/fellowship_armory.ogg', 50, TRUE) @@ -594,7 +594,7 @@ computer.table = src break -/obj/structure/table/optable/tablepush(mob/living/user, mob/living/pushed_mob) +/obj/structure/table/optable/tablelimbsmash(mob/living/user, mob/living/pushed_mob) pushed_mob.forceMove(loc) pushed_mob.set_resting(TRUE, TRUE) visible_message("[user] has laid [pushed_mob] on [src].") diff --git a/code/modules/antagonists/bloodsucker/powers/feed.dm b/code/modules/antagonists/bloodsucker/powers/feed.dm index a113f9c083..caca020b32 100644 --- a/code/modules/antagonists/bloodsucker/powers/feed.dm +++ b/code/modules/antagonists/bloodsucker/powers/feed.dm @@ -226,7 +226,9 @@ playsound(get_turf(target), 'sound/effects/splat.ogg', 40, 1) if(ishuman(target)) var/mob/living/carbon/human/H = target - H.bleed_rate += 5 + var/obj/item/bodypart/head_part = H.get_bodypart(BODY_ZONE_HEAD) + if(head_part) + head_part.generic_bleedstacks += 5 target.add_splatter_floor(get_turf(target)) user.add_mob_blood(target) // Put target's blood on us. The donor goes in the ( ) target.add_mob_blood(target) diff --git a/code/modules/antagonists/bloodsucker/powers/recuperate.dm b/code/modules/antagonists/bloodsucker/powers/recuperate.dm index 6b8795ea02..90a2e3ff38 100644 --- a/code/modules/antagonists/bloodsucker/powers/recuperate.dm +++ b/code/modules/antagonists/bloodsucker/powers/recuperate.dm @@ -27,8 +27,9 @@ C.blood_volume -= 0.2 C.adjustStaminaLoss(-15) // Stop Bleeding - if(istype(H) && H.bleed_rate > 0 && rand(20) == 0) - H.bleed_rate -- + if(istype(H) && H.is_bleeding() && rand(20) == 0) + for(var/obj/item/bodypart/part in H.bodyparts) + part.generic_bleedstacks -- C.Jitter(5) sleep(10) // DONE! diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index e08886e71f..e12a8fb1e5 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -227,8 +227,8 @@ /obj/item/clothing/examine(mob/user) . = ..() if(damaged_clothes == CLOTHING_SHREDDED) - . += "It is completely shredded and requires mending before it can be worn again!" - return + . += "It is completely shredded and requires mending before it can be worn again!" + return for(var/zone in damage_by_parts) var/pct_damage_part = damage_by_parts[zone] / limb_integrity * 100 var/zone_name = parse_zone(zone) diff --git a/code/modules/clothing/suits/armor.dm b/code/modules/clothing/suits/armor.dm index 1c753b15df..b61743729f 100644 --- a/code/modules/clothing/suits/armor.dm +++ b/code/modules/clothing/suits/armor.dm @@ -168,7 +168,7 @@ icon_state = "bulletproof" item_state = "armor" blood_overlay_type = "armor" - armor = list("melee" = 15, "bullet" = 60, "laser" = 10, "energy" = 10, "bomb" = 40, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 50 "wound" = 20) + armor = list("melee" = 15, "bullet" = 60, "laser" = 10, "energy" = 10, "bomb" = 40, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 50, "wound" = 20) strip_delay = 70 equip_delay_other = 50 mutantrace_variation = STYLE_DIGITIGRADE|STYLE_NO_ANTHRO_ICON diff --git a/code/modules/mob/dead/new_player/new_player.dm b/code/modules/mob/dead/new_player/new_player.dm index 323df097b2..49a3bffd42 100644 --- a/code/modules/mob/dead/new_player/new_player.dm +++ b/code/modules/mob/dead/new_player/new_player.dm @@ -569,7 +569,7 @@ client.prefs.scars_list["[cur_scar_index]"] = valid_scars client.prefs.save_character() - client.prefs.copy_to(H, antagonist = is_antag) + client.prefs.copy_to(H) H.dna.update_dna_identity() if(mind) if(transfer_after) diff --git a/code/modules/mob/living/blood.dm b/code/modules/mob/living/blood.dm index ee0b58f766..478599e2c0 100644 --- a/code/modules/mob/living/blood.dm +++ b/code/modules/mob/living/blood.dm @@ -7,12 +7,7 @@ /mob/living/carbon/monkey/handle_blood() if(bodytemperature <= TCRYO || (HAS_TRAIT(src, TRAIT_HUSK))) //cryosleep or husked people do not pump the blood. - var/temp_bleed = 0 - for(var/X in bodyparts) - var/obj/item/bodypart/BP = X - temp_bleed += BP.get_bleed_rate() - BP.generic_bleedstacks = max(0, BP.generic_bleedstacks - 1) - bleed(temp_bleed) + return var/temp_bleed = 0 for(var/X in bodyparts) @@ -29,7 +24,7 @@ /mob/living/carbon/human/proc/resume_bleeding() bleedsuppress = 0 - if(stat != DEAD && bleed_rate) + if(stat != DEAD && is_bleeding()) to_chat(src, "The blood soaks through your bandage.") @@ -47,16 +42,10 @@ if(NOBLOOD in dna.species.species_traits || bleedsuppress || (HAS_TRAIT(src, TRAIT_FAKEDEATH))) return - if(bleed_rate < 0) - bleed_rate = 0 - - if(HAS_TRAIT(src, TRAIT_NOMARROW)) //Bloodsuckers don't need to be here. - return - - if(bodytemperature >= TCRYO && !(HAS_TRAIT(src, TRAIT_NOCLONE))) //cryosleep or husked people do not pump the blood. + if(bodytemperature >= TCRYO && !(HAS_TRAIT(src, TRAIT_HUSK))) //cryosleep or husked people do not pump the blood. //Blood regeneration if there is some space - if(blood_volume < (BLOOD_VOLUME_NORMAL * blood_ratio) && !HAS_TRAIT(src, TRAIT_NOHUNGER)) + if(blood_volume < BLOOD_VOLUME_NORMAL && !HAS_TRAIT(src, TRAIT_NOHUNGER)) var/nutrition_ratio = 0 switch(nutrition) if(0 to NUTRITION_LEVEL_STARVING) @@ -69,22 +58,27 @@ nutrition_ratio = 0.8 else nutrition_ratio = 1 - if(HAS_TRAIT(src, TRAIT_HIGH_BLOOD)) - nutrition_ratio *= 1.2 if(satiety > 80) nutrition_ratio *= 1.25 adjust_nutrition(-nutrition_ratio * HUNGER_FACTOR) - blood_volume = min((BLOOD_VOLUME_NORMAL * blood_ratio), blood_volume + 0.5 * nutrition_ratio) + blood_volume = min(BLOOD_VOLUME_NORMAL, blood_volume + 0.5 * nutrition_ratio) //Effects of bloodloss var/word = pick("dizzy","woozy","faint") - switch(blood_volume * INVERSE(blood_ratio)) + switch(blood_volume) + if(BLOOD_VOLUME_EXCESS to BLOOD_VOLUME_MAX_LETHAL) + if(prob(15)) + to_chat(src, "Blood starts to tear your skin apart. You're going to burst!") + gib() + if(BLOOD_VOLUME_MAXIMUM to BLOOD_VOLUME_EXCESS) + if(prob(10)) + to_chat(src, "You feel terribly bloated.") if(BLOOD_VOLUME_OKAY to BLOOD_VOLUME_SAFE) if(prob(5)) to_chat(src, "You feel [word].") - adjustOxyLoss(round(((BLOOD_VOLUME_NORMAL * blood_ratio) - blood_volume) * 0.01, 1)) + adjustOxyLoss(round((BLOOD_VOLUME_NORMAL - blood_volume) * 0.01, 1)) if(BLOOD_VOLUME_BAD to BLOOD_VOLUME_OKAY) - adjustOxyLoss(round(((BLOOD_VOLUME_NORMAL * blood_ratio) - blood_volume) * 0.02, 1)) + adjustOxyLoss(round((BLOOD_VOLUME_NORMAL - blood_volume) * 0.02, 1)) if(prob(5)) blur_eyes(6) to_chat(src, "You feel very [word].") diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 62c78fe007..d3cfa71d9a 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -174,7 +174,6 @@ if(IS_STAMCRIT(src)) to_chat(src, "You're too exhausted.") return - var/random_turn = a_intent == INTENT_HARM //END OF CIT CHANGES var/obj/item/I = get_active_held_item() diff --git a/code/modules/mob/living/carbon/carbon_defense.dm b/code/modules/mob/living/carbon/carbon_defense.dm index ea42c4df2f..4aac8af0ac 100644 --- a/code/modules/mob/living/carbon/carbon_defense.dm +++ b/code/modules/mob/living/carbon/carbon_defense.dm @@ -133,8 +133,8 @@ return TRUE for(var/datum/wound/W in all_wounds) - if(W.try_handling(user)) - return 1 + if(W.try_handling(user)) + return 1 /mob/living/carbon/attack_paw(mob/living/carbon/monkey/M) diff --git a/code/modules/mob/living/carbon/damage_procs.dm b/code/modules/mob/living/carbon/damage_procs.dm index 61b14b2cce..ddf1019f2a 100644 --- a/code/modules/mob/living/carbon/damage_procs.dm +++ b/code/modules/mob/living/carbon/damage_procs.dm @@ -207,7 +207,7 @@ if(!parts.len) return var/obj/item/bodypart/picked = pick(parts) - if(picked.receive_damage(brute, burn, stamina,check_armor ? run_armor_check(picked, (brute ? "melee" : burn ? "fire" : stamina ? "bullet" : null)) : FALSE, wound_bonus = wound_bonus, bare_wound_bonus = bare_wound_bonus, sharpness = sharpness)) + if(picked.receive_damage(brute, burn, stamina,check_armor ? run_armor_check(picked, (brute ? "melee" : burn ? "fire" : stamina ? "bullet" : null)) : FALSE, wound_bonus = wound_bonus, bare_wound_bonus = bare_wound_bonus, sharpness = sharpness)) update_damage_overlays() //Heal MANY bodyparts, in random order @@ -235,12 +235,12 @@ update_damage_overlays() update_stamina() //CIT CHANGE - makes sure update_stamina() always gets called after a health update -// damage MANY bodyparts, in random order -/mob/living/carbon/take_overall_damage(brute = 0, burn = 0, stamina = 0, updating_health = TRUE) +/// damage MANY bodyparts, in random order +/mob/living/carbon/take_overall_damage(brute = 0, burn = 0, stamina = 0, updating_health = TRUE, required_status) if(status_flags & GODMODE) return //godmode - var/list/obj/item/bodypart/parts = get_damageable_bodyparts() + var/list/obj/item/bodypart/parts = get_damageable_bodyparts(required_status) var/update = 0 while(parts.len && (brute > 0 || burn > 0 || stamina > 0)) var/obj/item/bodypart/picked = pick(parts) diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm index c592301b96..714932af80 100644 --- a/code/modules/mob/living/carbon/human/human_defense.dm +++ b/code/modules/mob/living/carbon/human/human_defense.dm @@ -640,7 +640,7 @@ msg = "\t Your [LB.name] is suffering [W.a_or_from] [lowertext(W.name)]!" if(WOUND_SEVERITY_CRITICAL) msg = "\t Your [LB.name] is suffering [W.a_or_from] [lowertext(W.name)]!!" - to_chat(src, msg) + to_chat(src, msg) for(var/obj/item/I in LB.embedded_objects) if(I.isEmbedHarmless()) diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index dbf7b7f350..0eff65fda3 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -123,6 +123,9 @@ var/list/progressbars = null //for stacking do_after bars + ///For storing what do_after's someone has, in case we want to restrict them to only one of a certain do_after at a time + var/list/do_afters + var/list/mousemove_intercept_objects var/datum/click_intercept diff --git a/code/modules/projectiles/ammunition/ballistic/shotgun.dm b/code/modules/projectiles/ammunition/ballistic/shotgun.dm index db2914e620..b6fdef69e2 100644 --- a/code/modules/projectiles/ammunition/ballistic/shotgun.dm +++ b/code/modules/projectiles/ammunition/ballistic/shotgun.dm @@ -12,13 +12,13 @@ obj/item/ammo_casing/shotgun/executioner name = "executioner slug" desc = "A 12 gauge lead slug purpose built to annihilate flesh on impact." icon_state = "stunshell" - projectile_type = /obj/projectile/bullet/shotgun_slug/executioner + projectile_type = /obj/item/projectile/bullet/shotgun_slug/executioner /obj/item/ammo_casing/shotgun/pulverizer name = "pulverizer slug" desc = "A 12 gauge lead slug purpose built to annihilate bones on impact." icon_state = "stunshell" - projectile_type = /obj/projectile/bullet/shotgun_slug/pulverizer + projectile_type = /obj/item/projectile/bullet/shotgun_slug/pulverizer /obj/item/ammo_casing/shotgun/beanbag name = "beanbag slug" diff --git a/code/modules/projectiles/ammunition/energy/laser.dm b/code/modules/projectiles/ammunition/energy/laser.dm index 5c19edc012..05c47fc3bb 100644 --- a/code/modules/projectiles/ammunition/energy/laser.dm +++ b/code/modules/projectiles/ammunition/energy/laser.dm @@ -38,7 +38,7 @@ fire_sound = 'sound/weapons/lasercannonfire.ogg' /obj/item/ammo_casing/energy/laser/hellfire - projectile_type = /obj/projectile/beam/laser/hellfire + projectile_type = /obj/item/projectile/beam/laser/hellfire e_cost = 130 select_name = "maim" diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm index 69e3991e39..221bd8a112 100644 --- a/code/modules/projectiles/projectile.dm +++ b/code/modules/projectiles/projectile.dm @@ -156,7 +156,7 @@ wound_bonus = CANT_WOUND /// For telling whether we want to roll for bone breaking or lacerations if we're bothering with wounds - var/sharpness = FALSE + sharpness = FALSE /obj/item/projectile/Initialize() . = ..() diff --git a/code/modules/projectiles/projectile/beams.dm b/code/modules/projectiles/projectile/beams.dm index 7147754211..4ba72a1935 100644 --- a/code/modules/projectiles/projectile/beams.dm +++ b/code/modules/projectiles/projectile/beams.dm @@ -25,13 +25,12 @@ bare_wound_bonus = 40 //overclocked laser, does a bit more damage but has much higher wound power (-0 vs -20) -/obj/projectile/beam/laser/hellfire +/obj/item/projectile/beam/laser/hellfire name = "hellfire laser" wound_bonus = 0 damage = 25 - speed = 0.6 // higher power = faster, that's how light works right -/obj/projectile/beam/laser/hellfire/Initialize() +/obj/item/projectile/beam/laser/hellfire/Initialize() . = ..() transform *= 2 diff --git a/code/modules/projectiles/projectile/bullets/shotgun.dm b/code/modules/projectiles/projectile/bullets/shotgun.dm index b268877451..6e4a72aff0 100644 --- a/code/modules/projectiles/projectile/bullets/shotgun.dm +++ b/code/modules/projectiles/projectile/bullets/shotgun.dm @@ -2,12 +2,12 @@ name = "12g shotgun slug" damage = 60 -/obj/projectile/bullet/shotgun_slug/executioner +/obj/item/projectile/bullet/shotgun_slug/executioner name = "executioner slug" // admin only, can dismember limbs sharpness = TRUE wound_bonus = 0 -/obj/projectile/bullet/shotgun_slug/pulverizer +/obj/item/projectile/bullet/shotgun_slug/pulverizer name = "pulverizer slug" // admin only, can crush bones sharpness = FALSE wound_bonus = 0 diff --git a/code/modules/surgery/bodyparts/parts.dm b/code/modules/surgery/bodyparts/parts.dm index bd4abaa765..1a7289b8cc 100644 --- a/code/modules/surgery/bodyparts/parts.dm +++ b/code/modules/surgery/bodyparts/parts.dm @@ -66,8 +66,6 @@ max_stamina_damage = 50 body_zone = BODY_ZONE_L_ARM body_part = ARM_LEFT - aux_zone = BODY_ZONE_PRECISE_L_HAND - aux_layer = HANDS_PART_LAYER body_damage_coeff = 0.75 held_index = 1 px_x = -6 @@ -131,8 +129,6 @@ max_damage = 50 body_zone = BODY_ZONE_R_ARM body_part = ARM_RIGHT - aux_zone = BODY_ZONE_PRECISE_R_HAND - aux_layer = HANDS_PART_LAYER body_damage_coeff = 0.75 held_index = 2 px_x = 6 diff --git a/code/modules/surgery/bone_mending.dm b/code/modules/surgery/bone_mending.dm index 6afe494105..81d9fa8d97 100644 --- a/code/modules/surgery/bone_mending.dm +++ b/code/modules/surgery/bone_mending.dm @@ -39,7 +39,6 @@ name = "repair hairline fracture (bonesetter/bone gel/tape)" implements = list(/obj/item/bonesetter = 100, /obj/item/stack/medical/bone_gel = 100, /obj/item/stack/sticky_tape/surgical = 100, /obj/item/stack/sticky_tape/super = 50, /obj/item/stack/sticky_tape = 30) time = 40 - experience_given = MEDICAL_SKILL_MEDIUM /datum/surgery_step/repair_bone_hairline/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) if(surgery.operated_wound) @@ -76,7 +75,6 @@ name = "reset bone" implements = list(/obj/item/bonesetter = 100, /obj/item/stack/sticky_tape/surgical = 60, /obj/item/stack/sticky_tape/super = 40, /obj/item/stack/sticky_tape = 20) time = 40 - experience_given = MEDICAL_SKILL_MEDIUM /datum/surgery_step/reset_compound_fracture/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) if(surgery.operated_wound) @@ -111,7 +109,6 @@ name = "repair compound fracture (bone gel/tape)" implements = list(/obj/item/stack/medical/bone_gel = 100, /obj/item/stack/sticky_tape/surgical = 100, /obj/item/stack/sticky_tape/super = 50, /obj/item/stack/sticky_tape = 30) time = 40 - experience_given = MEDICAL_SKILL_MEDIUM /datum/surgery_step/repair_bone_compound/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) if(surgery.operated_wound) diff --git a/code/modules/surgery/burn_dressing.dm b/code/modules/surgery/burn_dressing.dm index 1d64d29ff6..1688f7b5d1 100644 --- a/code/modules/surgery/burn_dressing.dm +++ b/code/modules/surgery/burn_dressing.dm @@ -24,7 +24,6 @@ implements = list(TOOL_HEMOSTAT = 100, TOOL_SCALPEL = 85, TOOL_SAW = 60, TOOL_WIRECUTTER = 40) time = 30 repeatable = TRUE - experience_given = MEDICAL_SKILL_MEDIUM /datum/surgery_step/debride/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) if(surgery.operated_wound) @@ -76,7 +75,6 @@ name = "bandage burns" implements = list(/obj/item/stack/medical/gauze = 100, /obj/item/stack/sticky_tape/surgical = 100) time = 40 - experience_given = MEDICAL_SKILL_MEDIUM /datum/surgery_step/dress/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) var/datum/wound/burn/burn_wound = surgery.operated_wound diff --git a/code/modules/vending/_vending.dm b/code/modules/vending/_vending.dm index 2a8e8763a2..64bc225d1f 100644 --- a/code/modules/vending/_vending.dm +++ b/code/modules/vending/_vending.dm @@ -547,7 +547,7 @@ GLOBAL_LIST_EMPTY(vending_products) qdel(O) new /obj/effect/gibspawner/human/bodypartless(get_turf(C)) - if(prob(30)) + if(prob(30)) C.apply_damage(max(0, squish_damage - crit_rebate), forced=TRUE, spread_damage=TRUE) // the 30% chance to spread the damage means you escape breaking any bones else C.take_bodypart_damage((squish_damage - crit_rebate)*0.5, wound_bonus = 5) // otherwise, deal it to 2 random limbs (or the same one) which will likely shatter something diff --git a/tgstation.dme b/tgstation.dme index dd57ad97a2..cc592a50cc 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -655,6 +655,8 @@ #include "code\datums\wires\vending.dm" #include "code\datums\wounds\_scars.dm" #include "code\datums\wounds\_wounds.dm" +#include "code\datums\wounds\bones.dm" +#include "code\datums\wounds\burns.dm" #include "code\datums\wounds\cuts.dm" #include "code\game\alternate_appearance.dm" #include "code\game\atoms.dm"