Skip to content

Commit

Permalink
2
Browse files Browse the repository at this point in the history
  • Loading branch information
AndroBetel committed Sep 19, 2024
1 parent a3233da commit def5872
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 2 deletions.
2 changes: 2 additions & 0 deletions code/__DEFINES/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions code/game/atoms.dm
Original file line number Diff line number Diff line change
Expand Up @@ -834,3 +834,11 @@ Parameters are passed from New.
var/refid = REF(src)
. += "[VV_HREF_TARGETREF(refid, VV_HK_AUTO_RENAME, "<b id='name'>[src]</b>")]"
. += "<br><font size='1'><a href='?_src_=vars;[HrefToken()];rotatedatum=[refid];rotatedir=left'><<</a> <a href='?_src_=vars;[HrefToken()];datumedit=[refid];varnameedit=dir' id='dir'>[dir2text(dir) || dir]</a> <a href='?_src_=vars;[HrefToken()];rotatedatum=[refid];rotatedir=right'>>></a></font>"

/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)
4 changes: 4 additions & 0 deletions code/game/objects/items/devices/helmet_visors.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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()
Expand Down
2 changes: 0 additions & 2 deletions code/modules/clothing/head/helmet.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions code/modules/mob/mob_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
7 changes: 7 additions & 0 deletions code/modules/movement/movement.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions code/modules/projectiles/gun.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit def5872

Please sign in to comment.