Skip to content

Commit 556ef06

Browse files
authored
Bugs 6.16.24 (#994)
* fix catatonic message * mention mutadone in ryetalyn * gravity * remove spatial instability * whoops * fix weather overlays
1 parent 9c00c71 commit 556ef06

File tree

10 files changed

+119
-122
lines changed

10 files changed

+119
-122
lines changed

code/__DEFINES/traits.dm

+2
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,8 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
343343
/// Makes you flashable from any direction
344344
#define TRAIT_FLASH_SENSITIVE "flash_sensitive"
345345
#define TRAIT_NAIVE "naive"
346+
/// always detect storm weathers
347+
#define TRAIT_DETECT_STORM "detect_storm"
346348
#define TRAIT_PRIMITIVE "primitive"
347349
#define TRAIT_GUNFLIP "gunflip"
348350
/// Increases chance of getting special traumas, makes them harder to cure

code/datums/mutations/body.dm

-30
Original file line numberDiff line numberDiff line change
@@ -302,36 +302,6 @@
302302
return
303303
owner.physiology.burn_mod *= 2
304304

305-
/datum/mutation/human/badblink
306-
name = "Spatial Instability"
307-
desc = "The victim of the mutation has a very weak link to spatial reality, and may be displaced. Often causes extreme nausea."
308-
quality = NEGATIVE
309-
text_gain_indication = "<span class='warning'>The space around you twists sickeningly.</span>"
310-
text_lose_indication = "<span class='notice'>The space around you settles back to normal.</span>"
311-
difficulty = 18//high so it's hard to unlock and abuse
312-
instability = 10
313-
synchronizer_coeff = 1
314-
energy_coeff = 1
315-
power_coeff = 1
316-
var/warpchance = 0
317-
318-
/datum/mutation/human/badblink/on_life(delta_time, times_fired)
319-
if(DT_PROB(warpchance, delta_time))
320-
var/warpmessage = pick(
321-
span_warning("With a sickening 720-degree twist of [owner.p_their()] back, [owner] vanishes into thin air."),
322-
span_warning("[owner] does some sort of strange backflip into another dimension. It looks pretty painful."),
323-
span_warning("[owner] does a jump to the left, a step to the right, and warps out of reality."),
324-
span_warning("[owner]'s torso starts folding inside out until it vanishes from reality, taking [owner] with it."),
325-
span_warning("One moment, you see [owner]. The next, [owner] is gone."))
326-
owner.visible_message(warpmessage, span_userdanger("You feel a wave of nausea as you fall through reality!"))
327-
var/warpdistance = rand(10, 15) * GET_MUTATION_POWER(src)
328-
do_teleport(owner, get_turf(owner), warpdistance, channel = TELEPORT_CHANNEL_FREE)
329-
owner.adjust_disgust(GET_MUTATION_SYNCHRONIZER(src) * (warpchance * warpdistance))
330-
warpchance = 0
331-
owner.visible_message(span_danger("[owner] appears out of nowhere!"))
332-
else
333-
warpchance += 0.0625 * GET_MUTATION_ENERGY(src) * delta_time
334-
335305
/datum/mutation/human/acidflesh
336306
name = "Acidic Flesh"
337307
desc = "Subject has acidic chemicals building up underneath the skin. This is often lethal."

code/datums/weather/weather.dm

+78-51
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,16 @@
5959
/// 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.
6060
var/overlay_layer = AREA_LAYER
6161
/// Plane for the overlay
62-
var/overlay_plane = ABOVE_LIGHTING_PLANE
62+
var/overlay_plane = AREA_PLANE
6363
/// If the weather has no purpose other than looks
6464
var/aesthetic = FALSE
6565
/// Used by mobs (or movables containing mobs, such as enviro bags) to prevent them from being affected by the weather.
6666
var/immunity_type
67+
/// If this bit of weather should also draw an overlay that's uneffected by lighting onto the area
68+
/// Taken from weather_glow.dmi
69+
var/use_glow = TRUE
70+
/// List of all overlays to apply to our turfs
71+
var/list/overlay_cache
6772

6873
/// The stage of the weather, from 1-4
6974
var/stage = END_STAGE
@@ -94,35 +99,33 @@
9499
/datum/weather/proc/telegraph(get_to_the_good_part)
95100
if(stage == STARTUP_STAGE)
96101
return
102+
97103
SEND_GLOBAL_SIGNAL(COMSIG_WEATHER_TELEGRAPH(type))
98104
stage = STARTUP_STAGE
105+
99106
var/list/affectareas = list()
100107
for(var/V in get_areas(area_type))
101108
affectareas += V
109+
102110
for(var/V in protected_areas)
103111
affectareas -= get_areas(V)
112+
104113
for(var/V in affectareas)
105114
var/area/A = V
106115
if(protect_indoors && !A.outdoors)
107116
continue
108117
if(A.z in impacted_z_levels)
109118
impacted_areas |= A
119+
110120
weather_duration = rand(weather_duration_lower, weather_duration_upper)
111121
SSweather.processing |= src
112122
update_areas()
113-
if(!get_to_the_good_part)
114-
for(var/z_level in impacted_z_levels)
115-
for(var/mob/player as anything in SSmobs.clients_by_zlevel[z_level])
116-
var/turf/mob_turf = get_turf(player)
117-
if(!mob_turf)
118-
continue
119-
if(telegraph_message)
120-
to_chat(player, telegraph_message)
121-
if(telegraph_sound)
122-
SEND_SOUND(player, sound(telegraph_sound))
123-
addtimer(CALLBACK(src, PROC_REF(start)), telegraph_duration)
124-
else
123+
124+
if(get_to_the_good_part)
125125
start()
126+
else
127+
send_alert(telegraph_message, telegraph_sound)
128+
addtimer(CALLBACK(src, PROC_REF(start)), telegraph_duration)
126129

127130
/**
128131
* Starts the actual weather and effects from it
@@ -134,18 +137,13 @@
134137
/datum/weather/proc/start()
135138
if(stage >= MAIN_STAGE)
136139
return
140+
137141
SEND_GLOBAL_SIGNAL(COMSIG_WEATHER_START(type))
142+
138143
stage = MAIN_STAGE
139144
update_areas()
140-
for(var/z_level in impacted_z_levels)
141-
for(var/mob/player as anything in SSmobs.clients_by_zlevel[z_level])
142-
var/turf/mob_turf = get_turf(player)
143-
if(!mob_turf)
144-
continue
145-
if(weather_message)
146-
to_chat(player, weather_message)
147-
if(weather_sound)
148-
SEND_SOUND(player, sound(weather_sound))
145+
146+
send_alert(weather_message, weather_sound)
149147
if(!perpetual)
150148
addtimer(CALLBACK(src, PROC_REF(wind_down)), weather_duration)
151149

@@ -159,18 +157,13 @@
159157
/datum/weather/proc/wind_down()
160158
if(stage >= WIND_DOWN_STAGE)
161159
return
160+
162161
SEND_GLOBAL_SIGNAL(COMSIG_WEATHER_WINDDOWN(type))
163162
stage = WIND_DOWN_STAGE
163+
164164
update_areas()
165-
for(var/z_level in impacted_z_levels)
166-
for(var/mob/player as anything in SSmobs.clients_by_zlevel[z_level])
167-
var/turf/mob_turf = get_turf(player)
168-
if(!mob_turf)
169-
continue
170-
if(end_message)
171-
to_chat(player, end_message)
172-
if(end_sound)
173-
SEND_SOUND(player, sound(end_sound))
165+
166+
send_alert(end_message, end_sound)
174167
addtimer(CALLBACK(src, PROC_REF(end)), end_duration)
175168

176169
/**
@@ -183,11 +176,30 @@
183176
/datum/weather/proc/end()
184177
if(stage == END_STAGE)
185178
return
179+
186180
SEND_GLOBAL_SIGNAL(COMSIG_WEATHER_END(type))
187181
stage = END_STAGE
182+
188183
SSweather.processing -= src
189184
update_areas()
190185

186+
/datum/weather/proc/send_alert(alert_msg, alert_sfx)
187+
for(var/z_level in impacted_z_levels)
188+
for(var/mob/player as anything in SSmobs.clients_by_zlevel[z_level])
189+
if(!can_get_alert(player))
190+
continue
191+
192+
if(telegraph_message)
193+
to_chat(player, alert_msg)
194+
195+
if(telegraph_sound)
196+
SEND_SOUND(player, sound(alert_sfx))
197+
198+
// the checks for if a mob should recieve alerts, returns TRUE if can
199+
/datum/weather/proc/can_get_alert(mob/player)
200+
var/turf/mob_turf = get_turf(player)
201+
return !isnull(mob_turf)
202+
191203
/**
192204
* Returns TRUE if the living mob can be affected by the weather
193205
*
@@ -227,23 +239,38 @@
227239
*
228240
*/
229241
/datum/weather/proc/update_areas()
230-
for(var/V in impacted_areas)
231-
var/area/N = V
232-
N.layer = overlay_layer
233-
N.plane = overlay_plane
234-
N.icon = 'icons/effects/weather_effects.dmi'
235-
N.color = weather_color
236-
switch(stage)
237-
if(STARTUP_STAGE)
238-
N.icon_state = telegraph_overlay
239-
if(MAIN_STAGE)
240-
N.icon_state = weather_overlay
241-
if(WIND_DOWN_STAGE)
242-
N.icon_state = end_overlay
243-
if(END_STAGE)
244-
N.color = null
245-
N.icon_state = ""
246-
N.icon = null
247-
N.layer = initial(N.layer)
248-
N.plane = initial(N.plane)
249-
N.set_opacity(FALSE)
242+
var/list/new_overlay_cache = generate_overlay_cache()
243+
for(var/area/impacted as anything in impacted_areas)
244+
if(length(overlay_cache))
245+
impacted.overlays -= overlay_cache
246+
if(length(new_overlay_cache))
247+
impacted.overlays += new_overlay_cache
248+
249+
overlay_cache = new_overlay_cache
250+
251+
/// Returns a list of visual offset -> overlays to use
252+
/datum/weather/proc/generate_overlay_cache()
253+
// We're ending, so no overlays at all
254+
if(stage == END_STAGE)
255+
return list()
256+
257+
var/weather_state = ""
258+
switch(stage)
259+
if(STARTUP_STAGE)
260+
weather_state = telegraph_overlay
261+
if(MAIN_STAGE)
262+
weather_state = weather_overlay
263+
if(WIND_DOWN_STAGE)
264+
weather_state = end_overlay
265+
266+
var/list/gen_overlay_cache = list()
267+
if(use_glow)
268+
var/mutable_appearance/glow_image = mutable_appearance('icons/effects/glow_weather.dmi', weather_state, overlay_layer, ABOVE_LIGHTING_PLANE, 100)
269+
glow_image.color = weather_color
270+
gen_overlay_cache += glow_image
271+
272+
var/mutable_appearance/weather_image = mutable_appearance('icons/effects/weather_effects.dmi', weather_state, overlay_layer, plane = overlay_plane)
273+
weather_image.color = weather_color
274+
gen_overlay_cache += weather_image
275+
276+
return gen_overlay_cache

code/datums/weather/weather_types/snow_storm.dm

+23-1
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,30 @@
2222
immunity_type = TRAIT_SNOWSTORM_IMMUNE
2323

2424
barometer_predictable = TRUE
25-
25+
use_glow = FALSE
2626

2727
/datum/weather/snow_storm/weather_act(mob/living/L)
2828
L.adjust_bodytemperature(-rand(5,15))
2929

30+
// since snowstorm is on a station z level, add extra checks to not annoy everyone
31+
/datum/weather/snow_storm/can_get_alert(mob/player)
32+
if(!..())
33+
return FALSE
34+
35+
if(!is_station_level(player.z))
36+
return TRUE // bypass checks
37+
38+
if(isobserver(player))
39+
return TRUE
40+
41+
if(HAS_TRAIT(player, TRAIT_DETECT_STORM))
42+
return TRUE
43+
44+
if(istype(get_area(player), /area/mine))
45+
return TRUE
46+
47+
for(var/area/snow_area in impacted_areas)
48+
if(locate(snow_area) in view(player))
49+
return TRUE
50+
51+
return FALSE

code/game/area/areas.dm

-17
Original file line numberDiff line numberDiff line change
@@ -295,23 +295,6 @@ GLOBAL_LIST_EMPTY(teleportlocs)
295295
for(var/obj/machinery/door/door in src)
296296
close_and_lock_door(door)
297297

298-
/**
299-
* Update the icon state of the area
300-
*
301-
* Im not sure what the heck this does, somethign to do with weather being able to set icon
302-
* states on areas?? where the heck would that even display?
303-
*/
304-
/area/update_icon_state()
305-
var/weather_icon
306-
for(var/V in SSweather.processing)
307-
var/datum/weather/W = V
308-
if(W.stage != END_STAGE && (src in W.impacted_areas))
309-
W.update_areas()
310-
weather_icon = TRUE
311-
if(!weather_icon)
312-
icon_state = null
313-
return ..()
314-
315298
/**
316299
* Update the icon of the area (overridden to always be null for space
317300
*/

code/game/atoms.dm

+10-9
Original file line numberDiff line numberDiff line change
@@ -2033,18 +2033,19 @@
20332033
return 0
20342034

20352035
var/list/forced_gravity = list()
2036-
if(SEND_SIGNAL(src, COMSIG_ATOM_HAS_GRAVITY, gravity_turf, forced_gravity))
2037-
if(!length(forced_gravity))
2038-
SEND_SIGNAL(gravity_turf, COMSIG_TURF_HAS_GRAVITY, src, forced_gravity)
2036+
SEND_SIGNAL(src, COMSIG_ATOM_HAS_GRAVITY, gravity_turf, forced_gravity)
2037+
SEND_SIGNAL(gravity_turf, COMSIG_TURF_HAS_GRAVITY, src, forced_gravity)
2038+
if(length(forced_gravity))
2039+
var/positive_grav = max(forced_gravity)
2040+
var/negative_grav = min(min(forced_gravity), 0) //negative grav needs to be below or equal to 0
20392041

2040-
var/max_grav = 0
2041-
for(var/i in forced_gravity)//our gravity is the strongest return forced gravity we get
2042-
max_grav = max(max_grav, i)
2043-
//cut so we can reuse the list, this is ok since forced gravity movers are exceedingly rare compared to all other movement
2044-
return max_grav
2042+
//our gravity is sum of the most massive positive and negative numbers returned by the signal
2043+
//so that adding two forced_gravity elements with an effect size of 1 each doesnt add to 2 gravity
2044+
//but negative force gravity effects can cancel out positive ones
20452045

2046-
var/area/turf_area = gravity_turf.loc
2046+
return (positive_grav + negative_grav)
20472047

2048+
var/area/turf_area = gravity_turf.loc
20482049
return !gravity_turf.force_no_gravity && (turf_area.has_gravity || SSmapping.gravity_by_zlevel[gravity_turf.z])
20492050

20502051
/**

code/game/objects/items/dna_injector.dm

-8
Original file line numberDiff line numberDiff line change
@@ -376,14 +376,6 @@
376376
name = "\improper DNA injector (Anti-Shock Touch)"
377377
remove_mutations = list(/datum/mutation/human/shock)
378378

379-
/obj/item/dnainjector/spatialinstability
380-
name = "\improper DNA injector (Spatial Instability)"
381-
add_mutations = list(/datum/mutation/human/badblink)
382-
383-
/obj/item/dnainjector/antispatialinstability
384-
name = "\improper DNA injector (Anti-Spatial Instability)"
385-
remove_mutations = list(/datum/mutation/human/badblink)
386-
387379
/obj/item/dnainjector/acidflesh
388380
name = "\improper DNA injector (Acid Flesh)"
389381
add_mutations = list(/datum/mutation/human/acidflesh)

code/modules/mob/living/carbon/human/examine.dm

+5-5
Original file line numberDiff line numberDiff line change
@@ -297,11 +297,11 @@
297297
if(HAS_TRAIT(src, TRAIT_SOFT_CRITICAL_CONDITION))
298298
msg += "[t_He] [t_is] barely conscious.\n"
299299

300-
if(getorgan(/obj/item/organ/brain))
301-
if(ai_controller?.ai_status == AI_STATUS_ON)
302-
msg += "[span_deadsay("[t_He] do[t_es]n't appear to be [t_him]self.")]\n"
303-
else if(!key)
304-
msg += "[span_deadsay("[t_He] [t_is] totally catatonic. The stresses of life in deep-space must have been too much for [t_him]. Any recovery is unlikely.")]\n"
300+
if(getorgan(/obj/item/organ/brain))
301+
if(ai_controller?.ai_status == AI_STATUS_ON)
302+
msg += "[span_deadsay("[t_He] do[t_es]n't appear to be [t_him]self.")]\n"
303+
else if(!key)
304+
msg += "[span_deadsay("[t_He] [t_is] totally catatonic. The stresses of life in deep-space must have been too much for [t_him]. Any recovery is unlikely.")]\n"
305305

306306
if (length(msg))
307307
. += span_warning("[msg.Join("")]")

code/modules/reagents/chemistry/reagents/medicine_reagents.dm

+1-1
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@
668668

669669
/datum/reagent/medicine/ryetalyn
670670
name = "Ryetalyn"
671-
description = "Ryetalyn can cure all genetic mutations and abnormalities via a catalytic process."
671+
description = "Ryetalyn can cure all genetic mutations and abnormalities via a catalytic process. Known by the brand name \"Mutadone\"."
672672
taste_description = "acid"
673673
reagent_state = SOLID
674674
color = "#004000"

icons/effects/glow_weather.dmi

8.64 KB
Binary file not shown.

0 commit comments

Comments
 (0)