Lemon does weather effects (#67469)

* Lemon does weather effects

Ok so I don't like how weather effects look when they run up against
some sort of border, particularly walls and darkness.
They just sorta snap out of existence. This is cause they were recently
moved from the AREA_PLANE to the ABOVE_LIGHTING_PLANE. This fixed things
like snow or ash storms looking dim, but had some annoying side effects.

I'm gonna do my best to mesh the two, at least somewhat.
I've done two things. The first is letting weather choose to apply a
second icon state to its area, one that draws above lighting, and moving
the current overlay down to AREA_PLANE again.

Oh and the above lighting stuff gets made a bit see through, so it's not
too intense.

This way darkness doesn't totally mask effects, it just makes them
harder to see.

I've gone through the existing effects for this process. I basically
just removed the "background" from any effects that had it. This way you
see the particles at a reduced intensity, but not the "shadow" that the
effect applies.

Oh also can't use glow with lava, cause it draws onto the floor, or
under walls.

In the process of this I realized that snow looks really bad right now.
It's really jerky, has a very clear wrap point, and doesn't even
complete a full animation. So I redid it, added some more flakes and
made it "faster"

I also tweaked non smoothed lava (IE: floor is lava and the wizard ship)
It was scrolling a pixel a tick, but in steps of 3 ticks. Looked bad, I
think the smoothing is better.

I'm not really a spriter or anything, this stuff just cheesed me off a
bit

* whoops
This commit is contained in:
LemonInTheDark
2022-06-10 06:38:38 -07:00
committed by GitHub
parent bfeeeb3e97
commit e15e0f3e91
6 changed files with 42 additions and 20 deletions
+1 -1
View File
@@ -73,7 +73,7 @@
var/turf/open/open_turf = food.loc
if(!istype(open_turf) || istype(open_turf, /turf/open/lava) || istype(open_turf, /turf/open/misc/asteroid)) //Are we actually in a valid open turf?
if(!istype(open_turf) || islava(open_turf) || istype(open_turf, /turf/open/misc/asteroid)) //Are we actually in a valid open turf?
remove_timer()
return
+37 -19
View File
@@ -59,11 +59,15 @@
/// Since it's above everything else, this is the layer used by default. TURF_LAYER is below mobs and walls if you need to use that.
var/overlay_layer = AREA_LAYER
/// Plane for the overlay
var/overlay_plane = ABOVE_LIGHTING_PLANE
var/overlay_plane = AREA_PLANE
/// If the weather has no purpose other than looks
var/aesthetic = FALSE
/// Used by mobs (or movables containing mobs, such as enviro bags) to prevent them from being affected by the weather.
var/immunity_type
/// If this bit of weather should also draw an overlay that's uneffected by lighting onto the area
/// Taken from weather_glow.dmi
var/use_glow = TRUE
var/mutable_appearance/current_glow
/// The stage of the weather, from 1-4
var/stage = END_STAGE
@@ -224,23 +228,37 @@
*
*/
/datum/weather/proc/update_areas()
var/using_icon_state = ""
switch(stage)
if(STARTUP_STAGE)
using_icon_state = telegraph_overlay
if(MAIN_STAGE)
using_icon_state = weather_overlay
if(WIND_DOWN_STAGE)
using_icon_state = end_overlay
if(END_STAGE)
using_icon_state = ""
var/mutable_appearance/glow_overlay = mutable_appearance('icons/effects/glow_weather.dmi', using_icon_state, overlay_layer, ABOVE_LIGHTING_PLANE, 100)
for(var/V in impacted_areas)
var/area/N = V
N.layer = overlay_layer
N.plane = overlay_plane
N.icon = 'icons/effects/weather_effects.dmi'
N.color = weather_color
switch(stage)
if(STARTUP_STAGE)
N.icon_state = telegraph_overlay
if(MAIN_STAGE)
N.icon_state = weather_overlay
if(WIND_DOWN_STAGE)
N.icon_state = end_overlay
if(END_STAGE)
N.color = null
N.icon_state = ""
N.icon = 'icons/area/areas_misc.dmi'
N.layer = initial(N.layer)
N.plane = initial(N.plane)
N.set_opacity(FALSE)
if(current_glow)
N.overlays -= current_glow
if(stage == END_STAGE)
N.color = null
N.icon_state = using_icon_state
N.icon = 'icons/area/areas_misc.dmi'
N.layer = initial(N.layer)
N.plane = initial(N.plane)
N.set_opacity(FALSE)
else
N.layer = overlay_layer
N.plane = overlay_plane
N.icon = 'icons/effects/weather_effects.dmi'
N.icon_state = using_icon_state
N.color = weather_color
if(use_glow)
N.overlays += glow_overlay
current_glow = glow_overlay
@@ -21,6 +21,10 @@
overlay_layer = ABOVE_OPEN_TURF_LAYER //Covers floors only
overlay_plane = FLOOR_PLANE
immunity_type = TRAIT_LAVA_IMMUNE
/// We don't draw on walls, so this ends up lookin weird
/// Can't really use like, the emissive system here because I am not about to make
/// all walls block emissive
use_glow = FALSE
/datum/weather/floor_is_lava/can_weather_act(mob/living/mob_to_check)