From 12c7b283bfc78e1bbfb91476bd68ed9d13712bf9 Mon Sep 17 00:00:00 2001 From: Fluffy <65877598+FluffyGhoster@users.noreply.github.com> Date: Sat, 2 Nov 2024 11:40:12 +0100 Subject: [PATCH] Fix mechs taking damage from sandstorms (#20107) Fix mechs taking damage from sandstorms Fixes #19487 --- code/modules/weather/weather_fsm_states.dm | 13 +++++ .../fluffyghost-fixmechsandstormdamage.yml | 58 +++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 html/changelogs/fluffyghost-fixmechsandstormdamage.yml diff --git a/code/modules/weather/weather_fsm_states.dm b/code/modules/weather/weather_fsm_states.dm index fd3006952dc..21059e73886 100644 --- a/code/modules/weather/weather_fsm_states.dm +++ b/code/modules/weather/weather_fsm_states.dm @@ -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) diff --git a/html/changelogs/fluffyghost-fixmechsandstormdamage.yml b/html/changelogs/fluffyghost-fixmechsandstormdamage.yml new file mode 100644 index 00000000000..697ecc14b85 --- /dev/null +++ b/html/changelogs/fluffyghost-fixmechsandstormdamage.yml @@ -0,0 +1,58 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# - (fixes bugs) +# wip +# - (work in progress) +# qol +# - (quality of life) +# soundadd +# - (adds a sound) +# sounddel +# - (removes a sound) +# rscadd +# - (adds a feature) +# rscdel +# - (removes a feature) +# imageadd +# - (adds an image or sprite) +# imagedel +# - (removes an image or sprite) +# spellcheck +# - (fixes spelling or grammar) +# experiment +# - (experimental change) +# balance +# - (balance changes) +# code_imp +# - (misc internal code change) +# refactor +# - (refactors code) +# config +# - (makes a change to the config files) +# admin +# - (makes changes to administrator tools) +# server +# - (miscellaneous changes to server) +################################# + +# Your name. +author: FluffyGhost + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, this gets changed to [] after reading. Just remove the brackets when you add new shit. +# Please surround your changes in double quotes ("). It works without them, but if you use certain characters it screws up compiling. The quotes will not show up in the changelog. +changes: + - bugfix: "Fix mechs taking damage from sandstorms."