Fixes oversight in simplemob smashing code (#21498)

* fixes oversight in smashing code

* grilles too

* grille restore functionality

* this is nearly there but has an issue with windows

* return
This commit is contained in:
S34N
2023-06-28 17:05:22 -05:00
committed by GitHub
parent 62372ec261
commit c3b06feab5
5 changed files with 11 additions and 14 deletions
+6 -4
View File
@@ -79,15 +79,17 @@
shockcooldown = world.time + my_shockcooldown
/obj/structure/grille/attack_animal(mob/living/simple_animal/user)
if(QDELETED(src) || shock(user, 70))
. = ..()
if(!. || QDELETED(src) || shock(user, 70))
return
if(user.environment_smash >= ENVIRONMENT_SMASH_STRUCTURES)
playsound(src, 'sound/effects/grillehit.ogg', 80, TRUE)
obj_break()
user.visible_message("<span class='danger'>[user] smashes through [src]!</span>", "<span class='notice'>You smash through [src].</span>")
else
take_damage(rand(5, 10), BRUTE, MELEE, 1)
return ..()
return
take_damage(rand(5,10), BRUTE, MELEE, 1)
/obj/structure/grille/hulk_damage()
return 60
+1 -1
View File
@@ -23,7 +23,7 @@
/obj/structure/railing/attack_animal(mob/living/simple_animal/M)
. = ..()
if(M.environment_smash >= ENVIRONMENT_SMASH_WALLS)
if(. && M.environment_smash >= ENVIRONMENT_SMASH_WALLS)
deconstruct(FALSE)
M.visible_message("<span class='danger'>[M] tears apart [src]!</span>", "<span class='notice'>You tear apart [src]!</span>")
+1 -1
View File
@@ -241,7 +241,7 @@
/obj/structure/table/attack_animal(mob/living/simple_animal/M)
. = ..()
if(M.environment_smash >= minimum_env_smash)
if(. && M.environment_smash >= minimum_env_smash)
deconstruct(FALSE)
M.visible_message("<span class='danger'>[M] smashes [src]!</span>", "<span class='notice'>You smash [src].</span>")
+2 -7
View File
@@ -171,19 +171,14 @@
/obj/structure/window/attack_generic(mob/user, damage_amount = 0, damage_type = BRUTE, damage_flag = 0, sound_effect = 1) //used by attack_alien, attack_animal, and attack_slime
if(!can_be_reached(user))
return
..()
return ..()
/obj/structure/window/attack_animal(mob/living/simple_animal/M)
if(!can_be_reached(M))
return
. = ..()
if(M.environment_smash >= env_smash_level)
if(. && M.environment_smash >= env_smash_level)
deconstruct(FALSE)
M.visible_message("<span class='danger'>[M] smashes through [src]!</span>", "<span class='warning'>You smash through [src].</span>", "<span class='warning'>You hear glass breaking.</span>")
else
to_chat(M, "<span class='notice'>You smash against the window.</span>")
take_damage(rand(25, 75))
/obj/structure/window/attackby(obj/item/I, mob/living/user, params)
if(!can_be_reached(user))