mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-24 04:28:12 +01:00
Time for Seasons
This commit is contained in:
@@ -115,6 +115,8 @@ var/list/flooring_types
|
||||
var/list/movable_atom_whitelist = list()
|
||||
var/list/movable_atom_blacklist = list()
|
||||
|
||||
var/do_season = FALSE //VOREStation Addition
|
||||
|
||||
/decl/flooring/proc/get_plating_type(var/turf/T)
|
||||
return plating_type
|
||||
|
||||
@@ -614,3 +616,9 @@ var/list/flooring_types
|
||||
can_paint = 1 //VOREStation edit. Let's allow for some fun.
|
||||
can_engrave = 1 //VOREStation edit. Fun.
|
||||
flags = TURF_ACID_IMMUNE | TURF_CAN_BREAK | TURF_REMOVE_CROWBAR
|
||||
|
||||
///// Season Time! ///// VOREStation Addition Start
|
||||
/decl/flooring/grass/seasonal_grass
|
||||
icon = 'icons/seasonal/turf.dmi'
|
||||
do_season = TRUE
|
||||
has_base_range = 3
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
var/season
|
||||
|
||||
/proc/do_season()
|
||||
var/month = text2num(time2text(world.timeofday, "MM")) // get the current month
|
||||
|
||||
switch(month)
|
||||
if(1 to 2)
|
||||
season = "winter"
|
||||
if(3 to 5)
|
||||
season = "spring"
|
||||
if(6 to 8)
|
||||
season = "summer"
|
||||
if(9 to 11)
|
||||
season = "autumn"
|
||||
if(12)
|
||||
season = "winter"
|
||||
|
||||
/turf/simulated/floor/outdoors/grass/seasonal
|
||||
name = "grass"
|
||||
icon = 'icons/seasonal/turf.dmi'
|
||||
icon_state = "spring"
|
||||
|
||||
icon_edge = 'icons/seasonal/turf_edge.dmi'
|
||||
|
||||
initial_flooring = /decl/flooring/grass/seasonal_grass
|
||||
// initial_flooring = null
|
||||
|
||||
var/static/list/overlays_cache = list()
|
||||
|
||||
/turf/simulated/floor/outdoors/grass/seasonal/Initialize()
|
||||
|
||||
if(!season)
|
||||
do_season()
|
||||
|
||||
switch(season)
|
||||
if("spring")
|
||||
desc = "Lush green grass, flourishing! Little flowers peek out from between the blades here and there!"
|
||||
grass_chance = 30
|
||||
if("summer")
|
||||
desc = "Bright green grass, a little dry in the summer heat!"
|
||||
if("autumn")
|
||||
desc = "Golden grass, it's a little crunchy as it prepares for winter!"
|
||||
grass_chance = 10
|
||||
if("winter")
|
||||
desc = "Dry, seemingly dead grass! It's too cold for the grass..."
|
||||
grass_chance = 0
|
||||
|
||||
return ..()
|
||||
|
||||
/turf/simulated/floor/outdoors/grass/seasonal/update_icon(update_neighbors)
|
||||
. = ..()
|
||||
|
||||
if(prob(33))
|
||||
var/cache_key = "[season]-overlay[rand(1,6)]"
|
||||
if(!overlays_cache[cache_key])
|
||||
var/image/I = image(icon = src.icon, icon_state = cache_key, layer = ABOVE_TURF_LAYER) // Icon should be abstracted out
|
||||
I.plane = TURF_PLANE
|
||||
overlays_cache[cache_key] = I
|
||||
add_overlay(overlays_cache[cache_key])
|
||||
@@ -18,6 +18,8 @@
|
||||
var/dirt = 0
|
||||
var/special_temperature //Used for turf HE-Pipe interaction
|
||||
|
||||
var/icon_edge = 'icons/turf/outdoors_edge.dmi' //VOREStation Addition - Allows for alternative edge icon files
|
||||
|
||||
// This is not great.
|
||||
/turf/simulated/proc/wet_floor(var/wet_val = 1)
|
||||
if(wet > 2) //Can't mop up ice
|
||||
|
||||
@@ -23,6 +23,11 @@ var/image/no_ceiling_image = null
|
||||
icon_state = flooring_override
|
||||
else
|
||||
icon_state = flooring.icon_base
|
||||
//VOREStation Addition Start
|
||||
if(flooring.do_season)
|
||||
if(!season)
|
||||
do_season()
|
||||
icon_state = "[icon_state]-[season]" //VOREStation Addition End
|
||||
if(flooring.has_base_range)
|
||||
icon_state = "[icon_state][rand(0,flooring.has_base_range)]"
|
||||
flooring_override = icon_state
|
||||
@@ -107,11 +112,11 @@ var/image/no_ceiling_image = null
|
||||
// Has to have it's own edge_blending_priority
|
||||
// Has to have a higher priority than us
|
||||
// Their icon_state is not our icon_state
|
||||
// They don't forbid_turf_edge
|
||||
// They don't forbid_turf_edge
|
||||
if(istype(T) && T.edge_blending_priority && edge_blending_priority < T.edge_blending_priority && icon_state != T.icon_state && !T.forbid_turf_edge())
|
||||
var/cache_key = "[T.get_edge_icon_state()]-[checkdir]" // Usually [icon_state]-[dirnum]
|
||||
if(!turf_edge_cache[cache_key])
|
||||
var/image/I = image(icon = 'icons/turf/outdoors_edge.dmi', icon_state = "[T.get_edge_icon_state()]-edge", dir = checkdir, layer = ABOVE_TURF_LAYER) // Icon should be abstracted out
|
||||
var/image/I = image(icon = T.icon_edge, icon_state = "[T.get_edge_icon_state()]-edge", dir = checkdir, layer = ABOVE_TURF_LAYER) // VOREStation Edit - icon_edge
|
||||
I.plane = TURF_PLANE
|
||||
turf_edge_cache[cache_key] = I
|
||||
add_overlay(turf_edge_cache[cache_key])
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 25 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 7.2 KiB |
Reference in New Issue
Block a user