Time for Seasons

This commit is contained in:
Casey
2022-12-30 16:08:58 -05:00
committed by CHOMPStation2
parent 79629be447
commit 6f1fb55d0d
9 changed files with 1517 additions and 5 deletions

View File

@@ -115,6 +115,8 @@ var/list/flooring_types
var/list/movable_atom_whitelist = list()
var/list/movable_atom_blacklist = list()
var/check_season = FALSE //VOREStation Addition
/decl/flooring/proc/get_plating_type(var/turf/T)
return plating_type
@@ -633,4 +635,14 @@ 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
<<<<<<< HEAD
=======
///// Season Time! ///// VOREStation Addition Start
/decl/flooring/grass/seasonal_grass
desc = "It's grass!"
icon = 'icons/seasonal/turf.dmi'
check_season = TRUE
has_base_range = 11
>>>>>>> 6eacab6772... Merge pull request #13926 from Very-Soft/attheend

View File

@@ -0,0 +1,214 @@
var/world_time_season
/proc/setup_season()
var/month = text2num(time2text(world.timeofday, "MM")) // get the current month
switch(month)
if(1 to 2)
world_time_season = "winter"
if(3 to 5)
world_time_season = "spring"
if(6 to 8)
world_time_season = "summer"
if(9 to 11)
world_time_season = "autumn"
if(12)
world_time_season = "winter"
/turf/simulated/floor/outdoors/grass/seasonal
name = "grass"
icon = 'icons/seasonal/turf.dmi'
icon_state = "s-grass"
icon_edge = 'icons/seasonal/turf_edge.dmi'
initial_flooring = /decl/flooring/grass/seasonal_grass
// initial_flooring = null
grass_types = list()
var/static/list/overlays_cache = list()
var/animal_chance = 0.5
var/animal_types = list()
var/tree_chance = 5
var/tree_types = list()
var/snow_chance = 10
/turf/simulated/floor/outdoors/grass/seasonal/Initialize()
switch(world_time_season)
if("spring")
tree_types = list(
/obj/structure/flora/tree/bigtree,
/obj/structure/flora/tree/jungle_small,
/obj/structure/flora/tree/jungle
)
animal_types = list(
/mob/living/simple_mob/vore/alienanimals/teppi = 10,
/mob/living/simple_mob/vore/alienanimals/teppi/mutant = 1,
/mob/living/simple_mob/vore/redpanda = 40,
/mob/living/simple_mob/vore/redpanda/fae = 2,
/mob/living/simple_mob/vore/sheep = 20,
/mob/living/simple_mob/vore/rabbit/black = 20,
/mob/living/simple_mob/vore/rabbit/white = 20,
/mob/living/simple_mob/vore/rabbit/brown = 20,
/mob/living/simple_mob/vore/leopardmander = 2,
/mob/living/simple_mob/vore/horse/big = 10,
/mob/living/simple_mob/vore/bigdragon/friendly = 1,
/mob/living/simple_mob/vore/alienanimals/dustjumper = 20
)
grass_types = list(
/obj/structure/flora/ausbushes/sparsegrass,
/obj/structure/flora/ausbushes/fullgrass,
/obj/structure/flora/ausbushes/brflowers,
/obj/structure/flora/ausbushes/genericbush,
/obj/structure/flora/ausbushes/lavendergrass,
/obj/structure/flora/ausbushes/leafybush,
/obj/structure/flora/ausbushes/ppflowers,
/obj/structure/flora/ausbushes/sunnybush,
/obj/structure/flora/ausbushes/ywflowers,
/obj/structure/flora/mushroom
)
grass_chance = 30
if("summer")
tree_types = list(
/obj/structure/flora/tree/bigtree,
/obj/structure/flora/tree/jungle_small,
/obj/structure/flora/tree/jungle
)
animal_types = list(
/mob/living/simple_mob/vore/alienanimals/teppi = 10,
/mob/living/simple_mob/vore/alienanimals/teppi/mutant = 1,
/mob/living/simple_mob/vore/redpanda = 40,
/mob/living/simple_mob/vore/redpanda/fae = 2,
/mob/living/simple_mob/vore/sheep = 20,
/mob/living/simple_mob/vore/rabbit/black = 20,
/mob/living/simple_mob/vore/rabbit/white = 20,
/mob/living/simple_mob/vore/rabbit/brown = 20,
/mob/living/simple_mob/vore/leopardmander = 2,
/mob/living/simple_mob/vore/horse/big = 10,
/mob/living/simple_mob/vore/bigdragon/friendly = 1,
/mob/living/simple_mob/vore/alienanimals/dustjumper = 20
)
grass_types = list(
/obj/structure/flora/ausbushes/sparsegrass,
/obj/structure/flora/ausbushes/fullgrass
)
if("autumn")
tree_types = list(
/obj/structure/flora/tree/bigtree
)
animal_types = list(
/mob/living/simple_mob/vore/alienanimals/teppi = 10,
/mob/living/simple_mob/vore/alienanimals/teppi/mutant = 1,
/mob/living/simple_mob/vore/redpanda = 40,
/mob/living/simple_mob/vore/redpanda/fae = 2,
/mob/living/simple_mob/vore/sheep = 20,
/mob/living/simple_mob/vore/rabbit/black = 20,
/mob/living/simple_mob/vore/rabbit/white = 20,
/mob/living/simple_mob/vore/rabbit/brown = 20,
/mob/living/simple_mob/vore/horse/big = 10,
/mob/living/simple_mob/vore/alienanimals/dustjumper = 20
)
grass_types = list(
/obj/structure/flora/ausbushes/sparsegrass,
/obj/structure/flora/pumpkin,
/obj/structure/flora/ausbushes
)
grass_chance = 10
animal_chance = 0.25
if("winter")
grass_chance = 0
tree_types = list(
/obj/structure/flora/tree/dead,
/obj/structure/flora/tree/pine
)
animal_types = list(
/mob/living/simple_mob/vore/rabbit/white = 40,
/mob/living/simple_mob/vore/alienanimals/teppi = 10,
/mob/living/simple_mob/vore/alienanimals/teppi/mutant = 1,
/mob/living/simple_mob/vore/redpanda = 10
)
if(prob(snow_chance))
chill()
return
grass_types = list(
/obj/structure/flora/grass/both,
/obj/structure/flora/grass/brown,
/obj/structure/flora/grass/green,
/obj/structure/flora/bush
)
grass_chance = 1
animal_chance = 0.1
if(tree_chance && prob(tree_chance) && !check_density())
var/tree_type = pickweight(tree_types)
new tree_type(src)
if(animal_chance && prob(animal_chance) && !check_density())
var/animal_type = pickweight(animal_types)
new animal_type(src)
. = ..()
/turf/simulated/floor/outdoors/grass/seasonal/proc/update_desc()
switch(world_time_season)
if("spring")
desc = "Lush green grass, flourishing! Little flowers peek out from between the blades here and there!"
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!"
if("winter")
desc = "Dry, seemingly dead grass! It's too cold for the grass..."
/turf/simulated/floor/outdoors/grass/seasonal/update_icon(update_neighbors)
. = ..()
update_desc()
switch(world_time_season)
if("spring")
if(prob(50))
var/cache_key = "[world_time_season]-overlay[rand(1,19)]"
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])
if("summer")
return
if("autumn")
if(prob(33))
var/cache_key = "[world_time_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])
if("winter")
return
/turf/simulated/floor/outdoors/grass/seasonal/no_trees
tree_chance = 0
/turf/simulated/floor/outdoors/grass/seasonal/no_mobs
animal_chance = 0
/turf/simulated/floor/outdoors/grass/seasonal/no_trees_or_mobs
tree_chance = 0
animal_chance = 0
/turf/simulated/floor/outdoors/grass/seasonal/no_trees_or_mobs_or_snow
tree_chance = 0
animal_chance = 0
snow_chance = 0
/turf/simulated/floor/outdoors/grass/seasonal/low_snow
snow_chance = 1

View File

@@ -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

View File

@@ -23,6 +23,9 @@ var/image/no_ceiling_image = null
icon_state = flooring_override
else
icon_state = flooring.icon_base
//VOREStation Addition Start
if(flooring.check_season)
icon_state = "[icon_state]-[world_time_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 +110,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])
@@ -282,4 +285,3 @@ var/image/no_ceiling_image = null
I.layer = layer
flooring_cache[cache_key] = I
return flooring_cache[cache_key]

View File

@@ -39,6 +39,7 @@
//end-emergency fix
src.update_status()
setup_season() //VOREStation Addition
. = ..()

File diff suppressed because it is too large Load Diff

BIN
icons/seasonal/turf.dmi Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -1717,6 +1717,7 @@
#include "code\game\turfs\flooring\flooring_decals_yw.dm"
#include "code\game\turfs\flooring\flooring_premade.dm"
#include "code\game\turfs\flooring\flooring_vr.dm"
#include "code\game\turfs\flooring\seasonal.dm"
#include "code\game\turfs\flooring\shuttle_vr.dm"
#include "code\game\turfs\initialization\init.dm"
#include "code\game\turfs\initialization\maintenance.dm"