From def5872da84c6ff68061596f47795c0566fc1e6b Mon Sep 17 00:00:00 2001
From: AndroBetel <44546836+AndroBetel@users.noreply.github.com>
Date: Fri, 20 Sep 2024 02:24:15 +0300
Subject: [PATCH] 2
---
code/__DEFINES/traits.dm | 2 ++
code/game/atoms.dm | 8 ++++++++
code/game/objects/items/devices/helmet_visors.dm | 4 ++++
code/modules/clothing/head/helmet.dm | 2 --
code/modules/mob/mob_defines.dm | 2 ++
code/modules/movement/movement.dm | 7 +++++++
code/modules/projectiles/gun.dm | 2 ++
7 files changed, 25 insertions(+), 2 deletions(-)
diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm
index a7e78e2c26..f244d3c64c 100644
--- a/code/__DEFINES/traits.dm
+++ b/code/__DEFINES/traits.dm
@@ -243,6 +243,8 @@
#define TRAIT_SPEC(spec_type) "t_spec_[spec_type]"
/// If the mob won't drop items held in face slot when downed
#define TRAIT_IRON_TEETH "t_iron_teeth"
+/// If the mob won't drop items held in face slot when downed
+#define TRAIT_HUD_SIGHT "t_hud_sight"
// -- ability traits --
/// Xenos with this trait cannot have plasma transfered to them
diff --git a/code/game/atoms.dm b/code/game/atoms.dm
index 36dcef935f..fe510d7e9c 100644
--- a/code/game/atoms.dm
+++ b/code/game/atoms.dm
@@ -834,3 +834,11 @@ Parameters are passed from New.
var/refid = REF(src)
. += "[VV_HREF_TARGETREF(refid, VV_HK_AUTO_RENAME, "[src]")]"
. += "
<< [dir2text(dir) || dir] >>"
+
+/atom/MouseEntered(location, control, params)
+ if(usr.face_mouse)
+ usr.face_atom(src)
+
+/atom/MouseExited(location, control, params)
+ if(usr.face_mouse)
+ usr.face_atom(src)
\ No newline at end of file
diff --git a/code/game/objects/items/devices/helmet_visors.dm b/code/game/objects/items/devices/helmet_visors.dm
index ac1c7e6b51..d39022af50 100644
--- a/code/game/objects/items/devices/helmet_visors.dm
+++ b/code/game/objects/items/devices/helmet_visors.dm
@@ -66,6 +66,8 @@
user.client.mouse_pointer_icon = 'icons/effects/cursors/aim_reticle.dmi'
user.client.color = "#E0FFFF"
user.overlay_fullscreen("optic", /atom/movable/screen/fullscreen/flash/noise/nvg)
+ ADD_TRAIT(user, TRAIT_HUD_SIGHT, src)
+ user.face_mouse = FALSE
/// Called by toggle_visor() to deactivate the visor's effects
/obj/item/device/helmet_visor/proc/deactivate_visor(obj/item/clothing/head/helmet/marine/attached_helmet, mob/living/carbon/human/user)
@@ -74,6 +76,8 @@
user.client.mouse_pointer_icon = initial(user.client.mouse_pointer_icon)
user.client.color = initial(user.client.color)
user.clear_fullscreen("optic", 0.5 SECONDS)
+ REMOVE_TRAIT(user, TRAIT_HUD_SIGHT, src)
+ user.face_mouse = FALSE
/// Called by /obj/item/clothing/head/helmet/marine/get_examine_text(mob/user) to get extra examine text for this visor
/obj/item/device/helmet_visor/proc/get_helmet_examine_text()
diff --git a/code/modules/clothing/head/helmet.dm b/code/modules/clothing/head/helmet.dm
index caa38d8888..7270af9b44 100644
--- a/code/modules/clothing/head/helmet.dm
+++ b/code/modules/clothing/head/helmet.dm
@@ -727,8 +727,6 @@ GLOBAL_LIST_INIT(allowed_helmet_items, list(
iterator++
for(var/obj/item/device/helmet_visor/new_visor in total_visors)
- if(!isnull(GLOB.huds[new_visor.hud_type]?.hudusers[user]))
- continue
if(!new_visor.can_toggle(user))
continue
diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm
index c04a745ea1..b08bcd78e6 100644
--- a/code/modules/mob/mob_defines.dm
+++ b/code/modules/mob/mob_defines.dm
@@ -265,6 +265,8 @@
// contains /atom/movable/screen/alert only
var/list/alerts = list()
+ var/face_mouse = FALSE
+
/mob/vv_get_dropdown()
. = ..()
VV_DROPDOWN_OPTION(VV_HK_EXPLODE, "Trigger Explosion")
diff --git a/code/modules/movement/movement.dm b/code/modules/movement/movement.dm
index 35dbb44481..e72e638992 100644
--- a/code/modules/movement/movement.dm
+++ b/code/modules/movement/movement.dm
@@ -64,8 +64,15 @@
var/old_dir = dir
. = ..()
+
if (flags_atom & DIRLOCK)
setDir(old_dir)
+
+ else if(ismob(src))
+ var/mob/mob = src
+ if(mob.face_mouse)
+ setDir(old_dir)
+
else if(old_dir != direct)
setDir(direct)
l_move_time = world.time
diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm
index 50e735b918..e06e15adec 100644
--- a/code/modules/projectiles/gun.dm
+++ b/code/modules/projectiles/gun.dm
@@ -1706,6 +1706,8 @@ not all weapons use normal magazines etc. load_into_chamber() itself is designed
skill_accuracy = -1
else
skill_accuracy = user.skills.get_skill_level(SKILL_FIREARMS)
+ if(HAS_TRAIT(user, TRAIT_HUD_SIGHT))
+ skill_accuracy += 1
if(skill_accuracy)
gun_accuracy_mult += skill_accuracy * HIT_ACCURACY_MULT_TIER_3 // Accuracy mult increase/decrease per level is equal to attaching/removing a red dot sight