Files
Bubberstation/code/game/objects/structures/railings.dm
LemonInTheDark f03084c1ca FOV is Dead (Long Live FOV) (#80062)
## About The Pull Request

FOV as it is currently implemented is incompatible* with wallening.
I'm doin wallening, so we gotta redo things here.

The issue is the masking of mobs. Wallening relies on sidemap (layering
based off physical position), which only works on things on the same
plane (because planes are basically sheets we render down onto)
So rather then masking mobs, let's reuse the masking idea from old fov,
and use it to cut out a bit of the game render plane, and
blur/over-saturate the bit that's masked out.

My hope is this makes things visible in light, but not as much in
darkness, alongside making more vivid shit more easily seen (just like
real life)

Here's some videos, what follows after is the commits I care about
(since I had to rip a bunch of planes to nothing, so the files changed
tab might be a bit of a mess)

Oh also I had to remove the darkness pref since the darkness is doing a
lot of the heavy lifting now. I'm sorry.

Edit:
NEW FOV SPRITES! Thanks dongle your aviator glasses will guide us to a
better future.


https://github.com/tgstation/tgstation/assets/58055496/afa9eeb8-8b7b-4364-b0c0-7ac8070b5609


https://github.com/tgstation/tgstation/assets/58055496/0eff040c-8bf1-47e4-a4f3-dac56fb2ccc8

## Commits I Care About

[Implements something like fov, but without the planes as layers
hell](a604c7b1c8)

Rather then masking out mobs standing behind us, we use a combo color
matrix and blur filter to make the stuff covered by fov harder to see.

We achive this by splitting the game plane into two, masking both by fov
(one normally and one inversely), and then applying effects to one of
the two.

I want to make the fov fullscreens more gradient, but as an effect this
is a good start

[Removes WALL_PLANE_UPPER by adding a WALL_PLANE overlay to material
walls (init cost comes
here)](2548933739)

@Mothblocks see this. comment in commit explains further but uh, we need
to draw material walls to the light mask plane so things actually can be
seen on them, but we can't do that and also have them be big, so they
get an overlay. Sorry, slight init time bump, about 0.5 seconds. I can
kill it with wallening.

[Moves SEETHROUGH_PLANE above
ABOVE_GAME_PLANE](beec4c00e0)

I don't think it actually wants to draw here
@Time-Green I think this was you so pinging for opinion

[Resprites FOV masks to be clean (and more
consistent)](f02ad13696)

[f02ad13](f02ad13696)

This is 100% donglesplonge's work, he's spent a week or so going back
and forth with me sharpening these to a mirror shine, real chill

## Why It's Good For The Game

Walls are closing in

## Changelog
🆑 LemonInTheDark, Donglesplonge
image: Redoes fov "mask" sprites. They're clean, have a very pleasant
dithering effect, and look real fuckin good!
del: Changed FOV, it no longer hides mobs, instead it blurs the hidden
area, and makes it a bit darker/oversaturated
/🆑

###### * It's technically possible if we start using render targets to
create 2 sets of sources but that's insane and we aren't doing it
2023-12-13 15:52:24 +01:00

189 lines
5.6 KiB
Plaintext

/obj/structure/railing
name = "railing"
desc = "Basic railing meant to protect idiots like you from falling."
icon = 'icons/obj/railings.dmi'
icon_state = "railing"
flags_1 = ON_BORDER_1
obj_flags = CAN_BE_HIT | BLOCKS_CONSTRUCTION_DIR
density = TRUE
anchored = TRUE
pass_flags_self = LETPASSTHROW|PASSSTRUCTURE
layer = ABOVE_MOB_LAYER
/// armor is a little bit less than a grille. max_integrity about half that of a grille.
armor_type = /datum/armor/structure_railing
max_integrity = 25
var/climbable = TRUE
///Initial direction of the railing.
var/ini_dir
///item released when deconstructed
var/item_deconstruct = /obj/item/stack/rods
/datum/armor/structure_railing
melee = 35
bullet = 50
laser = 50
energy = 100
bomb = 10
/obj/structure/railing/corner //aesthetic corner sharp edges hurt oof ouch
icon_state = "railing_corner"
density = FALSE
climbable = FALSE
/obj/structure/railing/corner/end //end of a segment of railing without making a loop
icon_state = "railing_end"
/obj/structure/railing/corner/end/flip //same as above but flipped around
icon_state = "railing_end_flip"
/obj/structure/railing/Initialize(mapload)
. = ..()
ini_dir = dir
if(climbable)
AddElement(/datum/element/climbable)
if(density && flags_1 & ON_BORDER_1) // blocks normal movement from and to the direction it's facing.
var/static/list/loc_connections = list(
COMSIG_ATOM_EXIT = PROC_REF(on_exit),
)
AddElement(/datum/element/connect_loc, loc_connections)
var/static/list/tool_behaviors = list(
TOOL_WELDER = list(
SCREENTIP_CONTEXT_LMB = "Repair",
),
TOOL_WRENCH = list(
SCREENTIP_CONTEXT_LMB = "Anchor/Unanchor",
),
TOOL_WIRECUTTER = list(
SCREENTIP_CONTEXT_LMB = "Deconstruct",
),
)
AddElement(/datum/element/contextual_screentip_tools, tool_behaviors)
AddComponent(/datum/component/simple_rotation, ROTATION_NEEDS_ROOM)
/obj/structure/railing/examine(mob/user)
. = ..()
if(anchored == TRUE)
. += span_notice("The railing is <b>bolted</b> to the floor.")
else
. += span_notice("The railing is <i>unbolted</i> from the floor and can be deconstructed with <b>wirecutters</b>.")
/obj/structure/railing/attackby(obj/item/I, mob/living/user, params)
..()
add_fingerprint(user)
if(I.tool_behaviour == TOOL_WELDER && !user.combat_mode)
if(atom_integrity < max_integrity)
if(!I.tool_start_check(user, amount=1))
return
to_chat(user, span_notice("You begin repairing [src]..."))
if(I.use_tool(src, user, 40, volume=50))
atom_integrity = max_integrity
to_chat(user, span_notice("You repair [src]."))
else
to_chat(user, span_warning("[src] is already in good condition!"))
return
/obj/structure/railing/AltClick(mob/user)
return ..() // This hotkey is BLACKLISTED since it's used by /datum/component/simple_rotation
/obj/structure/railing/wirecutter_act(mob/living/user, obj/item/I)
. = ..()
to_chat(user, span_warning("You cut apart the railing."))
I.play_tool_sound(src, 100)
deconstruct()
return TRUE
/obj/structure/railing/deconstruct(disassembled)
if((obj_flags & NO_DECONSTRUCTION))
return ..()
var/rods_to_make = istype(src,/obj/structure/railing/corner) ? 1 : 2
var/obj/rod = new item_deconstruct(drop_location(), rods_to_make)
transfer_fingerprints_to(rod)
return ..()
///Implements behaviour that makes it possible to unanchor the railing.
/obj/structure/railing/wrench_act(mob/living/user, obj/item/I)
. = ..()
if(obj_flags & NO_DECONSTRUCTION)
return
to_chat(user, span_notice("You begin to [anchored ? "unfasten the railing from":"fasten the railing to"] the floor..."))
if(I.use_tool(src, user, volume = 75, extra_checks = CALLBACK(src, PROC_REF(check_anchored), anchored)))
set_anchored(!anchored)
to_chat(user, span_notice("You [anchored ? "fasten the railing to":"unfasten the railing from"] the floor."))
return TRUE
/obj/structure/railing/CanPass(atom/movable/mover, border_dir)
. = ..()
if(border_dir & dir)
return . || mover.throwing || (mover.movement_type & MOVETYPES_NOT_TOUCHING_GROUND)
return TRUE
/obj/structure/railing/CanAStarPass(to_dir, datum/can_pass_info/pass_info)
if(!(to_dir & dir))
return TRUE
return ..()
/obj/structure/railing/proc/on_exit(datum/source, atom/movable/leaving, direction)
SIGNAL_HANDLER
if(leaving == src)
return // Let's not block ourselves.
if(!(direction & dir))
return
if (!density)
return
if (leaving.throwing)
return
if (leaving.movement_type & (PHASING|MOVETYPES_NOT_TOUCHING_GROUND))
return
if (leaving.move_force >= MOVE_FORCE_EXTREMELY_STRONG)
return
leaving.Bump(src)
return COMPONENT_ATOM_BLOCK_EXIT
/obj/structure/railing/proc/check_anchored(checked_anchored)
if(anchored == checked_anchored)
return TRUE
/obj/structure/railing/wooden_fence
name = "wooden fence"
desc = "wooden fence meant to keep animals in."
icon = 'icons/obj/structures.dmi'
icon_state = "wooden_railing"
item_deconstruct = /obj/item/stack/sheet/mineral/wood
layer = ABOVE_MOB_LAYER
/obj/structure/railing/wooden_fence/Initialize(mapload)
. = ..()
RegisterSignal(src, COMSIG_ATOM_DIR_CHANGE, PROC_REF(on_change_layer))
adjust_dir_layer(dir)
/obj/structure/railing/wooden_fence/proc/on_change_layer(datum/source, old_dir, new_dir)
SIGNAL_HANDLER
adjust_dir_layer(new_dir)
/obj/structure/railing/wooden_fence/proc/adjust_dir_layer(direction)
var/new_layer = (direction & NORTH) ? MOB_LAYER : ABOVE_MOB_LAYER
layer = new_layer
/obj/structure/railing/corner/end/wooden_fence
icon = 'icons/obj/structures.dmi'
icon_state = "wooden_railing_corner"
/obj/structure/railing/corner/end/flip/wooden_fence
icon = 'icons/obj/structures.dmi'
icon_state = "wooden_railing_corner_flipped"