From 4cbbc3062733c96500117a60e44de2c07f0c4cca Mon Sep 17 00:00:00 2001 From: Helg2 <93882977+Helg2@users.noreply.github.com> Date: Wed, 16 Oct 2024 06:46:09 +0300 Subject: [PATCH] Adjusts acid blood splashes. (#544) * Update damage_procs.dm * Update death.dm * no minion acid blood * Update damage_procs.dm * Update damage_procs.dm * Update damage_procs.dm * Update damage_procs.dm --- .../castes/beetle/castedatum_beetle.dm | 2 +- .../facehugger/castedatum_facehugger.dm | 2 +- .../castes/mantis/castedatum_mantis.dm | 2 +- .../living/carbon/xenomorph/damage_procs.dm | 66 ++++++++++--------- .../mob/living/carbon/xenomorph/death.dm | 2 +- 5 files changed, 40 insertions(+), 34 deletions(-) diff --git a/code/modules/mob/living/carbon/xenomorph/castes/beetle/castedatum_beetle.dm b/code/modules/mob/living/carbon/xenomorph/castes/beetle/castedatum_beetle.dm index 75f5a90da3b..929a991f986 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/beetle/castedatum_beetle.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/beetle/castedatum_beetle.dm @@ -24,7 +24,7 @@ max_health = 250 // *** Flags *** // - caste_flags = CASTE_DO_NOT_ALERT_LOW_LIFE|CASTE_IS_A_MINION|CASTE_ACID_BLOOD + caste_flags = CASTE_DO_NOT_ALERT_LOW_LIFE|CASTE_IS_A_MINION can_flags = CASTE_CAN_BE_QUEEN_HEALED|CASTE_CAN_BE_GIVEN_PLASMA|CASTE_CAN_RIDE_CRUSHER caste_traits = null diff --git a/code/modules/mob/living/carbon/xenomorph/castes/facehugger/castedatum_facehugger.dm b/code/modules/mob/living/carbon/xenomorph/castes/facehugger/castedatum_facehugger.dm index fcc0870f6a0..ba050d9e3b2 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/facehugger/castedatum_facehugger.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/facehugger/castedatum_facehugger.dm @@ -25,7 +25,7 @@ crit_health = -25 // *** Flags *** // - caste_flags = CASTE_NOT_IN_BIOSCAN|CASTE_DO_NOT_ANNOUNCE_DEATH|CASTE_DO_NOT_ALERT_LOW_LIFE|CASTE_ACID_BLOOD + caste_flags = CASTE_NOT_IN_BIOSCAN|CASTE_DO_NOT_ANNOUNCE_DEATH|CASTE_DO_NOT_ALERT_LOW_LIFE caste_traits = list(TRAIT_CAN_VENTCRAWL, TRAIT_SILENT_FOOTSTEPS) // *** Defense *** // diff --git a/code/modules/mob/living/carbon/xenomorph/castes/mantis/castedatum_mantis.dm b/code/modules/mob/living/carbon/xenomorph/castes/mantis/castedatum_mantis.dm index 90f2bd519f2..721f7f68cb8 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/mantis/castedatum_mantis.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/mantis/castedatum_mantis.dm @@ -24,7 +24,7 @@ max_health = 150 // *** Flags *** // - caste_flags = CASTE_DO_NOT_ALERT_LOW_LIFE|CASTE_IS_A_MINION|CASTE_ACID_BLOOD + caste_flags = CASTE_DO_NOT_ALERT_LOW_LIFE|CASTE_IS_A_MINION can_flags = CASTE_CAN_BE_QUEEN_HEALED|CASTE_CAN_BE_GIVEN_PLASMA|CASTE_CAN_RIDE_CRUSHER caste_traits = null diff --git a/code/modules/mob/living/carbon/xenomorph/damage_procs.dm b/code/modules/mob/living/carbon/xenomorph/damage_procs.dm index 80a2c6a28f3..b569f6ff62f 100644 --- a/code/modules/mob/living/carbon/xenomorph/damage_procs.dm +++ b/code/modules/mob/living/carbon/xenomorph/damage_procs.dm @@ -67,10 +67,10 @@ damage = modify_by_armor(damage, blocked, penetration, def_zone) if(!damage) //no damage - return 0 + return FALSE if(damage > 12) //Light damage won't splash. - check_blood_splash(damage, damagetype, 0, 1, sharp, edge) + check_blood_splash(damage, damagetype, 0, sharp, edge) SEND_SIGNAL(src, COMSIG_XENOMORPH_TAKING_DAMAGE, damage) @@ -154,39 +154,45 @@ #undef HANDLE_OVERHEAL -/mob/living/carbon/xenomorph/proc/check_blood_splash(damage = 0, damtype = BRUTE, chancemod = 0, radius = 1, sharp = FALSE, edge = FALSE) +///Splashes living mob in 1 tile radius with acid, spawns +/mob/living/carbon/xenomorph/proc/check_blood_splash(damage = 0, damtype = BRUTE, chancemod = 0, sharp = FALSE, edge = FALSE) if(!damage) return FALSE + + if(damtype == BURN) //no splash from burn wounds + return FALSE + + if(!(xeno_caste.caste_flags & CASTE_ACID_BLOOD)) + return FALSE + + if(!isturf(loc)) + return FALSE + var/chance = 25 //base chance - if(damtype == BRUTE) - chance += 5 if(sharp) chancemod += 10 if(edge) //Pierce weapons give the most bonus - chancemod += 12 + chancemod += 15 + if(stat == DEAD) // pressure in dead body is lower than usual + chancemod * 0.5 chance += chancemod + (damage * 0.33) - var/turf/T = loc - if(!T || !istype(T)) - return + if(!prob(chance)) + return FALSE + + var/obj/effect/decal/cleanable/blood/xeno/decal = locate(/obj/effect/decal/cleanable/blood/xeno) in loc + if(!decal) //Let's not stack blood, it just makes lags. + add_splatter_floor(loc) //Drop some on the ground first. + else if(decal.random_icon_states) //If there's already one, just randomize it so it changes. + decal.icon_state = pick(decal.random_icon_states) - if(radius > 1 || prob(chance)) - - var/obj/effect/decal/cleanable/blood/xeno/decal = locate(/obj/effect/decal/cleanable/blood/xeno) in T - - if(!decal) //Let's not stack blood, it just makes lagggggs. - add_splatter_floor(T) //Drop some on the ground first. - else - if(decal.random_icon_states && length(decal.random_icon_states) > 0) //If there's already one, just randomize it so it changes. - decal.icon_state = pick(decal.random_icon_states) - - if(!(xeno_caste.caste_flags & CASTE_ACID_BLOOD)) - return - var/splash_chance - for(var/mob/living/carbon/human/victim in range(radius,src)) //Loop through all nearby victims, including the tile. - splash_chance = (chance * 2) - (get_dist(src,victim) * 20) - if(prob(splash_chance)) - victim.visible_message(span_danger("\The [victim] is scalded with hissing green blood!"), \ - span_danger("You are splattered with sizzling blood! IT BURNS!")) - if(victim.stat == CONSCIOUS && !(victim.species.species_flags & NO_PAIN)) - victim.emote("scream") - victim.take_overall_damage(rand(5, 15), BURN, ACID, updating_health = TRUE) + for(var/mob/living/carbon/human/victim in range(1, src)) //Loop through all nearby victims, including the tile. + if(!Adjacent(victim)) + continue + + if(!prob((chance * 2) - 20)) + continue + victim.visible_message(span_danger("\The [victim] is scalded with hissing green blood!"), \ + span_danger("You are splattered with sizzling blood! IT BURNS!")) + if(victim.stat == CONSCIOUS && !(victim.species.species_flags & NO_PAIN)) + victim.emote("scream") + victim.take_overall_damage(rand(5, 15), BURN, ACID, updating_health = TRUE) diff --git a/code/modules/mob/living/carbon/xenomorph/death.dm b/code/modules/mob/living/carbon/xenomorph/death.dm index 3318f1b5799..43723038ea9 100644 --- a/code/modules/mob/living/carbon/xenomorph/death.dm +++ b/code/modules/mob/living/carbon/xenomorph/death.dm @@ -97,7 +97,7 @@ remains.icon = effects_icon remains.icon_state = xeno_caste.gib_anim - check_blood_splash(35, BURN, 65, 2) + check_blood_splash(50, BRUTE, 50) return ..()