alright we're good i think (#22614)

This commit is contained in:
Chubbygummibear
2024-09-21 20:48:15 -07:00
committed by GitHub
parent c1a98a5568
commit b77e228140
21 changed files with 356 additions and 89 deletions

View File

@@ -1,5 +1,7 @@
/// Sent from /datum/hud/proc/on_eye_change(): (atom/old_eye, atom/new_eye)
#define COMSIG_HUD_EYE_CHANGED "hud_eye_changed"
/// Sent from /datum/hud/proc/eye_z_changed() : (new_z)
#define COMSIG_HUD_Z_CHANGED "hud_z_changed"
/// Sent from /datum/hud/proc/eye_z_changed() : (old_offset, new_offset)
#define COMSIG_HUD_OFFSET_CHANGED "hud_offset_changed"
/// Sent from /atom/movable/screen/lobby/button/collapse/proc/collapse_buttons() : ()

View File

@@ -0,0 +1,2 @@
/// from /datum/plane_master_group/proc/set_hud(): (datum/hud/new_hud)
#define COMSIG_GROUP_HUD_CHANGED "group_hud_changed"

View File

@@ -13,18 +13,18 @@
#define PLANE_SPACE -21
#define PLANE_SPACE_PARALLAX -20
#define GRAVITY_PULSE_PLANE -12
#define GRAVITY_PULSE_PLANE -19
#define GRAVITY_PULSE_RENDER_TARGET "*GRAVPULSE_RENDER_TARGET"
#define RENDER_PLANE_TRANSPARENT -11 //Transparent plane that shows openspace underneath the floor
#define RENDER_PLANE_TRANSPARENT -18 //Transparent plane that shows openspace underneath the floor
#define TRANSPARENT_FLOOR_PLANE -13
#define TRANSPARENT_FLOOR_PLANE -10
#define FLOOR_PLANE -12
#define FLOOR_PLANE_RENDER_TARGET "*FLOOR_PLANE"
#define WALL_PLANE -11
#define GAME_PLANE -10
#define ABOVE_GAME_PLANE -9
#define FLOOR_PLANE -6
#define WALL_PLANE -5
#define GAME_PLANE -4
#define ABOVE_GAME_PLANE -3
///Slightly above the game plane but does not catch mouse clicks. Useful for certain visuals that should be clicked through, like seethrough trees
#define SEETHROUGH_PLANE -2
@@ -32,10 +32,12 @@
#define DEFAULT_PLANE 0 //Marks out the default plane, even if we don't use it
#define WEATHER_PLANE 1
#define AREA_PLANE 2
#define MASSIVE_OBJ_PLANE 3
#define GHOST_PLANE 4
#define POINT_PLANE 5
#define MASSIVE_OBJ_PLANE 6
#define GHOST_PLANE 7
#define POINT_PLANE 8
//---------- LIGHTING -------------
///Normal 1 per turf dynamic lighting underlays
@@ -64,6 +66,7 @@
///Things that should render ignoring lighting
#define ABOVE_LIGHTING_PLANE 17
#define WEATHER_GLOW_PLANE 18
///---------------- MISC -----------------------

View File

@@ -0,0 +1,7 @@
//A reference to this list is passed into area sound managers, and it's modified in a manner that preserves that reference in ash_storm.dm
GLOBAL_LIST_EMPTY(ash_storm_sounds)
#define STARTUP_STAGE 1
#define MAIN_STAGE 2
#define WIND_DOWN_STAGE 3
#define END_STAGE 4

View File

@@ -195,6 +195,7 @@ GLOBAL_LIST_INIT(available_ui_styles, list(
SIGNAL_HANDLER
update_parallax_pref() // If your eye changes z level, so should your parallax prefs
var/turf/eye_turf = get_turf(eye)
SEND_SIGNAL(src, COMSIG_HUD_Z_CHANGED, eye_turf.z)
var/new_offset = GET_TURF_PLANE_OFFSET(eye_turf)
if(current_plane_offset == new_offset)
return

View File

@@ -24,28 +24,34 @@
build_plane_masters(0, SSmapping.max_plane_offset)
/datum/plane_master_group/Destroy()
orphan_hud()
set_hud(null)
QDEL_LIST_ASSOC_VAL(plane_masters)
return ..()
/datum/plane_master_group/proc/set_hud(datum/hud/new_hud)
if(new_hud == our_hud)
return
if(our_hud)
our_hud.master_groups -= key
hide_hud()
our_hud = new_hud
if(new_hud)
our_hud.master_groups[key] = src
show_hud()
transform_lower_turfs(our_hud, active_offset)
SEND_SIGNAL(src, COMSIG_GROUP_HUD_CHANGED, our_hud)
/// Display a plane master group to some viewer, so show all our planes to it
/datum/plane_master_group/proc/attach_to(datum/hud/viewing_hud)
if(viewing_hud.master_groups[key])
stack_trace("Hey brother, our key [key] is already in use by a plane master group on the passed in hud, belonging to [viewing_hud.mymob]. Ya fucked up, why are there dupes")
return
our_hud = viewing_hud
set_hud(viewing_hud)
our_hud.master_groups[key] = src
show_hud()
transform_lower_turfs(our_hud, active_offset)
/// Hide the plane master from its current hud, fully clear it out
/datum/plane_master_group/proc/orphan_hud()
if(our_hud)
our_hud.master_groups -= key
hide_hud()
our_hud = null
/// Well, refresh our group, mostly useful for plane specific updates
/datum/plane_master_group/proc/refresh_hud()
hide_hud()

View File

@@ -252,6 +252,17 @@
documentation = "Holds the areas themselves, which ends up meaning it holds any overlays/effects we apply to areas. NOT snow or rad storms, those go on above lighting"
plane = AREA_PLANE
/atom/movable/screen/plane_master/weather
name = "Weather"
documentation = "Holds the main tiling 32x32 sprites of weather. We mask against walls that are on the edge of weather effects."
plane = WEATHER_PLANE
/atom/movable/screen/plane_master/weather/set_home(datum/plane_master_group/home)
. = ..()
if(!.)
return
home.AddComponent(/datum/component/hide_weather_planes, src)
/atom/movable/screen/plane_master/massive_obj
name = "Massive object"
documentation = "Huge objects need to render above everything else on the game plane, otherwise they'd well, get clipped and look not that huge. This does that."
@@ -294,6 +305,16 @@
documentation = "Anything on the game plane that needs a space to draw on that will be above the lighting plane.\
<br>Mostly little alerts and effects, also sometimes contains things that are meant to look as if they glow."
/atom/movable/screen/plane_master/weather_glow
name = "Weather Glow"
documentation = "Holds the glowing parts of the main tiling 32x32 sprites of weather."
plane = WEATHER_GLOW_PLANE
/atom/movable/screen/plane_master/weather_glow/set_home(datum/plane_master_group/home)
. = ..()
if(!.)
return
home.AddComponent(/datum/component/hide_weather_planes, src)
/**
* Handles emissive overlays and emissive blockers.
*/

View File

@@ -349,7 +349,7 @@
if(!.)
return
RegisterSignal(mymob, COMSIG_MOB_SIGHT_CHANGE, PROC_REF(handle_sight))
RegisterSignal(mymob, COMSIG_MOB_SIGHT_CHANGE, PROC_REF(handle_sight), override = TRUE)
handle_sight(mymob, mymob.sight, NONE)
/atom/movable/screen/plane_master/rendering_plate/light_mask/hide_from(mob/oldmob)

View File

@@ -1,9 +1,4 @@
#define STARTUP_STAGE 1
#define MAIN_STAGE 2
#define WIND_DOWN_STAGE 3
#define END_STAGE 4
//Used for all kinds of weather, ex. lavaland ash storms.
/// Used for all kinds of weather, ex. lavaland ash storms.
SUBSYSTEM_DEF(weather)
name = "Weather"
flags = SS_BACKGROUND
@@ -16,25 +11,23 @@ SUBSYSTEM_DEF(weather)
/datum/controller/subsystem/weather/fire()
// process active weather
for(var/V in processing)
var/datum/weather/W = V
if(W.aesthetic || W.stage != MAIN_STAGE)
var/datum/weather/our_event = V
if(our_event.aesthetic || our_event.stage != MAIN_STAGE)
continue
for(var/i in GLOB.mob_living_list)
var/mob/living/L = i
if(W.can_weather_act(L))
W.weather_act(L)
for(var/mob/act_on as anything in GLOB.mob_living_list)
if(our_event.can_weather_act(act_on))
our_event.weather_act(act_on)
// start random weather on relevant levels
for(var/z in eligible_zlevels)
var/possible_weather = eligible_zlevels[z]
var/datum/weather/W = pickweight(possible_weather)
run_weather(W, list(text2num(z)))
var/datum/weather/our_event = pick_weight(possible_weather)
run_weather(our_event, list(text2num(z)))
eligible_zlevels -= z
var/randTime = rand(W.cooldown_lower, W.cooldown_higher)
addtimer(CALLBACK(src, PROC_REF(make_eligible), z, possible_weather), randTime + initial(W.weather_duration_upper), TIMER_UNIQUE) //Around 5-10 minutes between weathers
next_hit_by_zlevel["[z]"] = world.time + randTime + initial(W.telegraph_duration)
var/randTime = rand(our_event.cooldown_lower, our_event.cooldown_higher)
next_hit_by_zlevel["[z]"] = addtimer(CALLBACK(src, PROC_REF(make_eligible), z, possible_weather), randTime + initial(our_event.weather_duration_upper), TIMER_UNIQUE|TIMER_STOPPABLE) //Around 5-10 minutes between weathers
/datum/controller/subsystem/weather/Initialize(start_timeofday)
/datum/controller/subsystem/weather/Initialize()
for(var/V in subtypesof(/datum/weather))
var/datum/weather/W = V
var/probability = initial(W.probability)
@@ -75,17 +68,28 @@ SUBSYSTEM_DEF(weather)
var/datum/weather/W = new weather_datum_type(z_levels)
W.telegraph()
return W
/datum/controller/subsystem/weather/proc/make_eligible(z, possible_weather)
eligible_zlevels[z] = possible_weather
next_hit_by_zlevel["[z]"] = null
/datum/controller/subsystem/weather/proc/get_weather(z, area/active_area)
var/datum/weather/A
for(var/V in processing)
var/datum/weather/W = V
if((z in W.impacted_z_levels) && istype(active_area, W.area_type))
A = W
break
return A
var/datum/weather/A
for(var/V in processing)
var/datum/weather/W = V
if((z in W.impacted_z_levels) && W.area_type == active_area.type)
A = W
break
return A
///Returns an active storm by its type
/datum/controller/subsystem/weather/proc/get_weather_by_type(type)
return locate(type) in processing
// ADMIN_VERB(stop_weather, R_DEBUG|R_ADMIN, "Stop All Active Weather", "Stop all currently active weather.", ADMIN_CATEGORY_DEBUG)
// log_admin("[key_name(user)] stopped all currently active weather.")
// message_admins("[key_name_admin(user)] stopped all currently active weather.")
// for(var/datum/weather/current_weather as anything in SSweather.processing)
// if(current_weather in SSweather.processing)
// current_weather.end()
// BLACKBOX_LOG_ADMIN_VERB("Stop All Active Weather")

View File

@@ -0,0 +1,116 @@
/// Component that manages a list of plane masters that are dependent on weather
/// Force hides/shows them depending on the weather activity of their z stack
/// Applied to the plane master group that owns them
/datum/component/hide_weather_planes
dupe_mode = COMPONENT_DUPE_UNIQUE_PASSARGS
var/list/datum/weather/active_weather = list()
var/list/atom/movable/screen/plane_master/plane_masters = list()
/datum/component/hide_weather_planes/Initialize(atom/movable/screen/plane_master/care_about)
if(!istype(parent, /datum/plane_master_group))
return COMPONENT_INCOMPATIBLE
var/datum/plane_master_group/home = parent
plane_masters += care_about
RegisterSignal(care_about, COMSIG_QDELETING, PROC_REF(plane_master_deleted))
var/list/starting_signals = list()
var/list/ending_signals = list()
for(var/datum/weather/weather_type as anything in typesof(/datum/weather))
starting_signals += COMSIG_WEATHER_TELEGRAPH(weather_type)
ending_signals += COMSIG_WEATHER_END(weather_type)
RegisterSignals(SSdcs, starting_signals, PROC_REF(weather_started))
RegisterSignals(SSdcs, ending_signals, PROC_REF(weather_finished))
if(home.our_hud)
attach_hud(home.our_hud)
else
RegisterSignal(home, COMSIG_GROUP_HUD_CHANGED, PROC_REF(new_hud_attached))
/datum/component/hide_weather_planes/Destroy(force)
hide_planes()
active_weather = null
plane_masters = null
return ..()
/datum/component/hide_weather_planes/InheritComponent(datum/component/new_comp, i_am_original, atom/movable/screen/plane_master/care_about)
if(!i_am_original)
return
plane_masters += care_about
RegisterSignal(care_about, COMSIG_QDELETING, PROC_REF(plane_master_deleted))
if(length(active_weather))
care_about.enable_alpha()
else
care_about.disable_alpha()
/datum/component/hide_weather_planes/proc/new_hud_attached(datum/source, datum/hud/new_hud)
SIGNAL_HANDLER
if(new_hud)
attach_hud(new_hud)
/datum/component/hide_weather_planes/proc/attach_hud(datum/hud/new_hud)
RegisterSignal(new_hud, COMSIG_HUD_Z_CHANGED, PROC_REF(z_changed))
var/mob/eye = new_hud?.mymob?.client?.eye
var/turf/eye_location = get_turf(eye)
z_changed(new_hud, eye_location?.z)
/datum/component/hide_weather_planes/proc/plane_master_deleted(atom/movable/screen/plane_master/source)
SIGNAL_HANDLER
plane_masters -= source
/datum/component/hide_weather_planes/proc/display_planes()
var/datum/plane_master_group/home = parent
var/mob/our_lad = home.our_hud?.mymob
var/our_offset = GET_TURF_PLANE_OFFSET(our_lad)
for(var/atom/movable/screen/plane_master/weather_concious as anything in plane_masters)
//We need to make sure that planes above us are hidden, but below us are visible
if(!weather_concious.alpha_enabled && weather_concious.offset >= our_offset)
weather_concious.enable_alpha()
/datum/component/hide_weather_planes/proc/hide_planes()
for(var/atom/movable/screen/plane_master/weather_concious as anything in plane_masters)
weather_concious.disable_alpha()
/datum/component/hide_weather_planes/proc/z_changed(datum/source, new_z)
SIGNAL_HANDLER
/**
* We hide all impacted planes on z change first because weather planes on lower offsets will show through the game world
* so we can't count on them just not being visible like turfs above you. This is a result of attaching weather effects to areas,
* which aren't beholden to z-levels and planes like atoms we're used to
*/
hide_planes()
active_weather = list()
if(!SSmapping.initialized)
return
var/list/connected_levels = SSmapping.get_connected_levels(new_z)
for(var/datum/weather/active as anything in SSweather.processing)
if(length(connected_levels & active.impacted_z_levels))
active_weather += WEAKREF(active)
if(length(active_weather))
display_planes()
/datum/component/hide_weather_planes/proc/weather_started(datum/source, datum/weather/starting)
SIGNAL_HANDLER
var/datum/plane_master_group/home = parent
var/mob/eye = home.our_hud?.mymob?.client?.eye
var/turf/viewing_from = get_turf(eye)
if(!viewing_from)
return
var/list/connected_levels = SSmapping.get_connected_levels(viewing_from)
if(length(connected_levels & starting.impacted_z_levels))
active_weather += WEAKREF(starting)
if(!length(active_weather))
return
display_planes()
/datum/component/hide_weather_planes/proc/weather_finished(datum/source, datum/weather/stopping)
SIGNAL_HANDLER
active_weather -= WEAKREF(stopping)
if(length(active_weather))
return
hide_planes()

View File

@@ -0,0 +1,47 @@
/**
* The parent of this component will be destroyed if it's on the ground during a storm
*/
/datum/component/storm_hating
/// Types of weather which trigger the effect
var/static/list/stormy_weather = list(
/datum/weather/ash_storm,
/datum/weather/snow_storm,
/datum/weather/void_storm,
)
/datum/component/storm_hating/Initialize()
. = ..()
if (!isatom(parent))
return COMPONENT_INCOMPATIBLE
on_area_entered(parent, get_area(parent))
/datum/component/storm_hating/RegisterWithParent()
. = ..()
RegisterSignal(parent, COMSIG_ENTER_AREA, PROC_REF(on_area_entered))
RegisterSignal(parent, COMSIG_EXIT_AREA, PROC_REF(on_area_exited))
/datum/component/storm_hating/UnregisterFromParent()
. = ..()
on_area_exited(parent, get_area(parent))
UnregisterSignal(parent, COMSIG_ENTER_AREA)
RegisterSignal(parent, COMSIG_EXIT_AREA)
/datum/component/storm_hating/proc/on_area_entered(atom/source, area/new_area)
SIGNAL_HANDLER
for (var/weather in stormy_weather)
RegisterSignal(new_area, COMSIG_WEATHER_BEGAN_IN_AREA(weather), PROC_REF(on_storm_event))
RegisterSignal(new_area, COMSIG_WEATHER_ENDED_IN_AREA(weather), PROC_REF(on_storm_event))
/datum/component/storm_hating/proc/on_area_exited(atom/source, area/old_area)
SIGNAL_HANDLER
for (var/weather in stormy_weather)
UnregisterSignal(old_area, COMSIG_WEATHER_BEGAN_IN_AREA(weather))
UnregisterSignal(old_area, COMSIG_WEATHER_ENDED_IN_AREA(weather))
/datum/component/storm_hating/proc/on_storm_event()
SIGNAL_HANDLER
var/atom/parent_atom = parent
if (!isturf(parent_atom.loc))
return
parent.AddElement(/datum/element/temporary_atom, life_time = 3 SECONDS, fade_time = 2 SECONDS)
qdel(src)

View File

@@ -548,6 +548,16 @@ GLOBAL_LIST_INIT(total_uf_len_by_block, populate_total_uf_len_by_block())
/mob/living/carbon/has_dna()
return dna
/// Returns TRUE if the mob is allowed to mutate via its DNA, or FALSE if otherwise.
/// Only an organic Carbon with valid DNA may mutate; not robots, AIs, aliens, Ians, or other mobs.
/mob/proc/can_mutate()
return FALSE
/mob/living/carbon/can_mutate()
if(!(mob_biotypes & MOB_ORGANIC))
return FALSE
if(has_dna() && !HAS_TRAIT(src, TRAIT_GENELESS) && !HAS_TRAIT(src, TRAIT_BADDNA))
return TRUE
/// Sets the DNA of the mob to the given DNA.
/mob/living/carbon/human/proc/hardset_dna(unique_identity, list/mutation_index, list/default_mutation_genes, newreal_name, newblood_type, datum/species/mrace, newfeatures, list/mutations, force_transfer_mutations)

View File

@@ -0,0 +1,17 @@
/// Deletes the atom with a little fading out animation after a specified time
/datum/element/temporary_atom
/datum/element/temporary_atom/Attach(datum/target, life_time = 5 SECONDS, fade_time = 3 SECONDS)
. = ..()
if (!isatom(target))
return ELEMENT_INCOMPATIBLE
addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(qdel), WEAKREF(target)), life_time, TIMER_DELETE_ME)
if (life_time > fade_time && fade_time > 0)
addtimer(CALLBACK(src, PROC_REF(fade_out), WEAKREF(target), fade_time), life_time - fade_time, TIMER_DELETE_ME)
/datum/element/temporary_atom/proc/fade_out(datum/weakref/target_ref, fade_time)
var/atom/target = target_ref?.resolve()
if (isnull(target))
return
animate(target, alpha = 0, time = fade_time, flags = ANIMATION_PARALLEL)

View File

@@ -138,4 +138,3 @@
id = "alienlab"
description = "An abandoned abductor labaratory that reeks of iron."
suffix = "icemoon_underground_alien_lab.dmm"

View File

@@ -1,11 +1,17 @@
//The effects of weather occur across an entire z-level. For instance, lavaland has periodic ash storms that scorch most unprotected creatures.
/**
* Causes weather to occur on a z level in certain area types
*
* The effects of weather occur across an entire z-level. For instance, lavaland has periodic ash storms that scorch most unprotected creatures.
* Weather always occurs on different z levels at different times, regardless of weather type.
* Can have custom durations, targets, and can automatically protect indoor areas.
*
*/
/datum/weather
/// name of weather
var/name = "space wind"
/// description of weather
var/desc = "Heavy gusts of wind blanket the area, periodically knocking down anyone caught in the open."
/// The message displayed in chat to foreshadow the weather's beginning
var/telegraph_message = "<span class='warning'>The wind begins to pick up.</span>"
/// In deciseconds, how long from the beginning of the telegraph until the weather begins
@@ -55,14 +61,14 @@
/// The list of z-levels that this weather is actively affecting
var/impacted_z_levels
/// Since it's above everything else, this is the layer used by default. TURF_LAYER is below mobs and walls if you need to use that.
/// Since it's above everything else, this is the layer used by default.
var/overlay_layer = AREA_LAYER
/// Plane for the overlay
var/overlay_plane = AREA_PLANE
var/overlay_plane = WEATHER_PLANE
/// If the weather has no purpose other than looks
var/aesthetic = FALSE
/// Used by mobs (or movables containing mobs, such as enviro bags) to prevent them from being affected by the weather.
var/immunity_type = WEATHER_STORM
var/immunity_type
/// If this bit of weather should also draw an overlay that's uneffected by lighting onto the area
/// Taken from weather_glow.dmi
var/use_glow = TRUE
@@ -82,7 +88,7 @@
/// For barometers to know when the next storm will hit
var/next_hit_time = 0
/// This causes the weather to only end if forced to
var/perpetual = FALSE
var/perpetual = FALSE
/datum/weather/New(z_levels)
..()
@@ -98,7 +104,7 @@
/datum/weather/proc/telegraph()
if(stage == STARTUP_STAGE)
return
SEND_GLOBAL_SIGNAL(COMSIG_WEATHER_TELEGRAPH(type))
SEND_GLOBAL_SIGNAL(COMSIG_WEATHER_TELEGRAPH(type), src)
stage = STARTUP_STAGE
var/list/affectareas = list()
for(var/V in get_areas(area_type))
@@ -128,14 +134,14 @@
/datum/weather/proc/start()
if(stage >= MAIN_STAGE)
return
SEND_GLOBAL_SIGNAL(COMSIG_WEATHER_START(type))
SEND_GLOBAL_SIGNAL(COMSIG_WEATHER_START(type), src)
stage = MAIN_STAGE
update_areas()
send_alert(weather_message, weather_sound)
if(!perpetual)
addtimer(CALLBACK(src, PROC_REF(wind_down)), weather_duration)
for(var/area/impacted_area as anything in impacted_areas)
SEND_SIGNAL(impacted_area, COMSIG_WEATHER_BEGAN_IN_AREA(type))
SEND_SIGNAL(impacted_area, COMSIG_WEATHER_BEGAN_IN_AREA(type), src)
/**
* Weather enters the winding down phase, stops effects
@@ -147,7 +153,7 @@
/datum/weather/proc/wind_down()
if(stage >= WIND_DOWN_STAGE)
return
SEND_GLOBAL_SIGNAL(COMSIG_WEATHER_WINDDOWN(type))
SEND_GLOBAL_SIGNAL(COMSIG_WEATHER_WINDDOWN(type), src)
stage = WIND_DOWN_STAGE
update_areas()
send_alert(end_message, end_sound)
@@ -163,12 +169,12 @@
/datum/weather/proc/end()
if(stage == END_STAGE)
return
SEND_GLOBAL_SIGNAL(COMSIG_WEATHER_END(type))
SEND_GLOBAL_SIGNAL(COMSIG_WEATHER_END(type), src)
stage = END_STAGE
SSweather.processing -= src
update_areas()
for(var/area/impacted_area as anything in impacted_areas)
SEND_SIGNAL(impacted_area, COMSIG_WEATHER_ENDED_IN_AREA(type))
SEND_SIGNAL(impacted_area, COMSIG_WEATHER_ENDED_IN_AREA(type), src)
// handles sending all alerts
/datum/weather/proc/send_alert(alert_msg, alert_sfx)
@@ -218,7 +224,11 @@
return TRUE
/datum/weather/proc/weather_act(mob/living/L) //What effect does this weather have on the hapless mob?
/**
* Affects the mob with whatever the weather does
*
*/
/datum/weather/proc/weather_act(mob/living/L)
return
/**
@@ -259,12 +269,13 @@
// This method of applying one overlay per z layer has some minor downsides, in that it could lead to improperly doubled effects if some have alpha
// I prefer it to creating 2 extra plane masters however, so it's a cost I'm willing to pay
// LU
var/mutable_appearance/glow_overlay = mutable_appearance('icons/effects/glow_weather.dmi', weather_state, overlay_layer, null, ABOVE_LIGHTING_PLANE, 100, offset_const = offset)
glow_overlay.color = weather_color
gen_overlay_cache += glow_overlay
if(use_glow)
var/mutable_appearance/glow_overlay = mutable_appearance('icons/effects/glow_weather.dmi', weather_state, overlay_layer, null, WEATHER_GLOW_PLANE, 100, offset_const = offset)
glow_overlay.color = weather_color
gen_overlay_cache += glow_overlay
var/mutable_appearance/weather_overlay = mutable_appearance('icons/effects/weather_effects.dmi', weather_state, overlay_layer, plane = overlay_plane, offset_const = offset)
weather_overlay.color = weather_color
gen_overlay_cache += weather_overlay
var/mutable_appearance/new_weather_overlay = mutable_appearance('icons/effects/weather_effects.dmi', weather_state, overlay_layer, plane = overlay_plane, offset_const = offset)
new_weather_overlay.color = weather_color
gen_overlay_cache += new_weather_overlay
return gen_overlay_cache

View File

@@ -9,7 +9,6 @@
weather_message = span_boldwarning("Rain pours down around you!")
weather_overlay = "rain"
weather_color = "#69b6ff"
overlay_plane = HIGHEST_EVER_PLANE + 1 //why does this work, it shouldn't work, this is stupid and i hate it, why is this the ONLY thing that works, why won't it just show up normally, it shows up normally on lavaland, but not on jungleland, i don't understand it doesn't make any sense, this is all wrong
//lasts shorter
weather_duration_lower = 30 SECONDS

View File

@@ -18,33 +18,47 @@
area_type = /area
protected_areas = list(/area/maintenance, /area/ai_monitored/turret_protected/ai_upload, /area/ai_monitored/turret_protected/ai_upload_foyer,
/area/ai_monitored/turret_protected/ai, /area/storage/emergency/starboard, /area/storage/emergency/port, /area/shuttle, /area/ai_monitored/storage/satellite, /area/security/prison)
/area/ai_monitored/turret_protected/ai, /area/storage/emergency/starboard, /area/storage/emergency/port,
/area/shuttle, /area/ai_monitored/storage/satellite, /area/security/prison, /area/icemoon/underground)
target_trait = ZTRAIT_STATION
immunity_type = WEATHER_RAD
/// Chance we get a negative mutation, if we fail we get a positive one
var/negative_mutation_chance = 90
/// Chance we mutate
var/mutate_chance = 40
/datum/weather/rad_storm/telegraph()
..()
status_alarm(TRUE)
/datum/weather/rad_storm/weather_act(mob/living/L)
var/resist = L.getarmor(null, RAD)
if(prob(40))
if(ishuman(L))
if (!HAS_TRAIT(L,TRAIT_RADIMMUNE)) //if they dont have radimmune, continue
var/mob/living/carbon/human/H = L
if(H.dna && !HAS_TRAIT(H, TRAIT_GENELESS))
if(prob(max(0,100-resist)))
H.random_mutate_unique_identity()
H.random_mutate_unique_features()
if(prob(50))
if(prob(90))
H.easy_random_mutate(NEGATIVE+MINOR_NEGATIVE)
else
H.easy_random_mutate(POSITIVE)
H.domutcheck()
L.rad_act(20)
if(!prob(mutate_chance))
return
if(!ishuman(L))
return
var/mob/living/carbon/human/H = L
if(!H.can_mutate() || H.status_flags & GODMODE)
return
if(HAS_TRAIT(H, TRAIT_RADIMMUNE))
return
if(prob(max(0,100-resist)))
H.random_mutate_unique_identity()
H.random_mutate_unique_features()
if(prob(50))
if(prob(negative_mutation_chance))
H.easy_random_mutate(NEGATIVE+MINOR_NEGATIVE)
else
H.easy_random_mutate(POSITIVE)
H.domutcheck()
H.rad_act(20)
/datum/weather/rad_storm/start()
if(..())
@@ -58,9 +72,10 @@
return
priority_announce("The radiation threat has passed. Please return to your workplaces.", "Anomaly Alert")
status_alarm(FALSE)
sleep(1 MINUTES) // Want to give them time to get out of maintenance.
//sleep(1 MINUTES) // Want to give them time to get out of maintenance.
if(GLOB.emergency_access)
revoke_maint_all_access()
addtimer(CALLBACK(src, GLOBAL_PROC_REF(revoke_maint_all_access)), 1 MINUTES)
//revoke_maint_all_access()
/datum/weather/rad_storm/proc/status_alarm(active) //Makes the status displays show the radiation warning for those who missed the announcement.
var/datum/radio_frequency/frequency = SSradio.return_frequency(FREQ_STATUS_DISPLAYS)

View File

@@ -11,6 +11,7 @@
weather_overlay = "snow_storm"
weather_duration_lower = 600
weather_duration_upper = 1500
use_glow = FALSE
end_duration = 100
end_message = span_boldannounce("The snowfall dies down, it should be safe to go outside again.")

View File

@@ -10,4 +10,4 @@
//sound not longer matches the text, but an audible warning is probably good
/datum/round_event/radiation_storm/start()
SSweather.run_weather(/datum/weather/rad_storm, 2)//only the station has protected areas, so only target the station. also "detected near the station"
SSweather.run_weather(/datum/weather/rad_storm)//only the station has protected areas, so only target the station. also "detected near the station"

View File

@@ -166,6 +166,7 @@
#include "code\__DEFINES\vehicles.dm"
#include "code\__DEFINES\vv.dm"
#include "code\__DEFINES\wall_dents.dm"
#include "code\__DEFINES\weather.dm"
#include "code\__DEFINES\wires.dm"
#include "code\__DEFINES\wounds.dm"
#include "code\__DEFINES\construction\actions.dm"
@@ -188,7 +189,7 @@
#include "code\__DEFINES\dcs\signals\signals_global_object.dm"
#include "code\__DEFINES\dcs\signals\signals_greyscale.dm"
#include "code\__DEFINES\dcs\signals\signals_heretic.dm"
#include "code\__DEFINES\dcs\signals\signals_huds.dm"
#include "code\__DEFINES\dcs\signals\signals_hud.dm"
#include "code\__DEFINES\dcs\signals\signals_janitor.dm"
#include "code\__DEFINES\dcs\signals\signals_ladder.dm"
#include "code\__DEFINES\dcs\signals\signals_lazy_templates.dm"
@@ -200,6 +201,7 @@
#include "code\__DEFINES\dcs\signals\signals_movetype.dm"
#include "code\__DEFINES\dcs\signals\signals_nanite.dm"
#include "code\__DEFINES\dcs\signals\signals_object.dm"
#include "code\__DEFINES\dcs\signals\signals_plane_master_group.dm"
#include "code\__DEFINES\dcs\signals\signals_song.dm"
#include "code\__DEFINES\dcs\signals\signals_spell.dm"
#include "code\__DEFINES\dcs\signals\signals_storage.dm"
@@ -616,6 +618,7 @@
#include "code\datums\components\heal_react.dm"
#include "code\datums\components\heirloom.dm"
#include "code\datums\components\hide_highest_offset.dm"
#include "code\datums\components\hide_weather_planes.dm"
#include "code\datums\components\hot_ice.dm"
#include "code\datums\components\ice_walk.dm"
#include "code\datums\components\igniter.dm"
@@ -657,6 +660,7 @@
#include "code\datums\components\squeak.dm"
#include "code\datums\components\squishable.dm"
#include "code\datums\components\stationloving.dm"
#include "code\datums\components\storm_hating.dm"
#include "code\datums\components\summoning.dm"
#include "code\datums\components\surgery_bed.dm"
#include "code\datums\components\swarming.dm"
@@ -775,6 +779,7 @@
#include "code\datums\elements\speech_bubble_override.dm"
#include "code\datums\elements\squish.dm"
#include "code\datums\elements\strippable.dm"
#include "code\datums\elements\temporary_atom.dm"
#include "code\datums\elements\turf_transparency.dm"
#include "code\datums\elements\undertile.dm"
#include "code\datums\elements\update_icon_blocker.dm"

View File

@@ -5,6 +5,7 @@
area_type = /area
weather_overlay = "ash_storm"
telegraph_overlay = "light_ash"
weather_color = "#aa69ff" //6527a7
end_message = null
telegraph_duration = 10 SECONDS //actually give them a brief moment to react
end_duration = 1