From 6cbb0e3ca8c103d385e546ebef4dca7c11571453 Mon Sep 17 00:00:00 2001
From: kevinz000 <2003111+kevinz000@users.noreply.github.com>
Date: Sun, 8 Dec 2019 19:44:26 -0700
Subject: [PATCH 01/12] Update good.dm
---
code/datums/traits/good.dm | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/code/datums/traits/good.dm b/code/datums/traits/good.dm
index 09a4f0b060..abd1279f61 100644
--- a/code/datums/traits/good.dm
+++ b/code/datums/traits/good.dm
@@ -188,3 +188,18 @@
/datum/quirk/bloodpressure/remove()
var/mob/living/M = quirk_holder
M.blood_ratio = 1
+
+/datum/quirk/night_vision
+ name = "Night Vision"
+ desc = "You can see slightly more clearly in full darkness than most people."
+ value = 1
+ mob_trait = TRAIT_NIGHT_VISION
+ gain_text = "The shadows seem a little less dark."
+ lose_text = "Everything seems a little darker."
+
+/datum/quirk/night_vision/on_spawn()
+ var/mob/living/carbon/human/H = quirk_holder
+ var/obj/item/organ/eyes/eyes = H.getorgan(/obj/item/organ/eyes)
+ if(!eyes || eyes.lighting_alpha)
+ return
+ eyes.Insert(H) //refresh their eyesight and vision
From c38f4989be41afd3a3500f39e7df19eb891a8329 Mon Sep 17 00:00:00 2001
From: kevinz000 <2003111+kevinz000@users.noreply.github.com>
Date: Sun, 8 Dec 2019 19:45:27 -0700
Subject: [PATCH 02/12] Update eyes.dm
---
code/modules/surgery/organs/eyes.dm | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/code/modules/surgery/organs/eyes.dm b/code/modules/surgery/organs/eyes.dm
index 34943babdc..4834d8ff7a 100644
--- a/code/modules/surgery/organs/eyes.dm
+++ b/code/modules/surgery/organs/eyes.dm
@@ -1,3 +1,5 @@
+#define NIGHT_VISION_DARKSIGHT_RANGE 3
+
/obj/item/organ/eyes
name = BODY_ZONE_PRECISE_EYES
icon_state = "eyeballs"
@@ -47,7 +49,7 @@
H.dna?.species?.handle_body() //regenerate eyeballs overlays.
if(HAS_TRAIT(H, TRAIT_NIGHT_VISION) && !lighting_alpha)
lighting_alpha = LIGHTING_PLANE_ALPHA_NV_TRAIT
- see_in_dark = 8
+ see_in_dark = NIGHT_VISION_DARKSIGHT_RANGE
M.update_tint()
owner.update_sight()
From 3e559b6d38520e9d6559789545ffb1c0c78e0071 Mon Sep 17 00:00:00 2001
From: kevinz000 <2003111+kevinz000@users.noreply.github.com>
Date: Sun, 8 Dec 2019 19:46:38 -0700
Subject: [PATCH 03/12] Update lighting.dm
---
code/__DEFINES/lighting.dm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/code/__DEFINES/lighting.dm b/code/__DEFINES/lighting.dm
index 13dccc74fe..07e25c8515 100644
--- a/code/__DEFINES/lighting.dm
+++ b/code/__DEFINES/lighting.dm
@@ -59,7 +59,7 @@
#define LIGHT_RANGE_FIRE 3 //How many tiles standard fires glow.
#define LIGHTING_PLANE_ALPHA_VISIBLE 255
-#define LIGHTING_PLANE_ALPHA_NV_TRAIT 250
+#define LIGHTING_PLANE_ALPHA_NV_TRAIT 192
#define LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE 192
#define LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE 128 //For lighting alpha, small amounts lead to big changes. even at 128 its hard to figure out what is dark and what is light, at 64 you almost can't even tell.
#define LIGHTING_PLANE_ALPHA_INVISIBLE 0
@@ -80,4 +80,4 @@
#define FLASH_LIGHT_DURATION 2
#define FLASH_LIGHT_POWER 3
-#define FLASH_LIGHT_RANGE 3.8
\ No newline at end of file
+#define FLASH_LIGHT_RANGE 3.8
From c0f8a42e0f9be137e8d1f5b8b3653031244b10d3 Mon Sep 17 00:00:00 2001
From: kevinz000 <2003111+kevinz000@users.noreply.github.com>
Date: Sun, 8 Dec 2019 19:49:15 -0700
Subject: [PATCH 04/12] Update eyes.dm
---
code/modules/surgery/organs/eyes.dm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/code/modules/surgery/organs/eyes.dm b/code/modules/surgery/organs/eyes.dm
index 4834d8ff7a..76b2510f15 100644
--- a/code/modules/surgery/organs/eyes.dm
+++ b/code/modules/surgery/organs/eyes.dm
@@ -1,4 +1,4 @@
-#define NIGHT_VISION_DARKSIGHT_RANGE 3
+#define NIGHT_VISION_DARKSIGHT_RANGE 2
/obj/item/organ/eyes
name = BODY_ZONE_PRECISE_EYES
From 762cd00a5fed1bd801ae4e564af9ec835c9a6991 Mon Sep 17 00:00:00 2001
From: kevinz000 <2003111+kevinz000@users.noreply.github.com>
Date: Sun, 15 Dec 2019 16:55:56 -0700
Subject: [PATCH 05/12] Update eyes.dm
---
code/modules/surgery/organs/eyes.dm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/code/modules/surgery/organs/eyes.dm b/code/modules/surgery/organs/eyes.dm
index 76b2510f15..4834d8ff7a 100644
--- a/code/modules/surgery/organs/eyes.dm
+++ b/code/modules/surgery/organs/eyes.dm
@@ -1,4 +1,4 @@
-#define NIGHT_VISION_DARKSIGHT_RANGE 2
+#define NIGHT_VISION_DARKSIGHT_RANGE 3
/obj/item/organ/eyes
name = BODY_ZONE_PRECISE_EYES
From ea84526661fe667bef74d796cb66ad5bf84f4ca8 Mon Sep 17 00:00:00 2001
From: kevinz000 <2003111+kevinz000@users.noreply.github.com>
Date: Sun, 15 Dec 2019 16:58:44 -0700
Subject: [PATCH 06/12] Update good.dm
---
code/datums/traits/good.dm | 2 --
1 file changed, 2 deletions(-)
diff --git a/code/datums/traits/good.dm b/code/datums/traits/good.dm
index abd1279f61..3684b230dd 100644
--- a/code/datums/traits/good.dm
+++ b/code/datums/traits/good.dm
@@ -200,6 +200,4 @@
/datum/quirk/night_vision/on_spawn()
var/mob/living/carbon/human/H = quirk_holder
var/obj/item/organ/eyes/eyes = H.getorgan(/obj/item/organ/eyes)
- if(!eyes || eyes.lighting_alpha)
- return
eyes.Insert(H) //refresh their eyesight and vision
From 745297632d6ced5fa5cae48a5ad6b11d7d945435 Mon Sep 17 00:00:00 2001
From: kevinz000 <2003111+kevinz000@users.noreply.github.com>
Date: Sun, 15 Dec 2019 16:59:09 -0700
Subject: [PATCH 07/12] Update lighting.dm
---
code/__DEFINES/lighting.dm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/code/__DEFINES/lighting.dm b/code/__DEFINES/lighting.dm
index 07e25c8515..f41e029b10 100644
--- a/code/__DEFINES/lighting.dm
+++ b/code/__DEFINES/lighting.dm
@@ -59,7 +59,7 @@
#define LIGHT_RANGE_FIRE 3 //How many tiles standard fires glow.
#define LIGHTING_PLANE_ALPHA_VISIBLE 255
-#define LIGHTING_PLANE_ALPHA_NV_TRAIT 192
+#define LIGHTING_PLANE_ALPHA_NV_TRAIT 160
#define LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE 192
#define LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE 128 //For lighting alpha, small amounts lead to big changes. even at 128 its hard to figure out what is dark and what is light, at 64 you almost can't even tell.
#define LIGHTING_PLANE_ALPHA_INVISIBLE 0
From ce5c42f323264256c3ad668058fe2eb1c9bd422f Mon Sep 17 00:00:00 2001
From: kevinz000 <2003111+kevinz000@users.noreply.github.com>
Date: Sun, 15 Dec 2019 17:02:00 -0700
Subject: [PATCH 08/12] Update good.dm
---
code/datums/traits/good.dm | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/code/datums/traits/good.dm b/code/datums/traits/good.dm
index 3684b230dd..adada13783 100644
--- a/code/datums/traits/good.dm
+++ b/code/datums/traits/good.dm
@@ -199,5 +199,4 @@
/datum/quirk/night_vision/on_spawn()
var/mob/living/carbon/human/H = quirk_holder
- var/obj/item/organ/eyes/eyes = H.getorgan(/obj/item/organ/eyes)
- eyes.Insert(H) //refresh their eyesight and vision
+ H.update_sight()
From e496b7c39724ea21d6719b90f6d9bbd1af1d20a9 Mon Sep 17 00:00:00 2001
From: kevinz000 <2003111+kevinz000@users.noreply.github.com>
Date: Sun, 15 Dec 2019 17:02:43 -0700
Subject: [PATCH 09/12] Update eyes.dm
---
code/modules/surgery/organs/eyes.dm | 6 ------
1 file changed, 6 deletions(-)
diff --git a/code/modules/surgery/organs/eyes.dm b/code/modules/surgery/organs/eyes.dm
index 4834d8ff7a..febd59a174 100644
--- a/code/modules/surgery/organs/eyes.dm
+++ b/code/modules/surgery/organs/eyes.dm
@@ -1,5 +1,3 @@
-#define NIGHT_VISION_DARKSIGHT_RANGE 3
-
/obj/item/organ/eyes
name = BODY_ZONE_PRECISE_EYES
icon_state = "eyeballs"
@@ -47,13 +45,9 @@
eye_color = H.eye_color
if(!special)
H.dna?.species?.handle_body() //regenerate eyeballs overlays.
- if(HAS_TRAIT(H, TRAIT_NIGHT_VISION) && !lighting_alpha)
- lighting_alpha = LIGHTING_PLANE_ALPHA_NV_TRAIT
- see_in_dark = NIGHT_VISION_DARKSIGHT_RANGE
M.update_tint()
owner.update_sight()
-
/obj/item/organ/eyes/Remove(mob/living/carbon/M, special = 0)
clear_eye_trauma()
. = ..()
From e08b5b814f881be22f1a91e5a4e996b31c9d4c8b Mon Sep 17 00:00:00 2001
From: kevinz000 <2003111+kevinz000@users.noreply.github.com>
Date: Sun, 15 Dec 2019 17:04:23 -0700
Subject: [PATCH 10/12] Update lighting.dm
---
code/__DEFINES/lighting.dm | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/code/__DEFINES/lighting.dm b/code/__DEFINES/lighting.dm
index f41e029b10..95d63e205b 100644
--- a/code/__DEFINES/lighting.dm
+++ b/code/__DEFINES/lighting.dm
@@ -59,11 +59,13 @@
#define LIGHT_RANGE_FIRE 3 //How many tiles standard fires glow.
#define LIGHTING_PLANE_ALPHA_VISIBLE 255
-#define LIGHTING_PLANE_ALPHA_NV_TRAIT 160
+#define LIGHTING_PLANE_ALPHA_NV_TRAIT 175
#define LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE 192
#define LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE 128 //For lighting alpha, small amounts lead to big changes. even at 128 its hard to figure out what is dark and what is light, at 64 you almost can't even tell.
#define LIGHTING_PLANE_ALPHA_INVISIBLE 0
+#define NIGHT_VISION_DARKSIGHT_RANGE 3
+
//lighting area defines
#define DYNAMIC_LIGHTING_DISABLED 0 //dynamic lighting disabled (area stays at full brightness)
#define DYNAMIC_LIGHTING_ENABLED 1 //dynamic lighting enabled
From 0190054c972597829a80621dc60ca126bbccd64b Mon Sep 17 00:00:00 2001
From: kevinz000 <2003111+kevinz000@users.noreply.github.com>
Date: Sun, 15 Dec 2019 17:08:41 -0700
Subject: [PATCH 11/12] Update carbon.dm
---
code/modules/mob/living/carbon/carbon.dm | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm
index 3a9495a5cb..faac4fdf44 100644
--- a/code/modules/mob/living/carbon/carbon.dm
+++ b/code/modules/mob/living/carbon/carbon.dm
@@ -585,6 +585,9 @@
sight |= E.sight_flags
if(!isnull(E.lighting_alpha))
lighting_alpha = E.lighting_alpha
+ if(HAS_TRAIT(src, TRAIT_NIGHT_VISION))
+ lighting_alpha = min(LIGHTING_PLANE_ALPHA_NV_TRAIT, lighting_alpha)
+ see_in_dark = max(NIGHT_VISION_DARKSIGHT_RANGE, see_in_dark)
if(client.eye && client.eye != src)
var/atom/A = client.eye
@@ -960,4 +963,4 @@
/mob/living/carbon/transfer_ckey(mob/new_mob, send_signal = TRUE)
if(combatmode)
toggle_combat_mode(TRUE, TRUE)
- return ..()
\ No newline at end of file
+ return ..()
From 06cbb381d3bbb0f3acb88be96bbcf6f3b3d141f4 Mon Sep 17 00:00:00 2001
From: Ghom <42542238+Ghommie@users.noreply.github.com>
Date: Sat, 21 Dec 2019 15:17:29 +0100
Subject: [PATCH 12/12] Better safe than sorry.
---
code/__DEFINES/lighting.dm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/code/__DEFINES/lighting.dm b/code/__DEFINES/lighting.dm
index 95d63e205b..89c702e605 100644
--- a/code/__DEFINES/lighting.dm
+++ b/code/__DEFINES/lighting.dm
@@ -59,7 +59,7 @@
#define LIGHT_RANGE_FIRE 3 //How many tiles standard fires glow.
#define LIGHTING_PLANE_ALPHA_VISIBLE 255
-#define LIGHTING_PLANE_ALPHA_NV_TRAIT 175
+#define LIGHTING_PLANE_ALPHA_NV_TRAIT 223
#define LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE 192
#define LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE 128 //For lighting alpha, small amounts lead to big changes. even at 128 its hard to figure out what is dark and what is light, at 64 you almost can't even tell.
#define LIGHTING_PLANE_ALPHA_INVISIBLE 0