mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-09 16:12:17 +00:00
[MIRROR] barricade breakthrough (#11657)
Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
be4c2baee2
commit
26bb8c46a9
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user