Fixes most mining mobs being unaffected by additional damage against them (#89682)

## About The Pull Request

#89619 introduced a MOB_MINING biotype which allows us to get rid of
jank that the ismining() macro was. This fixes soulscythes, cursed
katanas, mining bombs, strongarm implants and junk hunter bullets not
getting their buffs against a good chunk of mining fauna.

Closes #89597

## Why It's Good For The Game

You'd expect items explicitly designed against fauna to actually fare
well against it.

## Changelog
🆑
fix: Fixed most mining mobs being unaffected by additional damage
against them
/🆑
This commit is contained in:
SmArtKar
2025-03-08 04:20:17 +01:00
committed by GitHub
parent b05b848549
commit 50ed8cbb52
7 changed files with 11 additions and 13 deletions

View File

@@ -165,9 +165,7 @@ GLOBAL_LIST_INIT(turfs_pass_meteor, typecacheof(list(
#define isanimal_or_basicmob(A) (istype(A, /mob/living/simple_animal) || istype(A, /mob/living/basic)) #define isanimal_or_basicmob(A) (istype(A, /mob/living/simple_animal) || istype(A, /mob/living/basic))
/// asteroid mobs, which are both simple and basic atm /// asteroid mobs, which are both simple and basic atm
#define isminingpath(A) (ispath(A, /mob/living/simple_animal/hostile/asteroid) || ispath(A, /mob/living/basic/mining)) #define ismining(A) (A.mob_biotypes & MOB_MINING)
#define ismining(A) (istype(A, /mob/living/simple_animal/hostile/asteroid) || istype(A, /mob/living/basic/mining))
//Simple animals //Simple animals
#define isanimal(A) (istype(A, /mob/living/simple_animal)) #define isanimal(A) (istype(A, /mob/living/simple_animal))

View File

@@ -217,7 +217,7 @@
user.visible_message(span_warning("[user] shatters [src] over [target]!"), user.visible_message(span_warning("[user] shatters [src] over [target]!"),
span_notice("You shatter [src] over [target]!")) span_notice("You shatter [src] over [target]!"))
to_chat(target, span_userdanger("[user] shatters [src] over you!")) to_chat(target, span_userdanger("[user] shatters [src] over you!"))
target.apply_damage(damage = ishostile(target) ? 75 : 35, wound_bonus = 20) target.apply_damage(damage = ismining(target) ? 75 : 35, wound_bonus = 20)
user.do_attack_animation(target, ATTACK_EFFECT_SMASH) user.do_attack_animation(target, ATTACK_EFFECT_SMASH)
playsound(src, 'sound/effects/glass/glassbr3.ogg', 100, TRUE) playsound(src, 'sound/effects/glass/glassbr3.ogg', 100, TRUE)
shattered = TRUE shattered = TRUE

View File

@@ -334,7 +334,7 @@
var/mob/living/attacked_mob = attacked_atom var/mob/living/attacked_mob = attacked_atom
if(attacked_mob.stat != DEAD) if(attacked_mob.stat != DEAD)
give_blood(15) give_blood(15)
attacked_mob.apply_damage(damage = force * (ishostile(attacked_mob) ? 2 : 1), sharpness = SHARP_EDGED, bare_wound_bonus = 5) attacked_mob.apply_damage(damage = force * (ismining(attacked_mob) ? 2 : 1), sharpness = SHARP_EDGED, bare_wound_bonus = 5)
to_chat(attacked_mob, span_userdanger("You're slashed by [src]!")) to_chat(attacked_mob, span_userdanger("You're slashed by [src]!"))
else if((ismachinery(attacked_atom) || isstructure(attacked_atom)) && use_blood(5)) else if((ismachinery(attacked_atom) || isstructure(attacked_atom)) && use_blood(5))
var/obj/attacked_obj = attacked_atom var/obj/attacked_obj = attacked_atom
@@ -406,8 +406,10 @@
light_color = LIGHT_COLOR_BLOOD_MAGIC light_color = LIGHT_COLOR_BLOOD_MAGIC
/obj/projectile/soulscythe/on_hit(atom/target, blocked = 0, pierce_hit) /obj/projectile/soulscythe/on_hit(atom/target, blocked = 0, pierce_hit)
if(ishostile(target)) if (isliving(target))
damage *= 2 var/mob/living/as_living = target
if (ismining(as_living))
damage *= 2
return ..() return ..()
#undef MAX_BLOOD_LEVEL #undef MAX_BLOOD_LEVEL

View File

@@ -620,7 +620,7 @@
for(var/turf/closed/mineral/rock in circle_range_turfs(src, 2)) for(var/turf/closed/mineral/rock in circle_range_turfs(src, 2))
rock.gets_drilled() rock.gets_drilled()
for(var/mob/living/mob in range(1, src)) for(var/mob/living/mob in range(1, src))
mob.apply_damage(damage * (ishostile(mob) ? fauna_boost : 1), BRUTE, spread_damage = TRUE) mob.apply_damage(damage * (ismining(mob) ? fauna_boost : 1), BRUTE, spread_damage = TRUE)
if(!ishostile(mob) || !firer) if(!ishostile(mob) || !firer)
continue continue
var/mob/living/simple_animal/hostile/hostile_mob = mob var/mob/living/simple_animal/hostile/hostile_mob = mob

View File

@@ -272,10 +272,8 @@
new /obj/effect/temp_visual/explosion/fast(get_turf(target)) new /obj/effect/temp_visual/explosion/fast(get_turf(target))
for(var/mob/living/living_mob in range(1, target) - firer - target) for(var/mob/living/living_mob in range(1, target) - firer - target)
if(!ismining(living_mob))
if(!(living_mob.mob_biotypes & MOB_MINING))
continue continue
var/armor = living_mob.run_armor_check(def_zone, armor_flag, armour_penetration = armour_penetration) var/armor = living_mob.run_armor_check(def_zone, armor_flag, armour_penetration = armour_penetration)
living_mob.apply_damage(damage*aoe_damage_multiplier, damage_type, def_zone, armor) living_mob.apply_damage(damage*aoe_damage_multiplier, damage_type, def_zone, armor)
to_chat(living_mob, span_userdanger("You're struck by a [name]!")) to_chat(living_mob, span_userdanger("You're struck by a [name]!"))

View File

@@ -67,7 +67,7 @@
/obj/projectile/bullet/junk/hunter /obj/projectile/bullet/junk/hunter
name = "junk hunter bullet" name = "junk hunter bullet"
icon_state = "gauss" icon_state = "gauss"
extra_damage_mob_biotypes = MOB_ROBOTIC | MOB_BEAST | MOB_SPECIAL extra_damage_mob_biotypes = MOB_ROBOTIC | MOB_BEAST | MOB_SPECIAL | MOB_MINING
extra_damage_multiplier = 0 extra_damage_multiplier = 0
extra_damage_added_damage = 50 extra_damage_added_damage = 50

View File

@@ -415,7 +415,7 @@
///The amount of damage the implant adds to our unarmed attacks. ///The amount of damage the implant adds to our unarmed attacks.
var/punch_damage = 5 var/punch_damage = 5
///Biotypes we apply an additional amount of damage too ///Biotypes we apply an additional amount of damage too
var/biotype_bonus_targets = MOB_BEAST | MOB_SPECIAL var/biotype_bonus_targets = MOB_BEAST | MOB_SPECIAL | MOB_MINING
///Extra damage dealt to our targeted mobs ///Extra damage dealt to our targeted mobs
var/biotype_bonus_damage = 20 var/biotype_bonus_damage = 20
///IF true, the throw attack will not smash people into walls ///IF true, the throw attack will not smash people into walls