Files
Bubberstation/code/game/objects/structures/broken_flooring.dm
Andrew 2e5806626c Proper broken tiles (#75623)
![before-export](https://github.com/tgstation/tgstation/assets/3625094/505eaed3-b429-45c4-ab65-6c92d1c9e20e)

## About The Pull Request

The current broken tiles have some visual issues:

- There is an ambient occlusion shade when it touches normal tile
- It has a layer higher than it should be which leads to things that are
normally above the floor layer, render below it. Such as atmos
machinery, cleanable overlays, etc.

This PR makes the render on a proper layer and work like a partially
destroyed floor tile that can be reclaimed with crowbar.

Also, the cleanables are now on FLOOR_CLEAN_LAYER to make dirt appear
above catwalks and these new tiles.

And the flat dirt now has 4 variants of sprites, while dust uses the old
dirt sprite. It seems like dust was just dirt with different description
before.

## Why It's Good For The Game

A broken tiling with no visual bugs and proper floor-like logic.

## Changelog

🆑 MTandi, Borbop
fix: Dust now has dust icon, instead of dirt icon. Dust on all maps
replaced with dirt
image: Flat dirt now picks from 4 new sprites
refactor: Made broken tiling work more like tiling and have
corresponding visuals. Added directional mapping variants.
fix: Cleanables now use FLOOR_CLEAN_LAYER to make sure that trash is
visible above catwalks
/🆑
2023-06-09 09:50:21 +12:00

55 lines
1.5 KiB
Plaintext

/obj/structure/broken_flooring
name = "broken tiling"
desc = "A segment of broken flooring."
icon = 'icons/obj/brokentiling.dmi'
icon_state = "corner"
anchored = TRUE
density = FALSE
opacity = FALSE
plane = FLOOR_PLANE
layer = CATWALK_LAYER
/obj/structure/broken_flooring/Initialize(mapload)
. = ..()
return INITIALIZE_HINT_LATELOAD
/obj/structure/broken_flooring/LateInitialize()
. = ..()
var/turf/turf = get_turf(src)
if(!isplatingturf(turf)) // Render as trash if not on plating
plane = GAME_PLANE
layer = LOW_OBJ_LAYER
return
for(var/obj/object in turf)
if(object.flags_1 & INITIALIZED_1)
SEND_SIGNAL(object, COMSIG_OBJ_HIDE, UNDERFLOOR_VISIBLE)
CHECK_TICK
/obj/structure/broken_flooring/crowbar_act(mob/living/user, obj/item/I)
I.play_tool_sound(src, 80)
balloon_alert(user, "tile reclaimed")
new /obj/item/stack/tile/iron(get_turf(src))
qdel(src)
return TOOL_ACT_TOOLTYPE_SUCCESS
/obj/structure/broken_flooring/singular
icon_state = "singular"
/obj/structure/broken_flooring/pile
icon_state = "pile"
/obj/structure/broken_flooring/side
icon_state = "side"
/obj/structure/broken_flooring/corner
icon_state = "corner"
/obj/structure/broken_flooring/plating
icon_state = "plating"
MAPPING_DIRECTIONAL_HELPERS(/obj/structure/broken_flooring/singular, 0)
MAPPING_DIRECTIONAL_HELPERS(/obj/structure/broken_flooring/pile, 0)
MAPPING_DIRECTIONAL_HELPERS(/obj/structure/broken_flooring/side, 0)
MAPPING_DIRECTIONAL_HELPERS(/obj/structure/broken_flooring/corner, 0)
MAPPING_DIRECTIONAL_HELPERS(/obj/structure/broken_flooring/plating, 0)