Skip to content

Commit

Permalink
Fixes behemoth's earth pillar and AoE attacks not damaging vehicles o…
Browse files Browse the repository at this point in the history
…utside of the middle (#16040)
  • Loading branch information
Wisemonster committed Jun 10, 2024
1 parent fe182a9 commit e30e04d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions code/__DEFINES/is_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,8 @@ GLOBAL_VAR_INIT(refid_filter, TYPEID(filter(type="angular_blur")))

#define isarmoredvehicle(A) (istype(A, /obj/vehicle/sealed/armored))

#define ishitbox(A) (istype(A, /obj/hitbox))

#define isorgan(A) (istype(A, /datum/limb))

#define isidcard(A) (istype(A, /obj/item/card/id))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1366,6 +1366,8 @@
if(istype(hit_object, /obj/structure/reagent_dispensers/fueltank))
var/obj/structure/reagent_dispensers/fueltank/hit_tank = hit_object
hit_tank.explode()
if(ishitbox(hit_object) || ismecha(hit_object)) // These don't hit the vehicles, but rather their hitboxes, so isarmored will not work here
return on_hit_anything(get_turf(hit_object), proj)
return rock_broke(get_turf(hit_object), proj)

/datum/ammo/xeno/earth_pillar/on_hit_mob(mob/hit_mob, obj/projectile/proj)
Expand Down Expand Up @@ -1404,7 +1406,7 @@
// ***************************************
// *********** Global Procs
// ***************************************
#define AREA_ATTACK_DAMAGE_VEHICLE_MODIFIER 1.8
#define AREA_ATTACK_DAMAGE_VEHICLE_MODIFIER 0.4

/**
* Checks for any atoms caught in the attack's range, and applies several effects based on the atom's type.
Expand Down Expand Up @@ -1435,7 +1437,7 @@
shake_camera(affected_living, 1, 0.8)
affected_living.Paralyze(paralyze_duration)
affected_living.apply_damage(attack_damage, BRUTE, blocked = MELEE)
else if(isearthpillar(affected_atom) || isvehicle(affected_atom) || istype(affected_atom, /obj/structure/reagent_dispensers/fueltank))
else if(isearthpillar(affected_atom) || isvehicle(affected_atom) || ishitbox(affected_atom) || istype(affected_atom, /obj/structure/reagent_dispensers/fueltank))
affected_atom.do_jitter_animation()
new /obj/effect/temp_visual/behemoth/landslide/hit(affected_atom.loc)
playsound(affected_atom.loc, SFX_BEHEMOTH_EARTH_PILLAR_HIT, 40)
Expand All @@ -1449,11 +1451,11 @@
do_warning(xeno_owner, spread_turfs, wind_up_duration)
addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(behemoth_area_attack), xeno_owner, spread_turfs, enhanced), wind_up_duration)
continue
if(isvehicle(affected_atom))
if(isvehicle(affected_atom) || ishitbox(affected_atom))
var/obj/vehicle/veh_victim = affected_atom
var/damage_add = 0
if(ismecha(veh_victim))
damage_add = 8.2
damage_add = 9.5
veh_victim.take_damage(attack_damage * (AREA_ATTACK_DAMAGE_VEHICLE_MODIFIER + damage_add), MELEE)
continue
if(istype(affected_atom, /obj/structure/reagent_dispensers/fueltank))
Expand Down

0 comments on commit e30e04d

Please sign in to comment.