From 26bb8c46a9b0b42c899a2af02464273a6ef84446 Mon Sep 17 00:00:00 2001 From: CHOMPStation2StaffMirrorBot <94713762+CHOMPStation2StaffMirrorBot@users.noreply.github.com> Date: Sun, 14 Sep 2025 20:38:41 -0700 Subject: [PATCH] [MIRROR] barricade breakthrough (#11657) Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com> --- code/game/objects/structures/barricades.dm | 35 +++++++++++++++------- code/modules/ai/ai_holder_combat.dm | 9 +++++- 2 files changed, 32 insertions(+), 12 deletions(-) diff --git a/code/game/objects/structures/barricades.dm b/code/game/objects/structures/barricades.dm index dff366af44..11947a6402 100644 --- a/code/game/objects/structures/barricades.dm +++ b/code/game/objects/structures/barricades.dm @@ -26,6 +26,19 @@ /obj/structure/barricade/get_material() return material +/obj/structure/barricade/bullet_act(obj/item/projectile/P, def_zone) + . = ..() + var/barricade_damage = P.get_structure_damage() + if(!barricade_damage) + return + if(barricade_damage > 30) + var/base_multiplier = P.damage_type == BURN ? 0.5 : 0.25 + health -= barricade_damage * base_multiplier + else + var/base_multiplier = P.damage_type == BURN ? 0.25 : 0.1 + health -= barricade_damage * base_multiplier + CheckHealth() + /obj/structure/barricade/attackby(obj/item/W as obj, mob/user as mob) user.setClickCooldown(user.get_attack_speed(W)) if(istype(W, /obj/item/stack)) @@ -43,18 +56,18 @@ visible_message(span_notice("[user] repairs \the [src].")) return return + + switch(W.damtype) + if(BURN) + health -= W.force * 1 + if(BRUTE) + health -= W.force * 0.75 + if(material == (get_material_by_name(MAT_WOOD) || get_material_by_name(MAT_SIFWOOD))) + playsound(src, 'sound/effects/woodcutting.ogg', 100, 1) else - switch(W.damtype) - if(BURN) - health -= W.force * 1 - if(BRUTE) - health -= W.force * 0.75 - if(material == (get_material_by_name(MAT_WOOD) || get_material_by_name(MAT_SIFWOOD))) - playsound(src, 'sound/effects/woodcutting.ogg', 100, 1) - else - playsound(src, 'sound/weapons/smash.ogg', 50, 1) - CheckHealth() - ..() + playsound(src, 'sound/weapons/smash.ogg', 50, 1) + CheckHealth() + ..() /obj/structure/barricade/proc/CheckHealth() if(health <= 0) diff --git a/code/modules/ai/ai_holder_combat.dm b/code/modules/ai/ai_holder_combat.dm index cd3f6109e9..664b7cbda8 100644 --- a/code/modules/ai/ai_holder_combat.dm +++ b/code/modules/ai/ai_holder_combat.dm @@ -292,7 +292,14 @@ // Kill common obstacle in the way like tables. var/obj/structure/obstacle = locate(/obj/structure, problem_turf) - if(istype(obstacle, /obj/structure/window) || istype(obstacle, /obj/structure/closet) || istype(obstacle, /obj/structure/table) || istype(obstacle, /obj/structure/grille)) + var/list/common_obstacles = list(/obj/structure/window, + /obj/structure/closet, + /obj/structure/table, + /obj/structure/grille, + /obj/structure/barricade, + /obj/structure/girder, + ) + if(is_type_in_list(obstacle, common_obstacles)) ai_log("destroy_surroundings() : Attacking generic structure.", AI_LOG_INFO) return melee_attack(obstacle)