From cc90f0c6ce24620b5c9fbd41ef1ab284d10a00c4 Mon Sep 17 00:00:00 2001 From: Warfan1815 Date: Thu, 5 Dec 2024 20:01:32 +0000 Subject: [PATCH] Limb fracturing, visible message fix, turbulence occurrence fix, etc --- code/__DEFINES/__game.dm | 3 +++ code/modules/shuttle/shuttle_airlock.dm | 2 +- code/modules/shuttle/shuttles/dropship.dm | 31 +++++++++++++++-------- 3 files changed, 24 insertions(+), 12 deletions(-) diff --git a/code/__DEFINES/__game.dm b/code/__DEFINES/__game.dm index a738f3025b..dd8366567a 100644 --- a/code/__DEFINES/__game.dm +++ b/code/__DEFINES/__game.dm @@ -233,6 +233,9 @@ #define DROPSHIP_TURBULENCE_START_PERIOD 10 SECONDS #define DROPSHIP_TURBULENCE_PERIOD 5 SECONDS #define DROPSHIP_TURBULENCE_THROWFORCE_MULTIPLIER 4 +#define DROPSHIP_TURBULENCE_GRIPLOSS_PROBABILITY 25 // performed every move +#define DROPSHIP_TURBULENCE_PROBABILITY 50 +#define DROPSHIP_TURBULENCE_BONEBREAK_PROBABILITY 10 //================================================= #define HOSTILE_STANCE_IDLE 1 diff --git a/code/modules/shuttle/shuttle_airlock.dm b/code/modules/shuttle/shuttle_airlock.dm index 631f76d7d1..812e724dc3 100644 --- a/code/modules/shuttle/shuttle_airlock.dm +++ b/code/modules/shuttle/shuttle_airlock.dm @@ -315,7 +315,7 @@ Airlock Appearance Effects plane = -7 /obj/effect/hangar_airlock/height_mask/dropship - layer = 5 + layer = 5.01 alpha = 0 plane = -6 diff --git a/code/modules/shuttle/shuttles/dropship.dm b/code/modules/shuttle/shuttles/dropship.dm index 353f44cb18..301ab3e955 100644 --- a/code/modules/shuttle/shuttles/dropship.dm +++ b/code/modules/shuttle/shuttles/dropship.dm @@ -299,10 +299,14 @@ shake_camera(affected_mob, 6 SECONDS, 1) shake_camera(affected_mob, 16 SECONDS, 1) if(!affected_mob.buckled) - affected_mob.apply_effect(16, WEAKEN) + affected_mob.KnockDown(16) affected_mob.throw_random_direction(2, spin = TRUE) - affected_mob.apply_armoured_damage(60, ARMOR_MELEE, BRUTE, rand_zone()) + affected_mob.apply_armoured_damage(80, ARMOR_MELEE, BRUTE, rand_zone()) affected_mob.visible_message(SPAN_DANGER("[affected_mob] loses their grip on the floor, flying violenty upwards!"), SPAN_DANGER("You lose your grip on the floor, flying violenty upwards!")) + if(prob(DROPSHIP_TURBULENCE_BONEBREAK_PROBABILITY * 2) && istype(affected_mob, /mob/living/carbon/human)) + var/mob/living/carbon/human/affected_human = affected_mob + var/obj/limb/fracturing_limb = affected_human.get_limb(pick(ALL_LIMBS)) + fracturing_limb.fracture(100) for(var/obj/item/affected_item in affected_items) affected_item.visible_message(SPAN_DANGER("[affected_item] goes flying upwards!")) @@ -313,6 +317,11 @@ /obj/docking_port/mobile/marine_dropship/proc/turbulence() if(!in_flight()) return + var/flight_time_left = timeLeft(1) + if(flight_time_left >= DROPSHIP_TURBULENCE_PERIOD*2) + addtimer(CALLBACK(src, TYPE_PROC_REF(/obj/docking_port/mobile/marine_dropship, turbulence)), (rand(DROPSHIP_TURBULENCE_PERIOD, min((flight_time_left/2), DROPSHIP_TURBULENCE_PERIOD)))) + if(!prob(DROPSHIP_TURBULENCE_PROBABILITY)) + return // this prevents atoms from being called more than once as the proc works it way through the turfs (some may be thrown onto a turf that hasn't been called yet) var/list/affected_mobs = list() @@ -325,12 +334,16 @@ affected_items += I for(var/mob/living/affected_mob in affected_mobs) - affected_mob.visible_message(SPAN_DANGER("The dropship jolts violently!")) + to_chat(affected_mob, SPAN_DANGER("The dropship jolts violently!")) shake_camera(affected_mob, DROPSHIP_TURBULENCE_PERIOD, 1) - if(!affected_mob.buckled && prob(25)) - affected_mob.visible_message(SPAN_DANGER("You lose your grip!")) - affected_mob.apply_armoured_damage(25, ARMOR_MELEE, BRUTE, rand_zone()) - affected_mob.apply_effect(DROPSHIP_TURBULENCE_PERIOD, WEAKEN) + if(!affected_mob.buckled && affected_mob.m_intent == MOVE_INTENT_RUN && prob(DROPSHIP_TURBULENCE_GRIPLOSS_PROBABILITY)) + to_chat(affected_mob, SPAN_DANGER("You lose your grip!")) + affected_mob.apply_armoured_damage(50, ARMOR_MELEE, BRUTE, rand_zone()) + affected_mob.KnockDown(DROPSHIP_TURBULENCE_PERIOD * 0.1) + if(prob(DROPSHIP_TURBULENCE_BONEBREAK_PROBABILITY) && istype(affected_mob, /mob/living/carbon/human)) + var/mob/living/carbon/human/affected_human = affected_mob + var/obj/limb/fracturing_limb = affected_human.get_limb(pick(ALL_LIMBS)) + fracturing_limb.fracture(100) for(var/obj/item/affected_item in affected_items) affected_item.visible_message(SPAN_DANGER("[affected_item] goes flying upwards!")) @@ -338,10 +351,6 @@ affected_item.throw_random_direction(2, spin = TRUE) affected_item.throwforce /= DROPSHIP_TURBULENCE_THROWFORCE_MULTIPLIER - var/flight_time_left = timeLeft(1) - if(flight_time_left >= DROPSHIP_TURBULENCE_PERIOD*2) - addtimer(CALLBACK(src, TYPE_PROC_REF(/obj/docking_port/mobile/marine_dropship, turbulence)), (rand(DROPSHIP_TURBULENCE_PERIOD, (flight_time_left/2)))) - /obj/docking_port/stationary/marine_dropship dir = NORTH width = 11