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

Commit 76c84cd

Browse files
authored
Blindspot Quirk (Yet Another Overlay Quirk) (#22880)
* blindspot * blindspot fadecode * remove unused trait * resolve missing type lints * clean up code * lessen immersion breaking corner lighting
1 parent 9f5fcf7 commit 76c84cd

File tree

4 files changed

+75
-4
lines changed

4 files changed

+75
-4
lines changed

code/_onclick/hud/fullscreen.dm

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
if (client && screen.should_show_to(src))
1515
screen.update_for_view(client.view)
1616
client.screen += screen
17-
17+
1818
if(screen.needs_offsetting)
1919
SET_PLANE_EXPLICIT(screen, PLANE_TO_TRUE(screen.plane), src)
2020

@@ -241,3 +241,9 @@
241241
icon_state = "blue_eye"
242242
plane = FULLSCREEN_PLANE
243243
layer = CURSE_LAYER
244+
245+
/// Blindspot quirk - has 4 directions
246+
/atom/movable/screen/fullscreen/blindspot
247+
icon_state = "blindspot"
248+
plane = FULLSCREEN_PLANE
249+
layer = BLIND_LAYER

code/datums/traits/negative.dm

Lines changed: 65 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@
678678
gain_text = span_danger("You remember your allergic reaction to a common medicine.")
679679
lose_text = span_notice("You no longer are allergic to medicine.")
680680

681-
var/allergy_chem_list = list(
681+
var/allergy_chem_list = list(
682682
/datum/reagent/medicine/inacusiate,
683683
/datum/reagent/medicine/silver_sulfadiazine,
684684
/datum/reagent/medicine/styptic_powder,
@@ -707,7 +707,7 @@
707707
var/reagent_id
708708
COOLDOWN_DECLARE(allergies)
709709
/// how long allergies last after getting rid of the allergen
710-
var/cooldown_duration = 10 SECONDS
710+
var/cooldown_duration = 10 SECONDS
711711
/// Wether the person is experiencing anaphylatic shock or not
712712
COOLDOWN_DECLARE(anaphylaxis)
713713
/// How long anaphylactic shock lasts
@@ -751,7 +751,7 @@
751751

752752
else if(!COOLDOWN_FINISHED(src, allergies)) //if the cooldown is going
753753
//external indicator that it's happening
754-
if(prob(50))
754+
if(prob(50))
755755
switch(rand(0, 2))
756756
if(0)
757757
H.emote("cough")
@@ -1017,3 +1017,65 @@
10171017

10181018
/datum/quirk/lactose_intolerance/proc/on_species_gain(datum/source, datum/species/new_species)
10191019
new_species.toxic_food |= DAIRY // no escape from your terrible fate
1020+
1021+
/datum/quirk/blindspot
1022+
name = "Blindspot"
1023+
desc = "You lack the sixth sense and cannot see behind yourself."
1024+
icon = "arrows-to-eye"
1025+
gain_text = span_danger("You can't see behind yourself anymore.")
1026+
lose_text = span_notice("You can see behind yourself again.")
1027+
value = -2
1028+
medical_record_text = "Patient has trouble with spatial awareness."
1029+
1030+
#define BLINDSPOT_NORTH "blindspotN"
1031+
#define BLINDSPOT_SOUTH "blindspotS"
1032+
#define BLINDSPOT_EAST "blindspotE"
1033+
#define BLINDSPOT_WEST "blindspotW"
1034+
1035+
/datum/quirk/blindspot/add()
1036+
quirk_holder.blindspot_overlay = new/list(10)
1037+
var/atom/movable/screen/fullscreen/blindspot/north_blindspot = quirk_holder.overlay_fullscreen(BLINDSPOT_NORTH, /atom/movable/screen/fullscreen/blindspot)
1038+
var/atom/movable/screen/fullscreen/blindspot/south_blindspot = quirk_holder.overlay_fullscreen(BLINDSPOT_SOUTH, /atom/movable/screen/fullscreen/blindspot)
1039+
var/atom/movable/screen/fullscreen/blindspot/east_blindspot = quirk_holder.overlay_fullscreen(BLINDSPOT_EAST, /atom/movable/screen/fullscreen/blindspot)
1040+
var/atom/movable/screen/fullscreen/blindspot/west_blindspot = quirk_holder.overlay_fullscreen(BLINDSPOT_WEST, /atom/movable/screen/fullscreen/blindspot)
1041+
quirk_holder.blindspot_overlay[NORTH] = WEAKREF(north_blindspot)
1042+
quirk_holder.blindspot_overlay[SOUTH] = WEAKREF(south_blindspot)
1043+
quirk_holder.blindspot_overlay[EAST] = WEAKREF(east_blindspot)
1044+
quirk_holder.blindspot_overlay[WEST] = WEAKREF(west_blindspot)
1045+
north_blindspot.dir = NORTH
1046+
south_blindspot.dir = SOUTH
1047+
east_blindspot.dir = EAST
1048+
west_blindspot.dir = WEST
1049+
north_blindspot.alpha = (quirk_holder.dir == NORTH) * 255
1050+
south_blindspot.alpha = (quirk_holder.dir == SOUTH) * 255
1051+
east_blindspot.alpha = (quirk_holder.dir == EAST) * 255
1052+
west_blindspot.alpha = (quirk_holder.dir == WEST) * 255
1053+
RegisterSignal(quirk_holder, COMSIG_ATOM_DIR_CHANGE, PROC_REF(change_dir))
1054+
1055+
/datum/quirk/blindspot/remove()
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)
1060+
quirk_holder.blindspot_overlay = null
1061+
UnregisterSignal(quirk_holder, COMSIG_ATOM_DIR_CHANGE)
1062+
1063+
/datum/quirk/blindspot/proc/change_dir(atom/movable/source, olddir, newdir)
1064+
SIGNAL_HANDLER
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_IN, 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: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,9 @@
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 overlays, if they are in use
253+
var/list/datum/weakref/blindspot_overlay
254+
252255
///The HUD type the mob will gain on Initialize. (from 'code/_onclick/hud/hud.dm')
253256
var/hud_type = /datum/hud
254257

icons/mob/screen_full.dmi

99.4 KB
Binary file not shown.

0 commit comments

Comments
 (0)