Lets mobs who can smash walls also smash some other relatively fragile structures (#21209)

* Makes grilles and windows easier to smash

* Some cleanups, windoors too

* Adds tables, also holy shit these things are robust

* Update code/game/objects/structures/window.dm

Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com>

* Make some reinforced windows stronger, too

* Sean review, addresses a bug I noticed

* Hanging return

* re-adds take_damage

---------

Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com>
This commit is contained in:
Luc
2023-06-26 20:40:26 -07:00
committed by GitHub
parent e8a6932067
commit 09aec4da53
6 changed files with 54 additions and 5 deletions
+10 -4
View File
@@ -78,10 +78,16 @@
shock(user, 70)
shockcooldown = world.time + my_shockcooldown
/obj/structure/grille/attack_animal(mob/user)
. = ..()
if(. && !QDELETED(src) && !shock(user, 70))
take_damage(rand(5,10), BRUTE, MELEE, 1)
/obj/structure/grille/attack_animal(mob/living/simple_animal/user)
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 ..()
/obj/structure/grille/hulk_damage()
return 60
+7
View File
@@ -21,6 +21,13 @@
..()
add_fingerprint(user)
/obj/structure/railing/attack_animal(mob/living/simple_animal/M)
. = ..()
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>")
/obj/structure/railing/welder_act(mob/living/user, obj/item/I)
if(user.intent != INTENT_HELP)
return
@@ -36,6 +36,8 @@
var/framestackamount = 2
var/deconstruction_ready = TRUE
var/flipped = FALSE
/// The minimum level of environment_smash required for simple animals to be able to one-shot this.
var/minimum_env_smash = ENVIRONMENT_SMASH_WALLS
/obj/structure/table/Initialize(mapload)
. = ..()
@@ -237,6 +239,12 @@
else
return ..()
/obj/structure/table/attack_animal(mob/living/simple_animal/M)
. = ..()
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>")
/obj/structure/table/shove_impact(mob/living/target, mob/living/attacker)
if(locate(/obj/structure/table) in get_turf(target))
return FALSE
@@ -410,6 +418,7 @@
max_integrity = 70
resistance_flags = ACID_PROOF
armor = list(MELEE = 0, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, RAD = 0, FIRE = 80, ACID = 100)
minimum_env_smash = ENVIRONMENT_SMASH_STRUCTURES
var/list/debris = list()
var/shardtype = /obj/item/shard
@@ -502,6 +511,7 @@
buildstack = /obj/item/stack/sheet/plasmaglass
max_integrity = 140
shardtype = /obj/item/shard/plasma
minimum_env_smash = ENVIRONMENT_SMASH_RWALLS
/obj/structure/table/glass/reinforced
name = "reinforced glass table"
@@ -515,6 +525,7 @@
deconstruction_ready = FALSE
armor = list(MELEE = 10, BULLET = 30, LASER = 30, ENERGY = 100, BOMB = 20, RAD = 0, FIRE = 80, ACID = 70)
smoothing_groups = list(SMOOTH_GROUP_REINFORCED_TABLES)
minimum_env_smash = ENVIRONMENT_SMASH_RWALLS
canSmoothWith = list(SMOOTH_GROUP_REINFORCED_TABLES)
/obj/structure/table/glass/reinforced/deconstruction_hints(mob/user) //look, it was either copy paste these 4 procs, or copy paste all of the glass stuff
+17
View File
@@ -33,6 +33,8 @@
var/edge_overlay_file
/// Tracks the edging appearence sprite
var/mutable_appearance/edge_overlay
/// Minimum environment smash level (found on simple animals) to break through this instantly
var/env_smash_level = ENVIRONMENT_SMASH_STRUCTURES
/obj/structure/window/examine(mob/user)
. = ..()
@@ -171,6 +173,18 @@
return
..()
/obj/structure/window/attack_animal(mob/living/simple_animal/M)
if(!can_be_reached(M))
return
. = ..()
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))
return 1 //skip the afterattack
@@ -702,6 +716,7 @@
armor = list(MELEE = 75, BULLET = 5, LASER = 0, ENERGY = 0, BOMB = 45, RAD = 100, FIRE = 99, ACID = 100)
rad_insulation = RAD_NO_INSULATION
edge_overlay_file = 'icons/obj/smooth_structures/windows/window_edges.dmi'
env_smash_level = ENVIRONMENT_SMASH_WALLS // these windows are a fair bit tougher
/obj/structure/window/full/plasmareinforced
name = "reinforced plasma window"
@@ -719,6 +734,7 @@
armor = list(MELEE = 85, BULLET = 20, LASER = 0, ENERGY = 0, BOMB = 60, RAD = 100, FIRE = 99, ACID = 100)
rad_insulation = RAD_NO_INSULATION
edge_overlay_file = 'icons/obj/smooth_structures/windows/reinforced_window_edges.dmi'
env_smash_level = ENVIRONMENT_SMASH_RWALLS // these ones are insanely tough
/obj/structure/window/full/plasmareinforced/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
return
@@ -766,6 +782,7 @@
smoothing_groups = list(SMOOTH_GROUP_WINDOW_FULLTILE_SHUTTLE, SMOOTH_GROUP_TITANIUM_WALLS)
canSmoothWith = list(SMOOTH_GROUP_WINDOW_FULLTILE_SHUTTLE, SMOOTH_GROUP_TITANIUM_WALLS)
glass_type = /obj/item/stack/sheet/titaniumglass
env_smash_level = ENVIRONMENT_SMASH_RWALLS // shuttle windows should probably be a bit stronger, too
/obj/structure/window/full/shuttle/narsie_act()
color = "#3C3434"