diff --git a/code/modules/vehicles/mecha/mecha_defense.dm b/code/modules/vehicles/mecha/mecha_defense.dm index 607cdbb1c33..39419ce47b2 100644 --- a/code/modules/vehicles/mecha/mecha_defense.dm +++ b/code/modules/vehicles/mecha/mecha_defense.dm @@ -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 . = ..()