Fix mechs taking damage from sandstorms (#20107)

Fix mechs taking damage from sandstorms

Fixes #19487
This commit is contained in:
Fluffy
2024-11-02 10:40:12 +00:00
committed by GitHub
parent 6268a9e50f
commit 12c7b283bf
2 changed files with 71 additions and 0 deletions
@@ -215,6 +215,19 @@ ABSTRACT_TYPE(/singleton/state/weather)
else if(isipc(M) || issilicon(M)) //Metal is more durable than meat
to_chat(M, SPAN_DANGER("Your chassis is scratched by a gust of stinging sand!"))
M.apply_damage(1, DAMAGE_BRUTE)
//Mechs do not take damage from sandstorms, but if the mech is open, the pilots get damaged
//let the mechanistoids weep at the concept of the gigachad 25th century mechanicus contraptions that do not suffer from weather
else if(ismech(M))
var/mob/living/heavy_vehicle/mech = M
for(var/mob/living/pilot in mech.pilots)
if(mech.hatch_closed)
to_chat(pilot, SPAN_DANGER("Your mech canopy is blasted by a gust of stinging sand!"))
else
to_chat(pilot, SPAN_DANGER("You are blasted by a gust of stinging sand from the open hatch!"))
src.handle_exposure_effects(pilot, weather) //We basically recurse this same function for the pilots so it handles the damages etc without repeating the code
return //Done, mechs don't need any further processing
else
to_chat(M, SPAN_DANGER("You are blasted by a gust of stinging sand!"))
M.apply_damage(rand(1,3), DAMAGE_BRUTE)