diff --git a/code/_onclick/hud/fullscreen.dm b/code/_onclick/hud/fullscreen.dm index 25733955380f..7e541f75abc3 100644 --- a/code/_onclick/hud/fullscreen.dm +++ b/code/_onclick/hud/fullscreen.dm @@ -14,7 +14,7 @@ if (client && screen.should_show_to(src)) screen.update_for_view(client.view) client.screen += screen - + if(screen.needs_offsetting) SET_PLANE_EXPLICIT(screen, PLANE_TO_TRUE(screen.plane), src) @@ -241,3 +241,9 @@ icon_state = "blue_eye" plane = FULLSCREEN_PLANE layer = CURSE_LAYER + +/// Blindspot quirk - has 4 directions +/atom/movable/screen/fullscreen/blindspot + icon_state = "blindspot" + plane = FULLSCREEN_PLANE + layer = BLIND_LAYER diff --git a/code/datums/traits/negative.dm b/code/datums/traits/negative.dm index 9f0c38967cbb..ab257bb52863 100644 --- a/code/datums/traits/negative.dm +++ b/code/datums/traits/negative.dm @@ -678,7 +678,7 @@ gain_text = span_danger("You remember your allergic reaction to a common medicine.") lose_text = span_notice("You no longer are allergic to medicine.") - var/allergy_chem_list = list( + var/allergy_chem_list = list( /datum/reagent/medicine/inacusiate, /datum/reagent/medicine/silver_sulfadiazine, /datum/reagent/medicine/styptic_powder, @@ -707,7 +707,7 @@ var/reagent_id COOLDOWN_DECLARE(allergies) /// how long allergies last after getting rid of the allergen - var/cooldown_duration = 10 SECONDS + var/cooldown_duration = 10 SECONDS /// Wether the person is experiencing anaphylatic shock or not COOLDOWN_DECLARE(anaphylaxis) /// How long anaphylactic shock lasts @@ -751,7 +751,7 @@ else if(!COOLDOWN_FINISHED(src, allergies)) //if the cooldown is going //external indicator that it's happening - if(prob(50)) + if(prob(50)) switch(rand(0, 2)) if(0) H.emote("cough") @@ -1017,3 +1017,65 @@ /datum/quirk/lactose_intolerance/proc/on_species_gain(datum/source, datum/species/new_species) new_species.toxic_food |= DAIRY // no escape from your terrible fate + +/datum/quirk/blindspot + name = "Blindspot" + desc = "You lack the sixth sense and cannot see behind yourself." + icon = "arrows-to-eye" + gain_text = span_danger("You can't see behind yourself anymore.") + lose_text = span_notice("You can see behind yourself again.") + value = -2 + medical_record_text = "Patient has trouble with spatial awareness." + +#define BLINDSPOT_NORTH "blindspotN" +#define BLINDSPOT_SOUTH "blindspotS" +#define BLINDSPOT_EAST "blindspotE" +#define BLINDSPOT_WEST "blindspotW" + +/datum/quirk/blindspot/add() + quirk_holder.blindspot_overlay = new/list(10) + var/atom/movable/screen/fullscreen/blindspot/north_blindspot = quirk_holder.overlay_fullscreen(BLINDSPOT_NORTH, /atom/movable/screen/fullscreen/blindspot) + var/atom/movable/screen/fullscreen/blindspot/south_blindspot = quirk_holder.overlay_fullscreen(BLINDSPOT_SOUTH, /atom/movable/screen/fullscreen/blindspot) + var/atom/movable/screen/fullscreen/blindspot/east_blindspot = quirk_holder.overlay_fullscreen(BLINDSPOT_EAST, /atom/movable/screen/fullscreen/blindspot) + var/atom/movable/screen/fullscreen/blindspot/west_blindspot = quirk_holder.overlay_fullscreen(BLINDSPOT_WEST, /atom/movable/screen/fullscreen/blindspot) + quirk_holder.blindspot_overlay[NORTH] = WEAKREF(north_blindspot) + quirk_holder.blindspot_overlay[SOUTH] = WEAKREF(south_blindspot) + quirk_holder.blindspot_overlay[EAST] = WEAKREF(east_blindspot) + quirk_holder.blindspot_overlay[WEST] = WEAKREF(west_blindspot) + north_blindspot.dir = NORTH + south_blindspot.dir = SOUTH + east_blindspot.dir = EAST + west_blindspot.dir = WEST + north_blindspot.alpha = (quirk_holder.dir == NORTH) * 255 + south_blindspot.alpha = (quirk_holder.dir == SOUTH) * 255 + east_blindspot.alpha = (quirk_holder.dir == EAST) * 255 + west_blindspot.alpha = (quirk_holder.dir == WEST) * 255 + RegisterSignal(quirk_holder, COMSIG_ATOM_DIR_CHANGE, PROC_REF(change_dir)) + +/datum/quirk/blindspot/remove() + quirk_holder.clear_fullscreen(BLINDSPOT_NORTH) + quirk_holder.clear_fullscreen(BLINDSPOT_SOUTH) + quirk_holder.clear_fullscreen(BLINDSPOT_EAST) + quirk_holder.clear_fullscreen(BLINDSPOT_WEST) + quirk_holder.blindspot_overlay = null + UnregisterSignal(quirk_holder, COMSIG_ATOM_DIR_CHANGE) + +/datum/quirk/blindspot/proc/change_dir(atom/movable/source, olddir, newdir) + SIGNAL_HANDLER + if(olddir == 0 || newdir == 0) + return + if(olddir == newdir) + return + if(!quirk_holder.blindspot_overlay) + return + var/atom/movable/screen/fullscreen/blindspot/old_spot = quirk_holder.blindspot_overlay[olddir]?.resolve() + var/atom/movable/screen/fullscreen/blindspot/new_spot = quirk_holder.blindspot_overlay[newdir]?.resolve() + if(!istype(old_spot) || !istype(new_spot)) + return + animate(old_spot, 0.5 SECONDS, easing = CIRCULAR_EASING|EASE_IN, alpha = 0) + animate(new_spot, 0.5 SECONDS, easing = CIRCULAR_EASING|EASE_OUT, alpha = 255) + +#undef BLINDSPOT_NORTH +#undef BLINDSPOT_SOUTH +#undef BLINDSPOT_EAST +#undef BLINDSPOT_WEST diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index 6ee406be37fe..e1e7eb54703b 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -249,6 +249,9 @@ ///Contains the fullscreen overlays the mob can see (from 'code/_onclick/hud/fullscreen.dm') var/list/screens = list() + /// Contains the blindspot overlays, if they are in use + var/list/datum/weakref/blindspot_overlay + ///The HUD type the mob will gain on Initialize. (from 'code/_onclick/hud/hud.dm') var/hud_type = /datum/hud diff --git a/icons/mob/screen_full.dmi b/icons/mob/screen_full.dmi index f90ffb4ae402..e9893b3ae52b 100644 Binary files a/icons/mob/screen_full.dmi and b/icons/mob/screen_full.dmi differ