Skip to content

Commit

Permalink
eyecheck fix (cmss13-devs#4212)
Browse files Browse the repository at this point in the history
# About the pull request

<!-- Remove this text and explain what the purpose of your PR is.

Mention if you have tested your changes. If you changed a map, make sure
you used the mapmerge tool.
If this is an Issue Correction, you can type "Fixes Issue #169420" to
link the PR to the corresponding Issue number #169420.

Remember: something that is self-evident to you might not be to others.
Explain your rationale fully, even if you feel it goes without saying.
-->

# Explain why it's good for the game
fixes cmss13-devs#4190 
bug bad

# Testing Photographs and Procedure
<details>
<summary>Screenshots & Videos</summary>

Put screenshots and videos here with an empty line between the
screenshots and the `<details>` tags.

</details>


# Changelog
:cl:
fix: Glasses with flash protection can no longer be used for welding.
refactor: Adds defines for negative welding protection.
/:cl:

---------

Co-authored-by: harryob <[email protected]>
  • Loading branch information
Diegoflores31 and harryob authored Aug 26, 2023
1 parent 607268a commit 72d4396
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
1 change: 1 addition & 0 deletions code/__DEFINES/conflict.dm
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@
#define UNIFORM_HAS_SENSORS 1
#define UNIFORM_FORCED_SENSORS 2

#define EYE_PROTECTION_NEGATIVE -1
#define EYE_PROTECTION_NONE 0
#define EYE_PROTECTION_FLAVOR 1
#define EYE_PROTECTION_FLASH 2
Expand Down
19 changes: 12 additions & 7 deletions code/game/objects/items/tools/maintenance_tools.dm
Original file line number Diff line number Diff line change
Expand Up @@ -380,22 +380,27 @@
if(E.robotic == ORGAN_ROBOT)
return
switch(safety)
if(1)
if(EYE_PROTECTION_FLASH)
to_chat(user, SPAN_DANGER("You see a bright light in the corner of your vision."))
E.take_damage(rand(0, 1), TRUE)
if(E.damage > 10)
E.take_damage(rand(3, 5), TRUE)
if(EYE_PROTECTION_FLAVOR)
to_chat(user, SPAN_DANGER("Your eyes sting a little."))
E.take_damage(rand(1, 2), TRUE)
if(E.damage > 12)
H.AdjustEyeBlur(3,6)
if(0)
if(E.damage > 8) // dont abuse your funny flavor glasses
E.take_damage(2, TRUE)
if(EYE_PROTECTION_NONE)
to_chat(user, SPAN_WARNING("Your eyes burn."))
E.take_damage(rand(2, 4), TRUE)
E.take_damage(rand(3, 4), TRUE)
if(E.damage > 10)
E.take_damage(rand(4, 10), TRUE)
if(-1)
if(EYE_PROTECTION_NEGATIVE)
to_chat(user, SPAN_WARNING("Your thermals intensify [src]'s glow. Your eyes itch and burn severely."))
H.AdjustEyeBlur(12,20)
E.take_damage(rand(12, 16), TRUE)

if(safety < 2)
if(safety < EYE_PROTECTION_WELDING)
if (E.damage >= E.min_broken_damage)
to_chat(H, SPAN_WARNING("You go blind! Maybe welding without protection wasn't such a great idea..."))
return FALSE
Expand Down
1 change: 1 addition & 0 deletions code/modules/clothing/glasses/night.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
vision_flags = SEE_TURFS
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE
fullscreen_vision = null
eye_protection = EYE_PROTECTION_NEGATIVE

/obj/item/clothing/glasses/night/helmet //for the integrated NVGs that are in helmetgarb code
name = "\improper M2 night vision goggles"
Expand Down
2 changes: 1 addition & 1 deletion code/modules/clothing/glasses/thermal.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE
darkness_view = 12
invisa_view = 2
eye_protection = -1
eye_protection = EYE_PROTECTION_NEGATIVE
deactive_state = "goggles_off"
fullscreen_vision = /atom/movable/screen/fullscreen/thermal
var/blinds_on_emp = TRUE
Expand Down

0 comments on commit 72d4396

Please sign in to comment.