|
28 | 28 |
|
29 | 29 | immunity_type = WEATHER_RAIN |
30 | 30 |
|
31 | | - probability = 20 |
| 31 | + probability = 40 |
32 | 32 |
|
33 | 33 | barometer_predictable = TRUE |
34 | 34 |
|
|
65 | 65 |
|
66 | 66 | /datum/weather/rain/weather_act(mob/living/L) |
67 | 67 | 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) |
68 | 69 | L.adjust_wet_stacks(3*log(2, (50*L.get_permeability(null, TRUE) + 10) / 10)) |
69 | 70 | L.extinguish_mob() // permeability affects the negative fire stacks but not the extinguishing |
70 | 71 |
|
|
93 | 94 | * So people can be immune to acid but not wet or immune to wet but not acid |
94 | 95 | */ |
95 | 96 |
|
96 | | - probability = 80 |
| 97 | + probability = 60 |
97 | 98 |
|
98 | 99 | barometer_predictable = TRUE |
99 | 100 |
|
|
127 | 128 | return TRUE |
128 | 129 | L = L.loc //Check parent items immunities (recurses up to the turf) |
129 | 130 | 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 | + |
0 commit comments