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

Commit 1dbfed3

Browse files
authored
Adds a fullscreen visual effect to standing outside in rain or acid rain (#22551)
1 parent e6fd335 commit 1dbfed3

File tree

4 files changed

+72
-2
lines changed

4 files changed

+72
-2
lines changed

code/datums/status_effects/debuffs/fire_stacks.dm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#define MOB_BIG_FIRE_STACK_THRESHOLD 3
33

44
/datum/status_effect/fire_handler
5+
id = "fire_handler"
56
duration = -1
67
alert_type = null
78
status_type = STATUS_EFFECT_REFRESH //Custom code

code/datums/weather/weather_types/acid_rain.dm

Lines changed: 71 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
immunity_type = WEATHER_RAIN
3030

31-
probability = 20
31+
probability = 40
3232

3333
barometer_predictable = TRUE
3434

@@ -65,6 +65,7 @@
6565

6666
/datum/weather/rain/weather_act(mob/living/L)
6767
if(L.mind || L.client) //could be pretty intensive, so only do this to things with players in them
68+
L.apply_status_effect(/datum/status_effect/raindrops)
6869
L.adjust_wet_stacks(3*log(2, (50*L.get_permeability(null, TRUE) + 10) / 10))
6970
L.extinguish_mob() // permeability affects the negative fire stacks but not the extinguishing
7071

@@ -93,7 +94,7 @@
9394
* So people can be immune to acid but not wet or immune to wet but not acid
9495
*/
9596

96-
probability = 80
97+
probability = 60
9798

9899
barometer_predictable = TRUE
99100

@@ -127,3 +128,71 @@
127128
return TRUE
128129
L = L.loc //Check parent items immunities (recurses up to the turf)
129130
return FALSE //RIP you
131+
132+
133+
/**
134+
* I am squeezing every last drop of brain power to make this
135+
*/
136+
137+
/**
138+
* this keeps track of the overlay and all raindrops
139+
*/
140+
/datum/status_effect/raindrops
141+
id = "raindrops"
142+
duration = 3 SECONDS
143+
status_type = STATUS_EFFECT_REFRESH
144+
/// Fullscreen effect used to provide the visual to that player and only that player
145+
var/atom/movable/screen/fullscreen/raindrops/holder
146+
147+
/datum/status_effect/raindrops/on_creation(mob/living/new_owner, ...)
148+
. = ..()
149+
holder = new_owner.overlay_fullscreen("raindrops", /atom/movable/screen/fullscreen/raindrops)
150+
151+
/datum/status_effect/raindrops/tick(delta_time, times_fired) //happening here for now
152+
. = ..()
153+
tick_interval = rand(0, 5) //next drop happens in a random amount of time
154+
for(var/i in rand(1,2))
155+
droplet()
156+
157+
/datum/status_effect/raindrops/proc/droplet()
158+
var/obj/effect/temp_visual/raindrops/onedrop = new(owner) //put it inside the mob so it follows the player as they move
159+
onedrop.pixel_x += rand(-80, 480)
160+
onedrop.pixel_y += rand(-80, 480) //get put somewhere randomly on the screen
161+
//because it's a downscaled large image, it starts out in the bottom left corner by default
162+
holder.vis_contents += onedrop
163+
164+
/datum/status_effect/raindrops/refresh(effect, ...) //also spawn a droplet every time we're refreshed, makes the rain look far more dense if we're standing outside
165+
for(var/i in rand(1,2))
166+
droplet()
167+
return ..()
168+
169+
/datum/status_effect/raindrops/on_remove()
170+
owner.clear_fullscreen("raindrops")
171+
if(holder && !QDELETED(holder))
172+
qdel(holder)
173+
return ..()
174+
175+
/**
176+
* This provides the images to only the person with it
177+
*/
178+
/atom/movable/screen/fullscreen/raindrops
179+
icon_state = "raindrops"
180+
appearance_flags = PIXEL_SCALE | RESET_TRANSFORM
181+
plane = GRAVITY_PULSE_PLANE
182+
183+
/**
184+
* this is an individual raindrop, multiple of these are spawned and added to the fullscreen to emulate random raindrops
185+
*/
186+
/obj/effect/temp_visual/raindrops
187+
plane = GRAVITY_PULSE_PLANE
188+
icon = 'yogstation/icons/effects/160x160.dmi' //massive picture for smoother edges
189+
icon_state = "raindrop"
190+
appearance_flags = PIXEL_SCALE | RESET_TRANSFORM
191+
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
192+
duration = (0.8 SECONDS) //fades out over this time, not too long, not too slow
193+
194+
/obj/effect/temp_visual/raindrops/Initialize(mapload)
195+
. = ..()
196+
transform = matrix()/5 //we do this so it can larger if needed
197+
animate(src, alpha = 0, time = duration)
198+

icons/effects/weather_effects.dmi

-297 Bytes
Binary file not shown.
6.43 KB
Binary file not shown.

0 commit comments

Comments
 (0)