Skip to content

Commit

Permalink
Add frost anomaly
Browse files Browse the repository at this point in the history
  • Loading branch information
ThePooba committed Nov 27, 2024
1 parent 780da9e commit d1a502d
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#define MIN_REPLACEMENT 2
#define MAX_REPLACEMENT 7
#define MAX_RANGE 7

//THE STATION MUST SURVIVE
/obj/effect/anomaly/frost
name = "glacial anomaly"
icon_state = "pyroclastic"
/// How many seconds between each gas release
var/releasedelay = 10
aSignal = /obj/item/assembly/signaler/anomaly/frost

/obj/effect/anomaly/frost/anomalyEffect(seconds_per_tick)
..()

if(isspaceturf(src) || !isopenturf(get_turf(src)))
return

var/turf/current_location = get_turf(src)
var/list/valid_turfs = list()
var/static/list/blacklisted_turfs = typecacheof(list(
/turf/closed,
/turf/open/space,
/turf/open/lava,
/turf/open/chasm,
/turf/open/floor/plating/asteroid/snow))

current_location.atmos_spawn_air ("o2=2;freon=1;water_vapor=8;TEMP=180")

for(var/searched_turfs in circle_view_turfs(src, MAX_RANGE))
if(is_type_in_typecache(searched_turfs, blacklisted_turfs))
continue
else
valid_turfs |= searched_turfs
for(var/i = 1, i <= rand(MIN_REPLACEMENT, MAX_REPLACEMENT), i++) //Replace 2-7 tiles with snow
var/turf/searched_turfs = safepick(valid_turfs)
if(searched_turfs)
if(istype(searched_turfs, /turf/open/floor/plating))
searched_turfs.PlaceOnTop(/turf/open/floor/plating/asteroid/snow)
else
searched_turfs.ChangeTurf(/turf/open/floor/plating/asteroid/snow)

/obj/effect/anomaly/frost/detonate()
//The station holds its breath, waiting for whatever the end will bring.
if(isinspace(src) || !isopenturf(get_turf(src)))
return
var/turf/current_location = get_turf(src)
current_location.atmos_spawn_air("water_vapor=200;freon=100;o2=100;TEMP=140") //The cold will be brutal. The water in hydroponics will freeze. We'll have to make do with the food we've stockpiled.

#undef MIN_REPLACEMENT
#undef MAX_REPLACEMENT
#undef MAX_RANGE
21 changes: 21 additions & 0 deletions monkestation/code/modules/events/anomaly/anomaly_frost.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/datum/round_event_control/anomaly/anomaly_frost
name = "Anomaly: Frost"
description = "The white frost comes."
typepath = /datum/round_event/anomaly/anomaly_frost

max_occurrences = 5
weight = 10
min_players = 20

min_wizard_trigger_potency = 1
max_wizard_trigger_potency = 4
track = EVENT_TRACK_MODERATE
tags = list(TAG_SPOOKY)

/datum/round_event/anomaly/anomaly_frost
start_when = ANOMALY_START_HARMFUL_TIME
announce_when = ANOMALY_ANNOUNCE_HARMFUL_TIME
anomaly_path = /obj/effect/anomaly/frost

/datum/round_event/anomaly/anomaly_frost/announce(fake)
priority_announce("Frost Anomaly detected in: [impact_area.name]. Brace for the cold.", "Anomaly Alert", 'monkestation/sound/misc/frost_horn.ogg')

0 comments on commit d1a502d

Please sign in to comment.