mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-23 21:12:24 +01:00
Fixes some atom health bugs (#22312)
## About PR - Fixes #22260 - Fixes #22304 - Fixes #22234 Additionally changes some health values for: - Canisters, `50` -> `100`. Takes 5 crowbar hits to break instead of 3, these shouldn't break so easily - Railings, `30` -> `75`. 3 crowbars instead of 1 - Reinforced girders, `600` -> `300`. Still takes a lot of crowbars before breaking, barebone girders shouldn't compete reinforced walls
This commit is contained in:
@@ -11,6 +11,8 @@
|
||||
var/obj/held_obj
|
||||
var/open = FALSE
|
||||
var/destroyed = FALSE
|
||||
hitsound = 'sound/effects/glass_hit.ogg'
|
||||
destroy_sound = SFX_BREAK_GLASS
|
||||
var/spawn_contained_type
|
||||
|
||||
/obj/structure/displaycase/Initialize(mapload)
|
||||
@@ -23,15 +25,14 @@
|
||||
/obj/structure/displaycase/ex_act(severity)
|
||||
switch(severity)
|
||||
if (1)
|
||||
do_destroy()
|
||||
on_death()
|
||||
if (2)
|
||||
if(prob(50))
|
||||
health -= 15
|
||||
health_check()
|
||||
on_death()
|
||||
else
|
||||
add_damage(rand(20, 50))
|
||||
if (3)
|
||||
if(prob(50))
|
||||
health -= 5
|
||||
health_check()
|
||||
add_damage(rand(10, 40))
|
||||
|
||||
|
||||
/obj/structure/displaycase/bullet_act(obj/projectile/hitting_projectile, def_zone, piercing_hit)
|
||||
@@ -39,21 +40,15 @@
|
||||
if(. != BULLET_ACT_HIT)
|
||||
return .
|
||||
|
||||
health -= hitting_projectile.get_structure_damage()
|
||||
health_check()
|
||||
var/damage = hitting_projectile.damage
|
||||
if(damage)
|
||||
add_damage(damage)
|
||||
|
||||
/obj/structure/displaycase/proc/health_check()
|
||||
if(health <= 0)
|
||||
do_destroy()
|
||||
else
|
||||
playsound(loc, 'sound/effects/glass_hit.ogg', 75, 1)
|
||||
|
||||
/obj/structure/displaycase/proc/do_destroy()
|
||||
/obj/structure/displaycase/on_death()
|
||||
if(!destroyed)
|
||||
density = FALSE
|
||||
destroyed = TRUE
|
||||
new /obj/item/material/shard(loc)
|
||||
playsound(src, SFX_BREAK_GLASS, 70, 1)
|
||||
update_icon()
|
||||
|
||||
/obj/structure/displaycase/update_icon()
|
||||
@@ -69,30 +64,33 @@
|
||||
underlays += I
|
||||
|
||||
/obj/structure/displaycase/attackby(obj/item/attacking_item, mob/user)
|
||||
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
|
||||
if(istype(attacking_item, /obj/item/card/id))
|
||||
if(destroyed)
|
||||
to_chat(user, SPAN_WARNING("\The [src] has been destroyed and cannot be unlocked."))
|
||||
return
|
||||
|
||||
var/obj/item/card/id/ID = attacking_item
|
||||
if(check_access(ID))
|
||||
user.visible_message("<b>[user]</b> presses their ID against \the [src], [open ? "closing" : "opening"] it.", SPAN_NOTICE("You press your ID against \the [src], [open ? "closing" : "opening"] it."))
|
||||
open = !open
|
||||
update_icon()
|
||||
|
||||
else
|
||||
to_chat(user, SPAN_WARNING("Access denied."))
|
||||
|
||||
return
|
||||
|
||||
else if(!held_obj && (destroyed || open))
|
||||
to_chat(user, SPAN_NOTICE("You set \the [attacking_item] down on \the [src]."))
|
||||
user.drop_from_inventory(attacking_item, src)
|
||||
held_obj = attacking_item
|
||||
update_icon()
|
||||
else
|
||||
if(destroyed)
|
||||
to_chat(user, SPAN_WARNING("\The [src] has already been destroyed."))
|
||||
return
|
||||
health -= attacking_item.force
|
||||
health_check()
|
||||
return ..()
|
||||
|
||||
if(destroyed)
|
||||
to_chat(user, SPAN_WARNING("\The [src] has already been destroyed."))
|
||||
return
|
||||
|
||||
. = ..()
|
||||
|
||||
/obj/structure/displaycase/attack_hand(mob/user)
|
||||
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
|
||||
@@ -112,8 +110,9 @@
|
||||
to_chat(user, SPAN_NOTICE("You peer inside \the [src], noticing it has nothing inside."))
|
||||
else
|
||||
user.visible_message("<b>[user]</b> kicks \the [src].", SPAN_WARNING("You kick \the [src]."))
|
||||
health -= 2
|
||||
health_check()
|
||||
user.do_attack_animation(src)
|
||||
playsound(src, 'sound/effects/glass_hit.ogg', 50, 1)
|
||||
add_damage(3)
|
||||
|
||||
/obj/structure/displaycase/captain_laser
|
||||
spawn_contained_type = /obj/item/gun/energy/captain
|
||||
|
||||
Reference in New Issue
Block a user