diff --git a/code/__DEFINES/wounds.dm b/code/__DEFINES/wounds.dm index 0d49159ad94..8469dfc058a 100644 --- a/code/__DEFINES/wounds.dm +++ b/code/__DEFINES/wounds.dm @@ -164,3 +164,6 @@ GLOBAL_LIST_INIT(global_all_wound_types, list(/datum/wound/blunt/critical, /datu /// How often can we annoy the player about their bleeding? This duration is extended if it's not serious bleeding #define BLEEDING_MESSAGE_BASE_CD 10 SECONDS + +/// Skeletons and other BIO_ONLY_BONE creatures respond much better to bone gel and can have severe and critical bone wounds healed by bone gel alone. The duration it takes to heal is also multiplied by this, lucky them! +#define WOUND_BONE_BIO_BONE_GEL_MULT 0.25 diff --git a/code/datums/status_effects/wound_effects.dm b/code/datums/status_effects/wound_effects.dm index 07fd641114f..01cd7a3da62 100644 --- a/code/datums/status_effects/wound_effects.dm +++ b/code/datums/status_effects/wound_effects.dm @@ -27,7 +27,7 @@ /datum/status_effect/limp id = "limp" status_type = STATUS_EFFECT_REPLACE - tick_interval = 10 + tick_interval = 0 alert_type = /atom/movable/screen/alert/status_effect/limp var/msg_stage = 0//so you dont get the most intense messages immediately /// The left leg of the limping person @@ -40,6 +40,10 @@ var/slowdown_left = 0 /// How many deciseconds we limp for on the right leg var/slowdown_right = 0 + /// The chance we limp with the left leg each step it takes + var/limp_chance_left = 0 + /// The chance we limp with the right leg each step it takes + var/limp_chance_right = 0 /datum/status_effect/limp/on_apply() if(!iscarbon(owner)) @@ -64,14 +68,17 @@ if(!owner.client || owner.body_position == LYING_DOWN || !owner.has_gravity() || (owner.movement_type & FLYING) || forced || owner.buckled) return + // less limping while we have determination still - var/determined_mod = owner.has_status_effect(STATUS_EFFECT_DETERMINED) ? 0.25 : 1 + var/determined_mod = owner.has_status_effect(STATUS_EFFECT_DETERMINED) ? 0.5 : 1 if(next_leg == left) - owner.client.move_delay += slowdown_left * determined_mod + if(prob(limp_chance_left * determined_mod)) + owner.client.move_delay += slowdown_left * determined_mod next_leg = right else - owner.client.move_delay += slowdown_right * determined_mod + if(prob(limp_chance_right * determined_mod)) + owner.client.move_delay += slowdown_right * determined_mod next_leg = left /datum/status_effect/limp/proc/update_limp() @@ -87,16 +94,21 @@ slowdown_left = 0 slowdown_right = 0 + limp_chance_left = 0 + limp_chance_right = 0 + // technically you can have multiple wounds causing limps on the same limb, even if practically only bone wounds cause it in normal gameplay if(left) for(var/thing in left.wounds) var/datum/wound/W = thing slowdown_left += W.limp_slowdown + limp_chance_left = max(limp_chance_left, W.limp_chance) if(right) for(var/thing in right.wounds) var/datum/wound/W = thing slowdown_right += W.limp_slowdown + limp_chance_right = max(limp_chance_right, W.limp_chance) // this handles losing your leg with the limp and the other one being in good shape as well if(!slowdown_left && !slowdown_right) diff --git a/code/datums/wounds/_wounds.dm b/code/datums/wounds/_wounds.dm index d2aa5d82f87..46a7ba2e0fa 100644 --- a/code/datums/wounds/_wounds.dm +++ b/code/datums/wounds/_wounds.dm @@ -58,6 +58,8 @@ var/damage_mulitplier_penalty = 1 /// If set and this wound is applied to a leg, we take this many deciseconds extra per step on this leg var/limp_slowdown + /// If this wound has a limp_slowdown and is applied to a leg, it has this chance to limp each step + var/limp_chance /// How much we're contributing to this limb's bleed_rate var/blood_flow diff --git a/code/datums/wounds/bones.dm b/code/datums/wounds/bones.dm index e47dd497016..5cbe1f553f2 100644 --- a/code/datums/wounds/bones.dm +++ b/code/datums/wounds/bones.dm @@ -12,10 +12,10 @@ wound_type = WOUND_BLUNT wound_flags = (BONE_WOUND | ACCEPTS_GAUZE) - /// Have we been taped? - var/taped /// Have we been bone gel'd? var/gelled + /// Have we been taped? + var/taped /// If we did the gel + surgical tape healing method for fractures, how many ticks does it take to heal by default var/regen_ticks_needed /// Our current counter for gel + surgical tape regeneration @@ -56,6 +56,7 @@ /datum/wound/blunt/remove_wound(ignore_limb, replaced) limp_slowdown = 0 + limp_chance = 0 QDEL_NULL(active_trauma) if(limb) UnregisterSignal(limb, list(COMSIG_BODYPART_GAUZED, COMSIG_BODYPART_GAUZE_DESTROYED)) @@ -72,17 +73,18 @@ 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(!gelled || !taped) + var/is_bone_creature = victim.get_biological_state() == BIO_JUST_BONE + if(!gelled || (!taped && !is_bone_creature)) return regen_ticks_current++ if(victim.body_position == LYING_DOWN) if(DT_PROB(30, delta_time)) - regen_ticks_current += 0.5 + regen_ticks_current += 1 if(victim.IsSleeping() && DT_PROB(30, delta_time)) - regen_ticks_current += 0.5 + regen_ticks_current += 1 - if(DT_PROB(severity * 1.5, delta_time)) + if(!is_bone_creature && DT_PROB(severity * 1.5, delta_time)) victim.take_bodypart_damage(rand(1, severity * 2), stamina=rand(2, severity * 2.5), wound_bonus=CANT_WOUND) if(prob(33)) to_chat(victim, span_danger("You feel a sharp pain in your body as your bones are reforming!")) @@ -91,7 +93,7 @@ if(!victim || !limb) qdel(src) return - to_chat(victim, span_green("Your [limb.name] has recovered from your fracture!")) + to_chat(victim, span_green("Your [limb.name] has recovered from its [name]!")) remove_wound() /// If we're a human who's punching something with a broken arm, we might hurt ourselves doing so @@ -179,17 +181,20 @@ /datum/wound/blunt/proc/update_inefficiencies() SIGNAL_HANDLER + if(limb.body_zone in list(BODY_ZONE_L_LEG, BODY_ZONE_R_LEG)) - if(limb.current_gauze) + if(limb.current_gauze?.splint_factor) limp_slowdown = initial(limp_slowdown) * limb.current_gauze.splint_factor + limp_chance = initial(limp_chance) * limb.current_gauze.splint_factor else limp_slowdown = initial(limp_slowdown) + limp_chance = initial(limp_chance) victim.apply_status_effect(STATUS_EFFECT_LIMP) else if(limb.body_zone in list(BODY_ZONE_L_ARM, BODY_ZONE_R_ARM)) - if(limb.current_gauze) + if(limb.current_gauze?.splint_factor) interaction_efficiency_penalty = 1 + ((interaction_efficiency_penalty - 1) * limb.current_gauze.splint_factor) else - interaction_efficiency_penalty = interaction_efficiency_penalty + interaction_efficiency_penalty = initial(interaction_efficiency_penalty) if(initial(disabling)) set_disabling(!limb.current_gauze) @@ -201,12 +206,13 @@ 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" + examine_desc = "is awkwardly janked out of place" + occur_text = "janks 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 + interaction_efficiency_penalty = 1.3 limp_slowdown = 3 + limp_chance = 50 threshold_minimum = 35 threshold_penalty = 15 treatable_tool = TOOL_BONESET @@ -226,7 +232,7 @@ /// Getting smushed in an airlock/firelock is a last-ditch attempt to try relocating your limb /datum/wound/blunt/moderate/proc/door_crush() SIGNAL_HANDLER - if(prob(33)) + if(prob(40)) victim.visible_message(span_danger("[victim]'s dislocated [limb.name] pops back into place!"), span_userdanger("Your dislocated [limb.name] pops back into place! Ow!")) remove_wound() @@ -313,12 +319,13 @@ 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 a sling of medical gauze will prevent worsening situation." - examine_desc = "appears grotesquely swollen, its attachment weakened" + examine_desc = "appears grotesquely swollen, jagged bumps hinting at chips in the bone" occur_text = "sprays chips of bone and develops a nasty looking bruise" severity = WOUND_SEVERITY_SEVERE interaction_efficiency_penalty = 2 limp_slowdown = 6 + limp_chance = 60 threshold_minimum = 60 threshold_penalty = 30 treatable_by = list(/obj/item/stack/sticky_tape/surgical, /obj/item/stack/medical/bone_gel) @@ -335,12 +342,13 @@ 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 = "is mangled and pulped, seemingly held together by tissue alone" + examine_desc = "is thoroughly pulped and cracked, exposing shards of bone to open air" occur_text = "cracks apart, exposing broken bones to open air" severity = WOUND_SEVERITY_CRITICAL - interaction_efficiency_penalty = 4 - limp_slowdown = 9 + interaction_efficiency_penalty = 2.5 + limp_slowdown = 7 + limp_chance = 70 sound_effect = 'sound/effects/wounds/crack2.ogg' threshold_minimum = 115 threshold_penalty = 50 @@ -363,6 +371,11 @@ /// if someone is using bone gel on our wound /datum/wound/blunt/proc/gel(obj/item/stack/medical/bone_gel/I, mob/user) + // skellies get treated nicer with bone gel since their "reattach dismembered limbs by hand" ability sucks when it's still critically wounded + if(victim.get_biological_state() == BIO_JUST_BONE) + skelly_gel(I, user) + return + if(gelled) to_chat(user, span_warning("[user == victim ? "Your" : "[victim]'s"] [limb.name] is already coated with bone gel!")) return @@ -386,7 +399,7 @@ if(victim.reagents.has_reagent(/datum/reagent/determination)) painkiller_bonus += 10 if(victim.reagents.has_reagent(/datum/reagent/consumable/ethanol/painkiller)) - painkiller_bonus += 5 + painkiller_bonus += 15 if(victim.reagents.has_reagent(/datum/reagent/medicine/mine_salve)) painkiller_bonus += 20 @@ -397,8 +410,31 @@ victim.visible_message(span_notice("[victim] finishes applying [I] to [victim.p_their()] [limb.name], grimacing from the pain!"), span_notice("You finish applying [I] to your [limb.name], and your bones explode in pain!")) limb.receive_damage(25, stamina=100, wound_bonus=CANT_WOUND) - if(!gelled) - gelled = TRUE + gelled = TRUE + +/// skellies are less averse to bone gel, since they're literally all bone +/datum/wound/blunt/proc/skelly_gel(obj/item/stack/medical/bone_gel/I, mob/user) + if(victim.get_biological_state() != BIO_JUST_BONE) + return // poser + + if(gelled) + to_chat(user, span_warning("[user == victim ? "Your" : "[victim]'s"] [limb.name] is already coated with bone gel!")) + return + + user.visible_message(span_danger("[user] begins applying [I] to [victim]'s' [limb.name]..."), span_warning("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 + + I.use(1) + if(user != victim) + user.visible_message(span_notice("[user] finishes applying [I] to [victim]'s [limb.name], emitting a fizzing noise!"), span_notice("You finish applying [I] to [victim]'s [limb.name]!"), ignored_mobs=victim) + to_chat(victim, span_userdanger("[user] finishes applying [I] to your [limb.name], and you feel a funny fizzy tickling as they begin to reform!")) + else + victim.visible_message(span_notice("[victim] finishes applying [I] to [victim.p_their()] [limb.name], emitting a funny fizzing sound!"), span_notice("You finish applying [I] to your [limb.name], and feel a funny fizzy tickling as the bone begins to reform!")) + + gelled = TRUE + processes = TRUE /// if someone is using surgical tape on our wound /datum/wound/blunt/proc/tape(obj/item/stack/sticky_tape/surgical/I, mob/user) @@ -438,12 +474,19 @@ . += "