Projectiles with armour penetration or have the PASSSTRUCTURE|PASSVEHICLE pass_flag can pass through into mech cockpits, hitting the pilot. (#91063)

## About The Pull Request

Projectiles that have armour penetration can potentially pass through
the cockpit of a mech, and hit the pilot. The possibility of this
happening is a probability roll equal to the projectiles
``armour_penetration`` - the mechs relevant armor flag. BULLET for
ballistics, LASER for lasers, ENERGY for energy projectiles.

If the projectile can just pass through structures (like x-ray lasers
and Penetrator .50BMG), then the bullet ALWAYS go straight into the
pilot.

## Why It's Good For The Game

Dealing with mechs is dealing with a huge bag of mech integrity
(effectively a second lot of health). While AP can usually help with
armor stacked mechs, they often have relatively lower damage to
counterbalance this upside. This is usually fine for using AP weaponry
against humans, but a little less so for when you're trying to race a
mech to 0.

As an alternative way in which AP can interact with mechs, they now have
the ability to hit straight into the pilot if they overshoot the mechs
armor. The pilot is usually weaker than the mech (usually), and wounding
them is almost always as beneficial as damaging the mech.

If the mech's armor is still able to absorb part of the damage, this
still usually ends up being a positive outcome for the shooter since
they've dealt a relatively higher amount of damage than most projectiles
to the mech itself.

This also gives x-ray lasers, which are usually pretty terrible at
killing mechs except Phazons (specifically because they can shoot into
the wall the phazon is phasing through), a novel approach to tackling
mechs; killing the pilot inside the shell.
This commit is contained in:
necromanceranne
2025-05-29 14:46:40 -05:00
committed by GitHub
parent 7d45017609
commit dedc2ef010
+7 -3
View File
@@ -115,13 +115,17 @@
return ..()
/obj/vehicle/sealed/mecha/bullet_act(obj/projectile/hitting_projectile, def_zone, piercing_hit) //wrapper
//allows bullets to hit the pilot of open-canopy mechs
if(!(mecha_flags & IS_ENCLOSED) \
// Determine our potential to shoot through the mech and into the cockpit, hitting the pilot
var/kill_the_meat = clamp(hitting_projectile.armour_penetration - get_armor_rating(hitting_projectile.armor_flag), 0, 100)
//allows bullets to hit the pilot of open-canopy mechs, or if the bullet penetrates to the pilot, or the bullet can pass through structures
if((!(mecha_flags & IS_ENCLOSED) || kill_the_meat && prob(kill_the_meat) && !(mecha_flags & CANNOT_OVERPENETRATE) || hitting_projectile.pass_flags & (PASSSTRUCTURE|PASSVEHICLE)) \
&& LAZYLEN(occupants) \
&& !(mecha_flags & SILICON_PILOT) \
&& (def_zone == BODY_ZONE_HEAD || def_zone == BODY_ZONE_CHEST))
var/mob/living/hitmob = pick(occupants)
return hitmob.projectile_hit(hitting_projectile, def_zone, piercing_hit) //If the sides are open, the occupant can be hit
return hitmob.projectile_hit(hitting_projectile, def_zone, piercing_hit) //If we've passed any of the above conditions, the pilot can be hit
. = ..()