mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
Revert "Upgrades Planetary Weather to vis_contents (#5170)"
This reverts commit e3e1a7ad9c.
This commit is contained in:
@@ -10,5 +10,6 @@
|
|||||||
#define WEATHER_HOT "hot"
|
#define WEATHER_HOT "hot"
|
||||||
#define WEATHER_BLOOD_MOON "blood moon" // For admin fun or cult later on.
|
#define WEATHER_BLOOD_MOON "blood moon" // For admin fun or cult later on.
|
||||||
|
|
||||||
#define PLANET_PROCESS_SUN 0x1
|
#define PLANET_PROCESS_WEATHER 0x1
|
||||||
#define PLANET_PROCESS_TEMP 0x2
|
#define PLANET_PROCESS_SUN 0x2
|
||||||
|
#define PLANET_PROCESS_TEMP 0x4
|
||||||
@@ -21,7 +21,6 @@ var/datum/controller/process/planet/planet_controller = null
|
|||||||
for(var/datum/planet/P in planets)
|
for(var/datum/planet/P in planets)
|
||||||
if(OT.z in P.expected_z_levels)
|
if(OT.z in P.expected_z_levels)
|
||||||
P.planet_floors |= OT
|
P.planet_floors |= OT
|
||||||
OT.vis_contents |= P.weather_holder.visuals
|
|
||||||
break
|
break
|
||||||
outdoor_turfs.Cut() //Why were you in there INCORRECTLY?
|
outdoor_turfs.Cut() //Why were you in there INCORRECTLY?
|
||||||
|
|
||||||
@@ -37,7 +36,6 @@ var/datum/controller/process/planet/planet_controller = null
|
|||||||
var/datum/planet/P = planet
|
var/datum/planet/P = planet
|
||||||
if(T.z in P.expected_z_levels)
|
if(T.z in P.expected_z_levels)
|
||||||
P.planet_floors -= T
|
P.planet_floors -= T
|
||||||
T.vis_contents -= P.weather_holder.visuals
|
|
||||||
|
|
||||||
/datum/controller/process/planet/doWork()
|
/datum/controller/process/planet/doWork()
|
||||||
if(outdoor_turfs.len || planetary_walls.len)
|
if(outdoor_turfs.len || planetary_walls.len)
|
||||||
@@ -46,6 +44,19 @@ var/datum/controller/process/planet/planet_controller = null
|
|||||||
for(var/datum/planet/P in planets)
|
for(var/datum/planet/P in planets)
|
||||||
P.process(schedule_interval / 10)
|
P.process(schedule_interval / 10)
|
||||||
SCHECK //Your process() really shouldn't take this long...
|
SCHECK //Your process() really shouldn't take this long...
|
||||||
|
//Weather style needs redrawing
|
||||||
|
if(P.needs_work & PLANET_PROCESS_WEATHER)
|
||||||
|
P.needs_work &= ~PLANET_PROCESS_WEATHER
|
||||||
|
var/image/new_overlay = image(icon = P.weather_holder.current_weather.icon, icon_state = P.weather_holder.current_weather.icon_state)
|
||||||
|
new_overlay.plane = PLANE_PLANETLIGHTING
|
||||||
|
//Redraw weather icons
|
||||||
|
for(var/T in P.planet_floors)
|
||||||
|
var/turf/simulated/turf = T
|
||||||
|
// turf.overlays -= turf.weather_overlay
|
||||||
|
turf.weather_overlay = new_overlay
|
||||||
|
// turf.overlays += turf.weather_overlay
|
||||||
|
turf.update_icon()
|
||||||
|
SCHECK
|
||||||
|
|
||||||
//Sun light needs changing
|
//Sun light needs changing
|
||||||
if(P.needs_work & PLANET_PROCESS_SUN)
|
if(P.needs_work & PLANET_PROCESS_SUN)
|
||||||
|
|||||||
@@ -84,6 +84,9 @@ var/image/no_ceiling_image = null
|
|||||||
if(!isnull(burnt) && (flooring.flags & TURF_CAN_BURN))
|
if(!isnull(burnt) && (flooring.flags & TURF_CAN_BURN))
|
||||||
add_overlay(get_flooring_overlay("[flooring.icon_base]-burned-[burnt]","burned[burnt]")) // VOREStation Edit - Eris overlays
|
add_overlay(get_flooring_overlay("[flooring.icon_base]-burned-[burnt]","burned[burnt]")) // VOREStation Edit - Eris overlays
|
||||||
|
|
||||||
|
if(weather_overlay)
|
||||||
|
add_overlay(weather_overlay)
|
||||||
|
|
||||||
if(update_neighbors)
|
if(update_neighbors)
|
||||||
for(var/turf/simulated/floor/F in range(src, 1))
|
for(var/turf/simulated/floor/F in range(src, 1))
|
||||||
if(F == src)
|
if(F == src)
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ var/list/outdoor_turfs = list()
|
|||||||
var/edge_blending_priority = 0
|
var/edge_blending_priority = 0
|
||||||
// Outdoors var determines if the game should consider the turf to be 'outdoors', which controls certain things such as weather effects.
|
// Outdoors var determines if the game should consider the turf to be 'outdoors', which controls certain things such as weather effects.
|
||||||
var/outdoors = FALSE
|
var/outdoors = FALSE
|
||||||
|
// This holds the image for the current weather effect.
|
||||||
|
var/image/weather_overlay = null
|
||||||
|
|
||||||
/turf/simulated/floor/outdoors
|
/turf/simulated/floor/outdoors
|
||||||
name = "generic ground"
|
name = "generic ground"
|
||||||
@@ -30,7 +32,7 @@ var/list/outdoor_turfs = list()
|
|||||||
/turf/simulated/floor/Destroy()
|
/turf/simulated/floor/Destroy()
|
||||||
if(outdoors)
|
if(outdoors)
|
||||||
planet_controller.unallocateTurf(src)
|
planet_controller.unallocateTurf(src)
|
||||||
return ..()
|
..()
|
||||||
|
|
||||||
/turf/simulated/proc/make_outdoors()
|
/turf/simulated/proc/make_outdoors()
|
||||||
outdoors = TRUE
|
outdoors = TRUE
|
||||||
@@ -42,14 +44,20 @@ var/list/outdoor_turfs = list()
|
|||||||
planet_controller.unallocateTurf(src)
|
planet_controller.unallocateTurf(src)
|
||||||
else // This is happening during map gen, if there's no planet_controller (hopefully).
|
else // This is happening during map gen, if there's no planet_controller (hopefully).
|
||||||
outdoor_turfs -= src
|
outdoor_turfs -= src
|
||||||
|
if(weather_overlay)
|
||||||
|
cut_overlay(weather_overlay)
|
||||||
|
qdel_null(weather_overlay)
|
||||||
|
update_icon()
|
||||||
|
|
||||||
/turf/simulated/post_change()
|
/turf/simulated/post_change()
|
||||||
..()
|
..()
|
||||||
// If it was outdoors and still is, it will not get added twice when the planet controller gets around to putting it in.
|
// If it was outdoors and still is, it will not get added twice when the planet controller gets around to putting it in.
|
||||||
if(outdoors)
|
if(outdoors)
|
||||||
make_outdoors()
|
make_outdoors()
|
||||||
|
// outdoor_turfs += src
|
||||||
else
|
else
|
||||||
make_indoors()
|
make_indoors()
|
||||||
|
// planet_controller.unallocateTurf(src)
|
||||||
|
|
||||||
/turf/simulated/proc/update_icon_edge()
|
/turf/simulated/proc/update_icon_edge()
|
||||||
if(edge_blending_priority)
|
if(edge_blending_priority)
|
||||||
|
|||||||
@@ -39,6 +39,7 @@
|
|||||||
var/old_dynamic_lighting = dynamic_lighting
|
var/old_dynamic_lighting = dynamic_lighting
|
||||||
var/old_affecting_lights = affecting_lights
|
var/old_affecting_lights = affecting_lights
|
||||||
var/old_lighting_overlay = lighting_overlay
|
var/old_lighting_overlay = lighting_overlay
|
||||||
|
var/old_weather_overlay = weather_overlay
|
||||||
var/old_corners = corners
|
var/old_corners = corners
|
||||||
|
|
||||||
//world << "Replacing [src.type] with [N]"
|
//world << "Replacing [src.type] with [N]"
|
||||||
@@ -57,6 +58,9 @@
|
|||||||
if(old_fire)
|
if(old_fire)
|
||||||
fire = old_fire
|
fire = old_fire
|
||||||
|
|
||||||
|
if(old_weather_overlay)
|
||||||
|
W.weather_overlay = old_weather_overlay
|
||||||
|
|
||||||
if (istype(W,/turf/simulated/floor))
|
if (istype(W,/turf/simulated/floor))
|
||||||
W.RemoveLattice()
|
W.RemoveLattice()
|
||||||
|
|
||||||
@@ -81,6 +85,9 @@
|
|||||||
if(old_fire)
|
if(old_fire)
|
||||||
old_fire.RemoveFire()
|
old_fire.RemoveFire()
|
||||||
|
|
||||||
|
if(old_weather_overlay)
|
||||||
|
W.weather_overlay = old_weather_overlay
|
||||||
|
|
||||||
if(tell_universe)
|
if(tell_universe)
|
||||||
universe.OnTurfChange(W)
|
universe.OnTurfChange(W)
|
||||||
|
|
||||||
|
|||||||
@@ -8,9 +8,6 @@
|
|||||||
var/list/roundstart_weather_chances = list()
|
var/list/roundstart_weather_chances = list()
|
||||||
var/next_weather_shift = null
|
var/next_weather_shift = null
|
||||||
|
|
||||||
// Holds the weather icon, using vis_contents. Documentation says an /atom/movable is required for placing inside another atom's vis_contents.
|
|
||||||
var/atom/movable/weather_visuals/visuals = null
|
|
||||||
|
|
||||||
/datum/weather_holder/New(var/source)
|
/datum/weather_holder/New(var/source)
|
||||||
..()
|
..()
|
||||||
our_planet = source
|
our_planet = source
|
||||||
@@ -18,7 +15,6 @@
|
|||||||
var/datum/weather/W = allowed_weather_types[A]
|
var/datum/weather/W = allowed_weather_types[A]
|
||||||
if(istype(W))
|
if(istype(W))
|
||||||
W.holder = src
|
W.holder = src
|
||||||
visuals = new()
|
|
||||||
|
|
||||||
/datum/weather_holder/proc/change_weather(var/new_weather)
|
/datum/weather_holder/proc/change_weather(var/new_weather)
|
||||||
var/old_light_modifier = null
|
var/old_light_modifier = null
|
||||||
@@ -45,7 +41,7 @@
|
|||||||
current_weather.process_effects()
|
current_weather.process_effects()
|
||||||
|
|
||||||
/datum/weather_holder/proc/update_icon_effects()
|
/datum/weather_holder/proc/update_icon_effects()
|
||||||
visuals.icon_state = current_weather.icon_state
|
our_planet.needs_work |= PLANET_PROCESS_WEATHER
|
||||||
|
|
||||||
/datum/weather_holder/proc/update_temperature()
|
/datum/weather_holder/proc/update_temperature()
|
||||||
temperature = Interpolate(current_weather.temp_low, current_weather.temp_high, weight = our_planet.sun_position)
|
temperature = Interpolate(current_weather.temp_low, current_weather.temp_high, weight = our_planet.sun_position)
|
||||||
@@ -69,9 +65,3 @@
|
|||||||
|
|
||||||
/datum/weather/proc/process_effects()
|
/datum/weather/proc/process_effects()
|
||||||
return
|
return
|
||||||
|
|
||||||
// All this does is hold the weather icon.
|
|
||||||
/atom/movable/weather_visuals
|
|
||||||
icon = 'icons/effects/weather.dmi'
|
|
||||||
mouse_opacity = 0
|
|
||||||
plane = PLANE_PLANETLIGHTING
|
|
||||||
|
|||||||
Reference in New Issue
Block a user