Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit b98b09e

Browse files
what do you mean it's not tidally locked??? (#22554)
1 parent 9c20d3b commit b98b09e

File tree

13 files changed

+78
-14
lines changed

13 files changed

+78
-14
lines changed

code/__DEFINES/sound.dm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
#define AMBIENCE_RUINS "ruins"
4949
#define AMBIENCE_ENGI "engi"
5050
#define AMBIENCE_MINING "mining"
51+
#define AMBIENCE_JUNGLE "jungle"
5152
#define AMBIENCE_MEDICAL "med"
5253
#define AMBIENCE_SPOOKY "spooky"
5354
#define AMBIENCE_SPACE "space"

code/__HELPERS/time.dm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
return time2text(wtime - GLOB.timezoneOffset, format)
1313

1414
/proc/station_time(display_only = FALSE, wtime=world.time)
15-
return ((((wtime - SSticker.round_start_time) * SSticker.station_time_rate_multiplier) + SSticker.gametime_offset) % 864000) - (display_only? GLOB.timezoneOffset : 0)
15+
return ((((wtime - SSticker.round_start_time) * SSticker.station_time_rate_multiplier) + SSticker.gametime_offset) % MIDNIGHT_ROLLOVER) - (display_only? GLOB.timezoneOffset : 0)
1616

1717
/proc/station_time_timestamp(format = "hh:mm:ss", wtime)
1818
return time2text(station_time(TRUE, wtime), format)
@@ -21,7 +21,7 @@
2121
if(isnum(force_set))
2222
SSticker.gametime_offset = force_set
2323
return
24-
SSticker.gametime_offset = rand(0, 864000) //hours in day * minutes in hour * seconds in minute * deciseconds in second
24+
SSticker.gametime_offset = rand(0, MIDNIGHT_ROLLOVER) //hours in day * minutes in hour * seconds in minute * deciseconds in second
2525
if(prob(50))
2626
SSticker.gametime_offset = FLOOR(SSticker.gametime_offset, 3600)
2727
else
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
SUBSYSTEM_DEF(daylight)
2+
name = "Daylight"
3+
wait = 2 SECONDS
4+
/// Time required to complete a full day-night cycle
5+
var/daylight_time = 24 MINUTES
6+
/// All areas that should update their lighting based on time of day
7+
var/list/area/daylight_areas = list()
8+
9+
/datum/controller/subsystem/daylight/proc/add_lit_area(area/new_area)
10+
daylight_areas.Add(new_area)
11+
12+
/datum/controller/subsystem/daylight/proc/remove_lit_area(area/old_area)
13+
daylight_areas.Remove(old_area)
14+
15+
/datum/controller/subsystem/daylight/fire(resumed = FALSE)
16+
var/light_coefficient = max((sin(world.time * 360 / daylight_time) + 0.5) * 2 / 3, 0)
17+
var/light_alpha = round(255 * light_coefficient)
18+
var/light_color = rgb(255, 130 + 125 * light_coefficient, 130 + 125 * light_coefficient)
19+
for(var/area/lit_area as anything in daylight_areas)
20+
lit_area.set_base_lighting(light_color, light_alpha)

code/datums/mapgen/dungeon_generators/generator_theme.dm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@
127127
/obj/structure/flora/ausbushes/ywflowers = 1,
128128
/obj/structure/flora/ausbushes/ppflowers = 1,
129129
/obj/structure/flora/ausbushes/fullgrass = 1,
130+
/obj/structure/herb/lantern = 1,
130131
)
131132

132133
weighted_openfloor_spawn_list = list(
@@ -149,7 +150,8 @@
149150
/obj/structure/flora/ausbushes/lavendergrass = 1,
150151
/obj/structure/flora/ausbushes/ywflowers = 1,
151152
/obj/structure/flora/ausbushes/ppflowers = 1,
152-
/obj/structure/flora/ausbushes/fullgrass = 1
153+
/obj/structure/flora/ausbushes/fullgrass = 1,
154+
/obj/structure/herb/lantern = 1,
153155
)
154156

155157
/turf/open/floor/plating/dirt/jungleland/backrooms //fullbright backrooms? in this economy?

code/game/area/areas.dm

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@
136136
/// Whether the lights in this area aren't turned off when it's empty at roundstart
137137
var/lights_always_start_on = FALSE
138138

139+
/// Whether to cycle brightness based on time of day
140+
var/uses_daylight = FALSE
139141

140142
/**
141143
* A list of teleport locations
@@ -185,6 +187,8 @@ GLOBAL_LIST_EMPTY(teleportlocs)
185187
if (unique)
186188
GLOB.areas_by_type[type] = src
187189
GLOB.areas += src
190+
if(uses_daylight)
191+
SSdaylight.add_lit_area(src)
188192
return ..()
189193

190194
/**
@@ -381,6 +385,9 @@ GLOBAL_LIST_EMPTY(teleportlocs)
381385
if(!isnull(GLOB.delta_areas))
382386
GLOB.delta_areas -= src
383387

388+
//daylight cleanup
389+
if(uses_daylight)
390+
SSdaylight.remove_lit_area(src)
384391
//machinery cleanup
385392
STOP_PROCESSING(SSobj, src)
386393
//turf cleanup

code/modules/holiday/holidays.dm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ Since Ramadan is an entire month that lasts 29.5 days on average, the start and
654654
*/
655655

656656
/datum/holiday/ramadan/shouldCelebrate(dd, mm, yy, ww, ddd)
657-
return (round(((world.realtime - 285984000) / 864000) % 354.373435326843) == 0)
657+
return (round(((world.realtime - 285984000) / MIDNIGHT_ROLLOVER) % 354.373435326843) == 0)
658658

659659
/datum/holiday/ramadan/getStationPrefix()
660660
return pick("Harm","Halaal","Jihad","Muslim")
@@ -663,7 +663,7 @@ Since Ramadan is an entire month that lasts 29.5 days on average, the start and
663663
name = "End of Ramadan"
664664

665665
/datum/holiday/ramadan/end/shouldCelebrate(dd, mm, yy, ww, ddd)
666-
return (round(((world.realtime - 312768000) / 864000) % 354.373435326843) == 0)
666+
return (round(((world.realtime - 312768000) / MIDNIGHT_ROLLOVER) % 354.373435326843) == 0)
667667

668668
/datum/holiday/lifeday
669669
name = "Life Day"
-36 Bytes
Binary file not shown.

yogstation.dme

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,7 @@
420420
#include "code\controllers\subsystem\callback.dm"
421421
#include "code\controllers\subsystem\chat.dm"
422422
#include "code\controllers\subsystem\communications.dm"
423+
#include "code\controllers\subsystem\daylight.dm"
423424
#include "code\controllers\subsystem\dbcore.dm"
424425
#include "code\controllers\subsystem\dcs.dm"
425426
#include "code\controllers\subsystem\demo.dm"

yogstation/code/datums/mapgen/biomes/JungleBiomes.dm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@
9494
/obj/structure/flora/rock/pile = 20,
9595
/obj/structure/flora/stump = 20,
9696
/obj/structure/flora/tree/jungle = 10,
97-
/obj/structure/herb/cinchona = 1,
97+
/obj/structure/herb/lantern = 2,
98+
/obj/structure/herb/cinchona = 1,
9899
/obj/structure/flytrap = 1
99100
)
100101
loose_flora_density = 10
@@ -207,6 +208,7 @@
207208
/obj/structure/flora/ausbushes/leafybush = 20,
208209
/obj/structure/flora/ausbushes/sparsegrass = 20,
209210
/obj/structure/flora/ausbushes/fullgrass = 20,
211+
/obj/structure/herb/lantern = 3,
210212
/obj/structure/herb/fruit = 4,
211213
/obj/structure/flytrap = 2,
212214
/obj/structure/herb/explosive_shrooms = 1

yogstation/code/game/area/areas/ruins/jungleland.dm

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/area/ruin/unpowered/ivymen
22
icon_state = "red"
3-
static_lighting = FALSE
4-
base_lighting_alpha = 255
3+
uses_daylight = TRUE
54

65
/area/ruin/unpowered/tar_temple
76
icon_state = "red"

0 commit comments

Comments
 (0)