Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit 10afa62

Browse files
committed
blindspot fadecode
1 parent 806e733 commit 10afa62

File tree

2 files changed

+45
-8
lines changed

2 files changed

+45
-8
lines changed

code/datums/traits/negative.dm

Lines changed: 43 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,18 +1027,55 @@
10271027
value = -2
10281028
medical_record_text = "Patient has trouble with spatial awareness."
10291029

1030+
#define BLINDSPOT_NORTH "blindspotN"
1031+
#define BLINDSPOT_SOUTH "blindspotS"
1032+
#define BLINDSPOT_EAST "blindspotE"
1033+
#define BLINDSPOT_WEST "blindspotW"
1034+
10301035
/datum/quirk/blindspot/add()
1031-
quirk_holder.overlay_fullscreen("blindspot", /atom/movable/screen/fullscreen/blindspot)
1032-
quirk_holder.blindspot_overlay = WEAKREF(quirk_holder.screens["blindspot"])
1036+
quirk_holder.blindspot_overlay = new/list(10)
1037+
quirk_holder.overlay_fullscreen(BLINDSPOT_NORTH, /atom/movable/screen/fullscreen/blindspot)
1038+
quirk_holder.overlay_fullscreen(BLINDSPOT_SOUTH, /atom/movable/screen/fullscreen/blindspot)
1039+
quirk_holder.overlay_fullscreen(BLINDSPOT_EAST, /atom/movable/screen/fullscreen/blindspot)
1040+
quirk_holder.overlay_fullscreen(BLINDSPOT_WEST, /atom/movable/screen/fullscreen/blindspot)
1041+
quirk_holder.blindspot_overlay[NORTH] = WEAKREF(quirk_holder.screens[BLINDSPOT_NORTH])
1042+
quirk_holder.blindspot_overlay[SOUTH] = WEAKREF(quirk_holder.screens[BLINDSPOT_SOUTH])
1043+
quirk_holder.blindspot_overlay[EAST] = WEAKREF(quirk_holder.screens[BLINDSPOT_EAST])
1044+
quirk_holder.blindspot_overlay[WEST] = WEAKREF(quirk_holder.screens[BLINDSPOT_WEST])
1045+
quirk_holder.screens[BLINDSPOT_NORTH].dir = NORTH
1046+
quirk_holder.screens[BLINDSPOT_SOUTH].dir = SOUTH
1047+
quirk_holder.screens[BLINDSPOT_EAST].dir = EAST
1048+
quirk_holder.screens[BLINDSPOT_WEST].dir = WEST
1049+
quirk_holder.screens[BLINDSPOT_NORTH].alpha = (quirk_holder.dir == NORTH) * 255
1050+
quirk_holder.screens[BLINDSPOT_SOUTH].alpha = (quirk_holder.dir == SOUTH) * 255
1051+
quirk_holder.screens[BLINDSPOT_EAST].alpha = (quirk_holder.dir == EAST) * 255
1052+
quirk_holder.screens[BLINDSPOT_WEST].alpha = (quirk_holder.dir == WEST) * 255
10331053
RegisterSignal(quirk_holder, COMSIG_ATOM_DIR_CHANGE, PROC_REF(change_dir))
10341054

10351055
/datum/quirk/blindspot/remove()
1036-
quirk_holder.clear_fullscreen("blindspot")
1056+
quirk_holder.clear_fullscreen(BLINDSPOT_NORTH)
1057+
quirk_holder.clear_fullscreen(BLINDSPOT_SOUTH)
1058+
quirk_holder.clear_fullscreen(BLINDSPOT_EAST)
1059+
quirk_holder.clear_fullscreen(BLINDSPOT_WEST)
10371060
quirk_holder.blindspot_overlay = null
10381061
UnregisterSignal(quirk_holder, COMSIG_ATOM_DIR_CHANGE)
10391062

10401063
/datum/quirk/blindspot/proc/change_dir(atom/movable/source, olddir, newdir)
10411064
SIGNAL_HANDLER
1042-
var/atom/movable/screen/fullscreen/blindspot/fs_ov = quirk_holder.blindspot_overlay?.resolve()
1043-
if(istype(fs_ov))
1044-
fs_ov.dir = newdir
1065+
if(olddir == 0 || newdir == 0)
1066+
return
1067+
if(olddir == newdir)
1068+
return
1069+
if(!quirk_holder.blindspot_overlay)
1070+
return
1071+
var/atom/movable/screen/fullscreen/blindspot/old_spot = quirk_holder.blindspot_overlay[olddir]?.resolve()
1072+
var/atom/movable/screen/fullscreen/blindspot/new_spot = quirk_holder.blindspot_overlay[newdir]?.resolve()
1073+
if(!istype(old_spot) || !istype(new_spot))
1074+
return
1075+
animate(old_spot, 0.5 SECONDS, easing = CIRCULAR_EASING|EASE_OUT, alpha = 0)
1076+
animate(new_spot, 0.5 SECONDS, easing = CIRCULAR_EASING|EASE_OUT, alpha = 255)
1077+
1078+
#undef BLINDSPOT_NORTH
1079+
#undef BLINDSPOT_SOUTH
1080+
#undef BLINDSPOT_EAST
1081+
#undef BLINDSPOT_WEST

code/modules/mob/mob_defines.dm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,8 @@
249249
///Contains the fullscreen overlays the mob can see (from 'code/_onclick/hud/fullscreen.dm')
250250
var/list/screens = list()
251251

252-
/// Contains the blindspot overlay, if one is in use. Here for performance reasons
253-
var/datum/weakref/blindspot_overlay
252+
/// Contains the blindspot overlays, if they are in use
253+
var/list/datum/weakref/blindspot_overlay
254254

255255
///The HUD type the mob will gain on Initialize. (from 'code/_onclick/hud/hud.dm')
256256
var/hud_type = /datum/hud

0 commit comments

Comments
 (0)