Files
Bubberstation/code/game/objects/effects/temporary_visuals/cult.dm
LemonInTheDark e90a9b4b68 Flattens The Floor Plane (Camera Update Too) (#84350)
## About The Pull Request

Ok so like, side map right? It makes things higher up in the world
render above things lower down in the world.

Most of the time this is what we want, but it is NOT what we want for
floors.
Floors are allowed to be larger then 32x32, and if they are we want them
to render based off JUST their layer.
If we don't allow this grass turfs and others get cut off on their
bottom edge, which looks WEIRD.

In order to make this happen, we can add TOPDOWN_LAYER to every layer on
the floor plane and disable sidemap.

I've added documentation for this to VISUALS.md, and have also
implemented unit test errors to prevent mixing TOPDOWN layers with non
topdown planes (or vis versa).
This new test adds ~1 second to tests, which is I think a perfectly
scrumpulent number.

EDIT:

I nerd sniped myself and implemented sidemap layering and lighting for
cameras (also larger then 32x32 icon support for getflat)
The lighting isn't perfect, we don't handle things displaying in the
void all that well (I am convinced getflat blending is broken but I have
no debugger so I can't fix it properly), but it'll do.

This came up cause I had to fix another layering issue in cameras and
thought I might as well go all in.

![image](https://github.com/tgstation/tgstation/assets/58055496/601b422c-f6aa-42ba-bcd9-b1faebe236e3)


## Why It's Good For The Game

Old:

![image](https://github.com/tgstation/tgstation/assets/58055496/d4102386-420d-4346-b05c-b819e62d98d0)

New:

![image](https://github.com/tgstation/tgstation/assets/58055496/1f5e303e-adee-427d-8fe3-76c8f2dbe098)


## Changelog
🆑
fix: Grass turfs will render properly now. Reworked how floors render,
please report any bugs!
fix: Cameras now properly capture lighting
fix: The layering seen in photos should better match the actual game
/🆑
2024-07-04 12:10:41 -07:00

157 lines
4.0 KiB
Plaintext

//temporary visual effects(/obj/effect/temp_visual) used by cult stuff
/obj/effect/temp_visual/cult
icon = 'icons/effects/cult.dmi'
randomdir = FALSE
duration = 10
/obj/effect/temp_visual/cult/sparks
randomdir = TRUE
name = "blood sparks"
icon_state = "bloodsparkles"
/obj/effect/temp_visual/cult/blood // The traditional teleport
name = "blood jaunt"
duration = 12
icon_state = "bloodin"
/obj/effect/temp_visual/cult/blood/out
icon_state = "bloodout"
/obj/effect/temp_visual/dir_setting/cult/phase // The veil shifter teleport
icon = 'icons/effects/cult.dmi'
name = "phase glow"
duration = 7
icon_state = "cultin"
/obj/effect/temp_visual/dir_setting/cult/phase/out
icon = 'icons/effects/cult.dmi'
icon_state = "cultout"
/obj/effect/temp_visual/cult/sac
name = "maw of Nar'Sie"
icon_state = "sacconsume"
/obj/effect/temp_visual/cult/door
name = "unholy glow"
icon_state = "doorglow"
layer = CLOSED_FIREDOOR_LAYER //above closed doors
plane = GAME_PLANE
/obj/effect/temp_visual/cult/door/unruned
icon_state = "unruneddoorglow"
/obj/effect/temp_visual/cult/turf
name = "unholy glow"
icon_state = "wallglow"
layer = ABOVE_NORMAL_TURF_LAYER
plane = GAME_PLANE
/obj/effect/temp_visual/cult/turf/floor
icon_state = "floorglow"
duration = 5
layer = ABOVE_OPEN_TURF_LAYER
plane = FLOOR_PLANE
/obj/effect/temp_visual/cult/portal
icon_state = "space"
duration = 600
layer = ABOVE_OBJ_LAYER
plane = GAME_PLANE
//visuals for runes being magically created
/obj/effect/temp_visual/cult/rune_spawn
icon_state = "runeouter"
alpha = 0
var/turnedness = 179 //179 turns counterclockwise, 181 turns clockwise
/obj/effect/temp_visual/cult/rune_spawn/Initialize(mapload, set_duration, set_color)
if(isnum(set_duration))
duration = set_duration
if(set_color)
add_atom_colour(set_color, FIXED_COLOUR_PRIORITY)
. = ..()
var/oldtransform = transform
transform = matrix()*2
var/matrix/M = transform
M.Turn(turnedness)
transform = M
animate(src, alpha = 255, time = duration, easing = BOUNCE_EASING, flags = ANIMATION_PARALLEL)
animate(src, transform = oldtransform, time = duration, flags = ANIMATION_PARALLEL)
/obj/effect/temp_visual/cult/rune_spawn/rune1
icon_state = "rune1words"
turnedness = 181
/obj/effect/temp_visual/cult/rune_spawn/rune1/inner
icon_state = "rune1inner"
turnedness = 179
/obj/effect/temp_visual/cult/rune_spawn/rune1/center
icon_state = "rune1center"
/obj/effect/temp_visual/cult/rune_spawn/rune2
icon_state = "rune2words"
turnedness = 181
/obj/effect/temp_visual/cult/rune_spawn/rune2/inner
icon_state = "rune2inner"
turnedness = 179
/obj/effect/temp_visual/cult/rune_spawn/rune2/center
icon_state = "rune2center"
/obj/effect/temp_visual/cult/rune_spawn/rune3
icon_state = "rune3words"
turnedness = 181
/obj/effect/temp_visual/cult/rune_spawn/rune3/inner
icon_state = "rune3inner"
turnedness = 179
/obj/effect/temp_visual/cult/rune_spawn/rune3/center
icon_state = "rune3center"
/obj/effect/temp_visual/cult/rune_spawn/rune4
icon_state = "rune4words"
turnedness = 181
/obj/effect/temp_visual/cult/rune_spawn/rune4/inner
icon_state = "rune4inner"
turnedness = 179
/obj/effect/temp_visual/cult/rune_spawn/rune4/center
icon_state = "rune4center"
/obj/effect/temp_visual/cult/rune_spawn/rune5
icon_state = "rune5words"
turnedness = 181
/obj/effect/temp_visual/cult/rune_spawn/rune5/inner
icon_state = "rune5inner"
turnedness = 179
/obj/effect/temp_visual/cult/rune_spawn/rune5/center
icon_state = "rune5center"
/obj/effect/temp_visual/cult/rune_spawn/rune6
icon_state = "rune6words"
turnedness = 181
/obj/effect/temp_visual/cult/rune_spawn/rune6/inner
icon_state = "rune6inner"
turnedness = 179
/obj/effect/temp_visual/cult/rune_spawn/rune6/center
icon_state = "rune6center"
/obj/effect/temp_visual/cult/rune_spawn/rune7
icon_state = "rune7words"
turnedness = 181
/obj/effect/temp_visual/cult/rune_spawn/rune7/inner
icon_state = "rune7inner"
turnedness = 179
/obj/effect/temp_visual/cult/rune_spawn/rune7/center
icon_state = "rune7center"