Skip to content

Commit

Permalink
Adjusts acid blood splashes. (#544)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Helg2 authored Oct 16, 2024
1 parent a031e41 commit 4cbbc30
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 *** //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
66 changes: 36 additions & 30 deletions code/modules/mob/living/carbon/xenomorph/damage_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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)
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/xenomorph/death.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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 ..()

Expand Down

0 comments on commit 4cbbc30

Please sign in to comment.