Fullscreen overlay rework, full-black unconsciousness overlay, overlay fadeout animations + more. (#10053)

Ported the clickcatcher from tg/bay. You can now click black spots to turn. Isn't that handy, especially with vision cones.

    Reworked fullscreen overlays into an easier and better system, courtesy of PsiOmegaDelta.

    Similiarly, added fadeout animations to all pain overlays, plus unconsciousness.

    Fixed the vampire frenzy overlay never showing.

    Unconsciousness is now FULL darkness.

    Flashing mobs is now an inbuilt proc.
This commit is contained in:
Matt Atlas
2020-10-02 07:53:14 +02:00
committed by GitHub
parent f633ee8e18
commit 556f1aa86f
52 changed files with 415 additions and 243 deletions

View File

@@ -113,6 +113,7 @@
#include "code\_onclick\hud\_defines.dm"
#include "code\_onclick\hud\action.dm"
#include "code\_onclick\hud\ai.dm"
#include "code\_onclick\hud\fullscreen.dm"
#include "code\_onclick\hud\gun_mode.dm"
#include "code\_onclick\hud\hud.dm"
#include "code\_onclick\hud\human.dm"

BIN
bbb.dmi Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 KiB

View File

@@ -36,4 +36,14 @@
#define MECH_ARM_LAYER 4.06
#define MECH_DECAL_LAYER 4.07
#define MECH_GEAR_LAYER 4.08
#define MECH_ABOVE_LAYER 4.09
#define MECH_ABOVE_LAYER 4.09
#define HUD_PLANE 5
#define FULLSCREEN_PLANE 4
#define CLICKCATCHER_PLANE -100
#define FULLSCREEN_LAYER 0
#define DAMAGE_HUD_LAYER 1
#define IMPAIRED_LAYER 2
#define BLIND_LAYER 3
#define CRIT_LAYER 4

View File

@@ -43,6 +43,19 @@
if(turfs.len)
return pick(turfs)
/proc/screen_loc2turf(text, turf/origin)
if(!origin)
return null
var/tZ = splittext(text, ",")
var/tX = splittext(tZ[1], "-")
var/tY = text2num(tX[2])
tX = splittext(tZ[2], "-")
tX = text2num(tX[2])
tZ = origin.z
tX = max(1, min(origin.x + 7 - tX, world.maxx))
tY = max(1, min(origin.y + 7 - tY, world.maxy))
return locate(tX, tY, tZ)
// This proc will check if a neighboring tile in the stated direction "dir" is dense or not
// Will return 1 if it is dense and zero if not
/proc/check_neighbor_density(turf/T, var/dir)

View File

@@ -362,3 +362,35 @@
if(direction != dir)
facedir(direction, TRUE)
var/global/list/click_catchers
/obj/screen/click_catcher
icon = 'icons/mob/screen_gen.dmi'
icon_state = "click_catcher"
plane = CLICKCATCHER_PLANE
mouse_opacity = 2
screen_loc = "CENTER-7,CENTER-7"
/obj/screen/click_catcher/Destroy()
SHOULD_CALL_PARENT(FALSE)
return QDEL_HINT_LETMELIVE
/proc/create_click_catcher()
. = list()
for(var/i = 0, i<15, i++)
for(var/j = 0, j<15, j++)
var/obj/screen/click_catcher/CC = new()
CC.screen_loc = "NORTH-[i],EAST-[j]"
. += CC
/obj/screen/click_catcher/Click(location, control, params)
var/list/modifiers = params2list(params)
if(modifiers["middle"] && istype(usr, /mob/living/carbon))
var/mob/living/carbon/C = usr
C.swap_hand()
else
var/turf/T = screen_loc2turf(screen_loc, get_turf(usr))
if(T)
T.Click(location, control, params)
. = 1

View File

@@ -0,0 +1,151 @@
/mob
var/list/screens = list()
/mob/proc/set_fullscreen(condition, screen_name, screen_type, arg)
condition ? overlay_fullscreen(screen_name, screen_type, arg) : clear_fullscreen(screen_name)
/mob/proc/overlay_fullscreen(category, type, severity)
var/obj/screen/fullscreen/screen = screens[category]
if(screen)
if(screen.type != type)
clear_fullscreen(category, FALSE)
screen = null
else if(!severity || severity == screen.severity)
return null
if(!screen)
screen = new type()
screen.icon_state = "[initial(screen.icon_state)][severity]"
screen.severity = severity
screens[category] = screen
if(client && (stat != DEAD || screen.allstate))
client.screen += screen
return screen
/mob/proc/clear_fullscreen(category, animated = 10)
var/obj/screen/fullscreen/screen = screens[category]
if(!screen)
return
screens -= category
if(animated)
spawn(0)
animate(screen, alpha = 0, time = animated)
sleep(animated)
if(client)
client.screen -= screen
qdel(screen)
else
if(client)
client.screen -= screen
qdel(screen)
/mob/proc/clear_fullscreens()
for(var/category in screens)
clear_fullscreen(category)
/mob/proc/hide_fullscreens()
if(client)
for(var/category in screens)
client.screen -= screens[category]
/mob/proc/reload_fullscreen()
if(client)
for(var/category in screens)
client.screen |= screens[category]
/obj/screen/fullscreen
icon = 'icons/mob/screen/full.dmi'
icon_state = "default"
screen_loc = "CENTER-7,CENTER-7"
plane = FULLSCREEN_PLANE
mouse_opacity = 0
var/severity = 0
var/allstate = 0 //shows if it should show up for dead people too
/obj/screen/fullscreen/Destroy()
severity = 0
return ..()
/obj/screen/fullscreen/brute
icon_state = "brutedamageoverlay"
layer = DAMAGE_HUD_LAYER
/obj/screen/fullscreen/oxy
icon_state = "oxydamageoverlay"
layer = DAMAGE_HUD_LAYER
/obj/screen/fullscreen/crit
icon_state = "passage"
layer = CRIT_LAYER
/obj/screen/fullscreen/strong_pain
layer = DAMAGE_HUD_LAYER
icon_state = "strong_pain"
/obj/screen/fullscreen/blind
icon_state = "blackimageoverlay"
layer = BLIND_LAYER
/obj/screen/fullscreen/blackout
icon = 'icons/mob/screen/effects.dmi'
icon_state = "black"
screen_loc = ui_entire_screen
layer = BLIND_LAYER
/obj/screen/fullscreen/impaired
icon_state = "impairedoverlay"
layer = IMPAIRED_LAYER
/obj/screen/fullscreen/blurry
icon = 'icons/mob/screen/effects.dmi'
screen_loc = "WEST,SOUTH to EAST,NORTH"
icon_state = "blurry"
alpha = 100
/obj/screen/fullscreen/pain
icon_state = "brutedamageoverlay6"
alpha = 0
/obj/screen/fullscreen/flash
icon = 'icons/mob/screen/effects.dmi'
screen_loc = "WEST,SOUTH to EAST,NORTH"
icon_state = "flash"
/obj/screen/fullscreen/flash/noise
icon_state = "noise"
/obj/screen/fullscreen/noise
icon = 'icons/effects/static.dmi'
icon_state = "1 light"
screen_loc = ui_entire_screen
layer = FULLSCREEN_LAYER
alpha = 127
/obj/screen/fullscreen/fadeout
icon = 'icons/mob/screen/effects.dmi'
icon_state = "black"
screen_loc = ui_entire_screen
layer = FULLSCREEN_LAYER
alpha = 0
allstate = 1
/obj/screen/fullscreen/fadeout/Initialize()
. = ..()
animate(src, alpha = 255, time = 10)
/obj/screen/fullscreen/scanline
icon = 'icons/effects/static.dmi'
icon_state = "scanlines"
screen_loc = ui_entire_screen
alpha = 50
layer = FULLSCREEN_LAYER
/obj/screen/fullscreen/frenzy
icon_state = "frenzyoverlay"
layer = BLIND_LAYER

View File

@@ -376,3 +376,9 @@ datum/hud/New(mob/owner)
hud_used.hidden_inventory_update()
hud_used.persistant_inventory_update()
update_action_buttons()
/mob/proc/add_click_catcher()
client.screen |= click_catchers
/mob/new_player/add_click_catcher()
return

View File

@@ -323,42 +323,10 @@
mymob.up_hint.screen_loc = ui_up_hint
hud_elements |= mymob.up_hint
mymob.blind = new /obj/screen()
mymob.blind.icon = 'icons/mob/screen/full.dmi'
mymob.blind.icon_state = "blackimageoverlay"
mymob.blind.name = " "
mymob.blind.screen_loc = "1,1"
mymob.blind.mouse_opacity = 0
mymob.blind.invisibility = 101
hud_elements |= mymob.blind
mymob.damageoverlay = new /obj/screen()
mymob.damageoverlay.icon = 'icons/mob/screen/full.dmi'
mymob.damageoverlay.icon_state = "oxydamageoverlay0"
mymob.damageoverlay.name = "dmg"
mymob.damageoverlay.screen_loc = "1,1"
mymob.damageoverlay.mouse_opacity = 0
mymob.damageoverlay.layer = 18.1 //The black screen overlay sets layer to 18 to display it, this one has to be just on top.
hud_elements |= mymob.damageoverlay
mymob.flash = new /obj/screen()
mymob.flash.icon = ui_style
mymob.flash.icon_state = "blank"
mymob.flash.name = "flash"
mymob.flash.screen_loc = ui_entire_screen
mymob.flash.layer = 17
mymob.flash.mouse_opacity = 0
hud_elements |= mymob.flash
mymob.pain = new /obj/screen()
mymob.pain.icon = 'icons/mob/screen/full.dmi'
mymob.pain.icon_state = null
mymob.pain.name = "pain"
mymob.pain.screen_loc = "1,1"
mymob.pain.mouse_opacity = 0
mymob.pain = new /obj/screen/fullscreen/pain(null)
hud_elements |= mymob.pain
mymob.zone_sel = new /obj/screen/zone_sel( null )
mymob.zone_sel = new /obj/screen/zone_sel(null)
mymob.zone_sel.icon = ui_style
mymob.zone_sel.color = ui_color
mymob.zone_sel.alpha = ui_alpha

View File

@@ -21,21 +21,6 @@
mymob.healths.name = "health"
mymob.healths.screen_loc = ui_alien_health
mymob.blind = new /obj/screen()
mymob.blind.icon = 'icons/mob/screen/full.dmi'
mymob.blind.icon_state = "blackimageoverlay"
mymob.blind.name = " "
mymob.blind.screen_loc = "1,1"
mymob.blind.invisibility = 101
mymob.flash = new /obj/screen()
mymob.flash.icon = 'icons/mob/screen/alien.dmi'
mymob.flash.icon_state = "blank"
mymob.flash.name = "flash"
mymob.flash.screen_loc = ui_entire_screen
mymob.flash.layer = 17
mymob.flash.mouse_opacity = 0
mymob.fire = new /obj/screen()
mymob.fire.icon = 'icons/mob/screen/alien.dmi'
mymob.fire.icon_state = "blank"
@@ -43,5 +28,5 @@
mymob.fire.screen_loc = ui_fire
mymob.client.screen = null
mymob.client.screen += list( mymob.healths, mymob.blind, mymob.flash, mymob.fire) //, mymob.rest, mymob.sleep, mymob.mach )
mymob.client.screen += list(mymob.healths, mymob.fire)
mymob.client.screen += src.adding + src.other

View File

@@ -9,15 +9,7 @@
return
/mob/living/carbon/brain/instantiate_hud(var/datum/hud/HUD)
HUD.brain_hud()
/datum/hud/proc/brain_hud(ui_style = 'icons/mob/screen/midnight.dmi')
mymob.blind = new /obj/screen()
mymob.blind.icon = 'icons/mob/screen/full.dmi'
mymob.blind.icon_state = "blackimageoverlay"
mymob.blind.name = " "
mymob.blind.screen_loc = "1,1"
mymob.blind.invisibility = 101
return
/mob/living/silicon/ai/instantiate_hud(var/datum/hud/HUD)
HUD.ai_hud()
@@ -126,14 +118,6 @@
else if(istype(mymob, /mob/living/simple_animal/construct/harvester))
constructtype = "harvester"
mymob.flash = new /obj/screen()
mymob.flash.icon = 'icons/mob/screen/generic.dmi'
mymob.flash.icon_state = "blank"
mymob.flash.name = "flash"
mymob.flash.screen_loc = ui_entire_screen
mymob.flash.layer = 17
mymob.flash.mouse_opacity = 0
if(constructtype)
mymob.fire = new /obj/screen()
mymob.fire.icon = 'icons/mob/screen/construct.dmi'
@@ -167,4 +151,4 @@
mymob.client.screen = null
mymob.client.screen += list(mymob.fire, mymob.healths, mymob.pullin, mymob.zone_sel, mymob.purged, mymob.flash)
mymob.client.screen += list(mymob.fire, mymob.healths, mymob.pullin, mymob.zone_sel, mymob.purged)

View File

@@ -119,21 +119,6 @@ var/obj/screen/robot_inventory
mymob.pullin.name = "pull"
mymob.pullin.screen_loc = ui_borg_pull
mymob.blind = new /obj/screen()
mymob.blind.icon = 'icons/mob/screen/full.dmi'
mymob.blind.icon_state = "blackimageoverlay"
mymob.blind.name = " "
mymob.blind.screen_loc = "1,1"
mymob.blind.invisibility = 101
mymob.flash = new /obj/screen()
mymob.flash.icon = 'icons/mob/screen/robot.dmi'
mymob.flash.icon_state = "blank"
mymob.flash.name = "flash"
mymob.flash.screen_loc = ui_entire_screen
mymob.flash.layer = 17
mymob.flash.mouse_opacity = 0
mymob.zone_sel = new /obj/screen/zone_sel()
mymob.zone_sel.icon = 'icons/mob/screen/robot.dmi'
mymob.zone_sel.cut_overlays()
@@ -161,8 +146,6 @@ var/obj/screen/robot_inventory
r.cells,
mymob.up_hint,
mymob.pullin,
mymob.blind,
mymob.flash,
robot_inventory,
mymob.gun_setting_icon,
r.computer)

View File

@@ -10,6 +10,7 @@
name = ""
icon = 'icons/mob/screen/generic.dmi'
layer = SCREEN_LAYER
plane = HUD_PLANE
unacidable = 1
var/obj/master = null //A reference to the object in the slot. Grabs or items, generally.
var/datum/hud/hud = null // A reference to the owner HUD, if any.

View File

@@ -39,6 +39,7 @@
if (config.use_forumuser_api)
update_admins_from_api(TRUE)
click_catchers = create_click_catcher()
..(timeofday)

View File

@@ -16,7 +16,7 @@
continue
if(iscarbon(L))
var/mob/living/carbon/C = L
flick("e_flash", C.flash)
C.flash_eyes()
if(C.stuttering < 1 && !(HULK in C.mutations))
C.stuttering = 1
if(is_rune)
@@ -29,7 +29,7 @@
else if(issilicon(L))
var/mob/living/silicon/S = L
S.Weaken(5)
flick("e_flash", S.flash)
S.flash_eyes()
S.silent += 15
to_chat(S, SPAN_DANGER("BZZZT... The rune has exploded in a bright flash!"))
admin_attack_log(user, S, "Used a stun rune.", "Was victim of a stun rune.", "used a stun rune on")

View File

@@ -43,7 +43,7 @@ var/global/universe_has_ended = 0
sound_to(world, ('sound/effects/cascade.ogg'))
for(var/mob/M in player_list)
flick("e_flash", M.flash)
M.flash_eyes()
if(emergency_shuttle.can_recall())
priority_announcement.Announce("The emergency shuttle has returned due to bluespace distortion.")
@@ -137,7 +137,7 @@ The access requirements on the Asteroid Shuttles' consoles have now been revoked
continue
if(M.current.stat!=2)
M.current.Weaken(10)
flick("e_flash", M.current.flash)
M.current.flash_eyes()
clear_antag_roles(M)
CHECK_TICK

View File

@@ -181,6 +181,7 @@
vampire.status |= VAMP_FRENZIED
visible_message("<span class='danger'>A dark aura manifests itself around [src.name], their eyes turning red and their composure changing to be more beast-like.</span>", "<span class='danger'>You can resist no longer. The power of the Veil takes control over your mind: you are unable to speak or think. In people, you see nothing but prey to be feasted upon. You are reduced to an animal.</span>")
overlay_fullscreen("frenzy", /obj/screen/fullscreen/frenzy)
mutations.Add(HULK)
update_mutations()
@@ -200,6 +201,7 @@
mutations.Remove(HULK)
update_mutations()
clear_fullscreen("frenzy")
sight &= ~SEE_MOBS
visible_message("<span class='danger'>[src.name]'s eyes no longer glow with violent rage, their form reverting to resemble that of a normal person's.</span>", "<span class='danger'>The beast within you retreats. You gain control over your body once more.</span>")

View File

@@ -100,7 +100,7 @@
if(!O.blinded)
flick("flash", O:flash)
O.Weaken(flash_time)
flick("e_flash", O.flash)
O.flash_eyes()
/obj/machinery/flasher/emp_act(severity)
if(stat & (BROKEN|NOPOWER))

View File

@@ -71,14 +71,14 @@
var/mob/living/carbon/C = M
var/datum/dionastats/DS = C.get_dionastats()
DS.stored_energy += 10
flick("e_flash", M.flash)
M.flash_eyes()
M.Weaken(5)
M.eye_blind = 5
return
var/safety = M:eyecheck(TRUE)
if(safety <= 0)
flick("e_flash", M.flash)
M.flash_eyes()
M.confused = 10
var/mob/living/carbon/human/H = M
var/obj/item/organ/internal/eyes/E = H.get_eyes()
@@ -191,7 +191,7 @@
var/mob/living/carbon/M = loc
var/safety = M.eyecheck(TRUE)
if(safety < FLASH_PROTECTION_MODERATE)
flick("e_flash", M.flash)
M.flash_eyes()
for(var/mob/O in viewers(M, null))
O.show_message("<span class='disarm'>[M] is blinded by the flash!</span>")
..()

View File

@@ -50,7 +50,7 @@
//Flashing everyone
if(eye_safety < FLASH_PROTECTION_MODERATE)
flick("e_flash", M.flash)
M.flash_eyes()
M.Weaken(10)
//Vaurca damage 15/01/16
var/mob/living/carbon/human/H = M

View File

@@ -20,7 +20,7 @@
if (flash)
for(var/mob/living/carbon/human/M in viewers(T, null))
if(M.eyecheck(TRUE) < FLASH_PROTECTION_MODERATE)
flick("e_flash", M.flash)
M.flash_eyes()
else
spark(T, 3, alldirs) //give spawning some flair if there's no flash

View File

@@ -206,7 +206,7 @@
playsound(T, 'sound/effects/phasein.ogg', 100, 1)
for(var/mob/living/carbon/human/M in viewers(T, null))
if(M.eyecheck(TRUE) < FLASH_PROTECTION_MODERATE)
flick("e_flash", M.flash)
M.flash_eyes()
for(var/i=1, i<=deliveryamt, i++)
var/obj/machinery/portable_atmospherics/hydroponics/soil/invisible/x = new spawner_type(T, new /datum/seed/koisspore())

View File

@@ -25,7 +25,7 @@
if(2)
sound_to(holder, 'sound/hallucinations/behind_you1.ogg')
to_chat(holder, SPAN_GOOD("You hear a whispering in your mind. A promise of [pick("power", "enlightenment", "sight beyond sight", "knowledge terrible but true")]. Your vision goes white for a moment; when it returns, you feel... different."))
flick("e_flash", holder.flash)
holder.flash_eyes()
if(3)
to_chat(holder, FONT_LARGE(SPAN_DANGER("You feel a sudden pain in your head, as if it's being ripped in two! When it subsides to a dull throbbing a moment later, you feel... different.")))
holder.emote("me",1,"winces.")
@@ -112,7 +112,7 @@
if(2)
sound_to(holder, 'sound/hallucinations/behind_you1.ogg')
to_chat(holder, SPAN_GOOD("You hear a whispering in your mind. A promise of [pick("power", "enlightenment", "sight beyond sight", "knowledge terrible but true")]. Your vision goes white for a moment; when it returns, you feel... different."))
flick("e_flash", holder.flash)
holder.flash_eyes()
if(3)
to_chat(holder, FONT_LARGE(SPAN_DANGER("You feel a sudden pain in your head, as if it's being ripped in two! When it subsides to a dull throbbing a moment later, you feel... different.")))
holder.emote("me",1,"winces.")

View File

@@ -74,9 +74,6 @@
layer = MOB_LAYER
if(blind && client)
blind.invisibility = 101
sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS
see_in_dark = 8
see_invisible = SEE_INVISIBLE_LEVEL_TWO

View File

@@ -128,21 +128,15 @@
client.screen.Remove(global_hud.blurry,global_hud.druggy,global_hud.vimpaired)
if ((blind && stat != 2))
if ((blinded))
blind.invisibility = 0
if(stat != DEAD)
if(blinded)
overlay_fullscreen("blind", /obj/screen/fullscreen/blind)
else
blind.invisibility = 101
if (disabilities & NEARSIGHTED)
client.screen += global_hud.vimpaired
if (eye_blurry)
client.screen += global_hud.blurry
if (druggy)
client.screen += global_hud.druggy
if (stat != 2)
if (machine)
if ( machine.check_eye(src) < 0)
clear_fullscreen("blind")
set_fullscreen(disabilities & NEARSIGHTED, "impaired", /obj/screen/fullscreen/impaired, 1)
set_fullscreen(eye_blurry, "blurry", /obj/screen/fullscreen/blurry)
if(machine)
if (machine.check_eye(src) < 0)
reset_view(null)
else
if(client && !client.adminobs)

View File

@@ -213,28 +213,19 @@
if (client)
client.screen.Remove(global_hud.blurry,global_hud.druggy,global_hud.vimpaired)
if ((blind && stat != 2))
if ((blinded))
blind.invisibility = 0
if(stat != DEAD)
if(blinded)
overlay_fullscreen("blind", /obj/screen/fullscreen/blind)
else
blind.invisibility = 101
if (disabilities & NEARSIGHTED)
client.screen += global_hud.vimpaired
if (eye_blurry)
client.screen += global_hud.blurry
if(druggy)
client.screen += global_hud.druggy
clear_fullscreen("blind")
set_fullscreen(disabilities & NEARSIGHTED, "impaired", /obj/screen/fullscreen/impaired, 1)
set_fullscreen(eye_blurry, "blurry", /obj/screen/fullscreen/blurry)
if(druggy > 5)
add_client_color(/datum/client_color/oversaturated)
else
remove_client_color(/datum/client_color/oversaturated)
if (stat != 2)
if (machine)
if (machine.check_eye(src) < 1)
if(machine)
if(machine.check_eye(src) < 1)
reset_view(null)
else
if(!client?.adminobs)

View File

@@ -485,3 +485,7 @@
for(var/source in stasis_sources)
stasis_value += stasis_sources[source]
stasis_sources.Cut()
/mob/living/carbon/flash_eyes(intensity = FLASH_PROTECTION_MODERATE, override_blindness_check = FALSE, affect_silicon = FALSE, visual = FALSE, type = /obj/screen/fullscreen/flash)
if(eyecheck() < intensity || override_blindness_check)
return ..()

View File

@@ -802,9 +802,9 @@
return
if(stat != DEAD)
if(stat == UNCONSCIOUS && health < maxHealth/2)
var/ovr
var/severity
if(stat == UNCONSCIOUS && health < maxHealth / 2)
//Critical damage passage overlay
var/severity = 0
switch(health - maxHealth/2)
if(-20 to -10) severity = 1
if(-30 to -20) severity = 2
@@ -816,38 +816,39 @@
if(-90 to -80) severity = 8
if(-95 to -90) severity = 9
if(-INFINITY to -95) severity = 10
ovr = "passage[severity]"
if (ovr != last_brute_overlay)
damageoverlay.cut_overlay(last_brute_overlay)
damageoverlay.add_overlay(ovr)
last_brute_overlay = ovr
overlay_fullscreen("crit", /obj/screen/fullscreen/crit, severity)
else
update_oxy_overlay()
clear_fullscreen("crit")
//Oxygen damage overlay
if(getOxyLoss())
var/severity = 0
switch(getOxyLoss())
if(10 to 20) severity = 1
if(20 to 25) severity = 2
if(25 to 30) severity = 3
if(30 to 35) severity = 4
if(35 to 40) severity = 5
if(40 to 45) severity = 6
if(45 to INFINITY) severity = 7
overlay_fullscreen("oxy", /obj/screen/fullscreen/oxy, severity)
else
clear_fullscreen("oxy")
//Fire and Brute damage overlay (BSSR)
var/hurtdamage = src.getBruteLoss() + src.getFireLoss() + damageoverlaytemp
damageoverlaytemp = 0 // We do this so we can detect if someone hits us or not.
var/ovr
if(hurtdamage)
var/severity = 0
switch(hurtdamage)
if(10 to 25)
ovr = "brutedamageoverlay1"
if(25 to 40)
ovr = "brutedamageoverlay2"
if(40 to 55)
ovr = "brutedamageoverlay3"
if(55 to 70)
ovr = "brutedamageoverlay4"
if(70 to 85)
ovr = "brutedamageoverlay5"
if(85 to INFINITY)
ovr = "brutedamageoverlay6"
if(last_brute_overlay != ovr)
damageoverlay.cut_overlay(last_brute_overlay)
damageoverlay.add_overlay(ovr)
last_brute_overlay = ovr
if(10 to 25) severity = 1
if(25 to 40) severity = 2
if(40 to 55) severity = 3
if(55 to 70) severity = 4
if(70 to 85) severity = 5
if(85 to INFINITY) severity = 6
overlay_fullscreen("brute", /obj/screen/fullscreen/brute, severity)
else
clear_fullscreen("brute")
if(healths)
healths.overlays.Cut()
@@ -1297,7 +1298,7 @@
return
if (failed_last_breath || (getOxyLoss() + get_shock()) > exhaust_threshold)//Can't catch our breath if we're suffocating
flash_pain()
flash_pain(getOxyLoss()/2)
return
if (nutrition <= 0)

View File

@@ -481,19 +481,17 @@
if(H.equipment_tint_total >= TINT_BLIND)
H.eye_blind = max(H.eye_blind, 1)
if(H.blind)
H.blind.invisibility = (H.eye_blind ? 0 : 101)
if(!H.client)//no client, no screen to update
return 1
H.set_fullscreen(H.eye_blind && !H.equipment_prescription, "blind", /obj/screen/fullscreen/blind)
H.set_fullscreen(H.stat == UNCONSCIOUS, "blackout", /obj/screen/fullscreen/blackout)
if(config.welder_vision)
if(short_sighted || (H.equipment_tint_total >= TINT_HEAVY))
H.client.screen += global_hud.darkMask
else if((!H.equipment_prescription && (H.disabilities & NEARSIGHTED)) || H.equipment_tint_total == TINT_MODERATE)
H.client.screen += global_hud.vimpaired
if(H.eye_blurry)
H.client.screen += global_hud.blurry
H.set_fullscreen(H.equipment_tint_total, "welder", /obj/screen/fullscreen/impaired, H.equipment_tint_total)
var/how_nearsighted = get_how_nearsighted(H)
H.set_fullscreen(how_nearsighted, "nearsighted", /obj/screen/fullscreen/oxy, how_nearsighted)
H.set_fullscreen(H.eye_blurry, "blurry", /obj/screen/fullscreen/blurry)
if(H.druggy)
H.client.screen += global_hud.druggy
@@ -507,6 +505,14 @@
return 1
/datum/species/proc/get_how_nearsighted(var/mob/living/carbon/human/H)
var/prescriptions = short_sighted
if(H.disabilities & NEARSIGHTED)
prescriptions += 7
if(H.equipment_prescription)
prescriptions -= H.equipment_prescription
return Clamp(prescriptions, 0, 7)
/datum/species/proc/handle_sprint_cost(var/mob/living/carbon/human/H, var/cost)
if (!H.exhaust_threshold)
return 1 // Handled.
@@ -547,13 +553,13 @@
H.adjustHalLoss(remainder*0.25)
H.updatehealth()
if((H.get_shock() >= 10) && prob(H.get_shock() *2))
H.flash_pain()
H.flash_pain(H.get_shock())
if ((H.get_shock() + H.getOxyLoss()) >= (exhaust_threshold * 0.8))
H.m_intent = "walk"
H.hud_used.move_intent.update_move_icon(H)
to_chat(H, SPAN_DANGER("You're too exhausted to run anymore!"))
H.flash_pain()
H.flash_pain(H.get_shock())
return 0
H.hud_used.move_intent.update_move_icon(H)

View File

@@ -26,7 +26,6 @@
adjustCloneLoss(damage * BLOCKED_MULT(blocked))
if(PAIN)
adjustHalLoss(damage * BLOCKED_MULT(blocked))
flash_weak_pain()
updatehealth()
return 1

View File

@@ -121,28 +121,20 @@
return 1
/mob/living/proc/handle_vision()
client.screen.Remove(global_hud.blurry, global_hud.druggy, global_hud.vimpaired, global_hud.darkMask, global_hud.nvg, global_hud.thermal, global_hud.meson, global_hud.science)
update_sight()
if(stat == DEAD)
return
if(blind)
if(eye_blind)
blind.invisibility = 0
else
blind.invisibility = 101
if(disabilities & NEARSIGHTED)
client.screen += global_hud.vimpaired
if(eye_blurry)
client.screen += global_hud.blurry
if(eye_blind)
overlay_fullscreen("blind", /obj/screen/fullscreen/blind)
else
clear_fullscreen("blind")
set_fullscreen(disabilities & NEARSIGHTED, "impaired", /obj/screen/fullscreen/impaired, 1)
set_fullscreen(eye_blurry, "blurry", /obj/screen/fullscreen/blurry)
set_fullscreen(stat == UNCONSCIOUS, "blackout", /obj/screen/fullscreen/blackout)
if(druggy)
client.screen += global_hud.druggy
if(druggy > 5)
add_client_color(/datum/client_color/oversaturated)
else
remove_client_color(/datum/client_color/oversaturated)
if(machine)
var/viewflags = machine.check_eye(src)
if(viewflags < 0)

View File

@@ -992,3 +992,13 @@ default behaviour is:
/mob/living/proc/needs_wheelchair()
return FALSE
//called when the mob receives a bright flash
/mob/living/flash_eyes(intensity = FLASH_PROTECTION_MODERATE, override_blindness_check = FALSE, affect_silicon = FALSE, visual = FALSE, type = /obj/screen/fullscreen/flash)
if(override_blindness_check || !(disabilities & BLIND))
..()
overlay_fullscreen("flash", type)
spawn(25)
if(src)
clear_fullscreen("flash", 25)
return 1

View File

@@ -127,7 +127,7 @@
//Handles the effects of "stun" weapons
/mob/living/proc/stun_effect_act(var/stun_amount, var/agony_amount, var/def_zone, var/used_weapon=null)
flash_pain()
flash_pain(stun_amount)
if(stun_amount)
Stun(stun_amount)

View File

@@ -271,7 +271,7 @@ var/controlling
host.paralysis = max(host.paralysis, 2)
host.flash_weak_pain()
host.flash_pain(10)
to_chat(host, "<span class='danger'><font size=5>You feel excrutiating pain all over your body! It is so bad you can't think or articulate yourself properly.</font></span>")
to_chat(usr, "<span class='notice'>You send a jolt of agonizing pain through [host], they should be unable to concentrate on anything else for half a minute.</span>")
@@ -281,7 +281,7 @@ var/controlling
for(var/i=0, i<10, i++)
host.stuttering = 2
sleep(50)
if(prob(80)) host.flash_weak_pain()
if(prob(80)) host.flash_pain(10)
if(prob(10)) host.paralysis = max(host.paralysis, 2)
if(prob(15)) host.emote("twitch")
else if(prob(15)) host.emote("scream")

View File

@@ -42,18 +42,18 @@
if (ai_restore_power_routine==2)
to_chat(src, "Alert cancelled. Power has been restored without our assistance.")
ai_restore_power_routine = 0
src.blind.invisibility = 101
clear_fullscreen("blind")
update_icon()
return
else if (ai_restore_power_routine==3)
to_chat(src, "Alert cancelled. Power has been restored.")
ai_restore_power_routine = 0
src.blind.invisibility = 101
clear_fullscreen("blind")
update_icon()
return
else if (APU_power)
ai_restore_power_routine = 0
src.blind.invisibility = 101
clear_fullscreen("blind")
update_icon()
return
else
@@ -73,7 +73,7 @@
if (!istype(T, /turf/space))
to_chat(src, "Alert cancelled. Power has been restored without our assistance.")
ai_restore_power_routine = 0
src.blind.invisibility = 101
clear_fullscreen("blind")
return
to_chat(src, "Fault confirmed: missing external power. Shutting down main control system to save power.")
sleep(20)
@@ -103,7 +103,7 @@
if (!istype(T, /turf/space))
to_chat(src, "Alert cancelled. Power has been restored without our assistance.")
ai_restore_power_routine = 0
src.blind.invisibility = 101 //This, too, is a fix to issue 603
clear_fullscreen("blind")
return
switch(PRP)
if (1) to_chat(src, "APC located. Optimizing route to APC to avoid needless power waste.")
@@ -146,9 +146,7 @@
/mob/living/silicon/ai/update_sight()
if(is_blinded())
update_icon()
src.blind.screen_loc = ui_entire_screen
if (src.blind.invisibility != 0)
src.blind.invisibility = 0
overlay_fullscreen("blind", /obj/screen/fullscreen/blind)
sight &= ~(SEE_TURFS | SEE_MOBS | SEE_OBJS)
see_in_dark = 0
see_invisible = SEE_INVISIBLE_LIVING

View File

@@ -11,7 +11,7 @@
blind.icon_state = "black"
blind.name = " "
blind.screen_loc = ui_entire_screen
blind.invisibility = 101
clear_fullscreen("blind")
client.screen.Add( blind, flash )
for(var/image/obfuscation_image in SSai_obfuscation.get_obfuscation_images())

View File

@@ -265,23 +265,16 @@
else
bodytemp.icon_state = "temp-2"
client.screen.Remove(global_hud.blurry, global_hud.druggy, global_hud.vimpaired)
if((blind && stat != DEAD))
if(blinded)
blind.invisibility = 0
else
blind.invisibility = 101
if(disabilities & NEARSIGHTED)
client.screen += global_hud.vimpaired
if(eye_blurry)
client.screen += global_hud.blurry
if(druggy)
client.screen += global_hud.druggy
if(stat != DEAD)
if(machine)
if(machine.check_eye(src) < 0)
if(blinded)
overlay_fullscreen("blind", /obj/screen/fullscreen/blind)
else
clear_fullscreen("blind")
set_fullscreen(disabilities & NEARSIGHTED, "impaired", /obj/screen/fullscreen/impaired, 1)
set_fullscreen(eye_blurry, "blurry", /obj/screen/fullscreen/blurry)
if (machine)
if (machine.check_eye(src) < 0)
reset_view(null)
else
if(client && !client.adminobs)

View File

@@ -108,7 +108,7 @@
if(2)
src.take_organ_damage(0, 10, emp = TRUE)
Stun(rand(1, 5))
flick("noise", src:flash)
flash_eyes(affect_silicon = 1)
to_chat(src, SPAN_DANGER("BZZZT"))
to_chat(src, SPAN_WARNING("Warning: Electromagnetic pulse detected."))
..()
@@ -381,6 +381,13 @@
if(cameraFollow)
cameraFollow = null
/mob/living/silicon/flash_eyes(intensity = FLASH_PROTECTION_MODERATE, override_blindness_check = FALSE, affect_silicon = FALSE, visual = FALSE, type = /obj/screen/fullscreen/flash)
if(affect_silicon)
return ..()
/mob/living/silicon/seizure()
flash_eyes(affect_silicon = TRUE)
/mob/living/silicon/Move(newloc, direct)
. = ..()
if(underdoor)

View File

@@ -95,7 +95,7 @@
M.apply_damage(min(strength*0.85,2)+mut, BURN, damage_flags = DAM_SHARP) // Stinging. The more mutated I am, the harder I sting.
M.apply_damage(max(strength*0.2,(round(feral/10,1)*(max((round(strength/20,1)),1)))+toxic), TOX) // Bee venom based on how angry I am and how many there are of me!
to_chat(M, "<span class='warning'>You have been stung!</span>")
M.flash_pain()
M.flash_pain(5)

View File

@@ -86,6 +86,7 @@
MOB_STOP_THINKING(src)
update_client_color()
add_click_catcher()
// Check code/modules/admin/verbs/antag-ooc.dm for definition
client.add_aooc_if_necessary()

View File

@@ -1065,20 +1065,16 @@
/mob/proc/get_pressure_weakness()
return 1
/mob/proc/flash_weak_pain()
flick("weak_pain", pain)
/mob/living/carbon/human/flash_weak_pain()
if(can_feel_pain())
flick("weak_pain", pain)
/mob/living/proc/flash_strong_pain()
return
/mob/living/carbon/human/flash_strong_pain()
if(can_feel_pain())
flick("strong_pain", pain)
overlay_fullscreen("strong_pain", /obj/screen/fullscreen/strong_pain)
addtimer(CALLBACK(src, .proc/clear_strong_pain), 10, TIMER_UNIQUE)
/mob/living/proc/clear_strong_pain()
clear_fullscreen("strong_pain", 10)
/mob/proc/Jitter(amount)
jitteriness = max(jitteriness,amount,0)

View File

@@ -1185,3 +1185,8 @@ proc/is_blind(A)
var/datum/accent/a = SSrecords.accents[used_accent]
var/final_icon = a.tag_icon
return "<img src=\"[final_icon].png\">"
/mob/proc/flash_eyes(intensity = FLASH_PROTECTION_MODERATE, override_blindness_check = FALSE, affect_silicon = FALSE, visual = FALSE, type = /obj/screen/fullscreen/flash)
for(var/mob/M in contents)
M.flash_eyes(intensity, override_blindness_check, affect_silicon, visual, type)
M.flash_eyes(intensity, override_blindness_check, affect_silicon, visual, type)

View File

@@ -1,9 +1,7 @@
/mob/proc/flash_pain()
flick("pain", pain)
/mob/living/carbon/human/flash_pain()
if(can_feel_pain())
flick("pain", pain)
/mob/proc/flash_pain(var/target)
if(pain)
animate(pain, alpha = target, time = 15, easing = ELASTIC_EASING)
animate(pain, alpha = 0, time = 20)
mob/var/list/pain_stored = list()
mob/var/last_pain_message = ""
@@ -25,6 +23,8 @@ mob/var/next_pain_time = 0
else
affecting.add_pain(Ceiling(power/2))
flash_pain(min(round(2*power)+55, 255))
// Anti message spam checks
if(force || (message != last_pain_message) || (world.time >= next_pain_time))
last_pain_message = message
@@ -32,13 +32,10 @@ mob/var/next_pain_time = 0
flash_strong_pain()
to_chat(src, "<span class='danger'><font size=3>[message]</font></span>")
else if(power >= 70)
flash_pain()
to_chat(src, "<span class='danger'><font size=3>[message]</font></span>")
else if(power >= 40)
flash_pain()
to_chat(src, "<span class='danger'><font size=2>[message]</font></span>")
else if(power >= 10)
flash_weak_pain()
to_chat(src, "<span class='danger'>[message]</span>")
else
to_chat(src, "<span class='warning'>[message]</span>")

View File

@@ -25,7 +25,7 @@
for(var/mob/living/carbon/M in viewers(T, flash_range))
if(M.eyecheck() < FLASH_PROTECTION_MODERATE)
M.confused = rand(5,15)
flick("e_flash", M.flash)
M.flash_eyes()
else if(affected_limb && M == A)
M.confused = rand(2, 7)
flick("flash", M.flash)

View File

@@ -835,7 +835,7 @@
if(istype(M:glasses, /obj/item/clothing/glasses/sunglasses))
continue
flick("e_flash", M.flash)
M.flash_eyes()
M.Weaken(15)
if(4 to 5)
@@ -843,7 +843,7 @@
if(istype(M:glasses, /obj/item/clothing/glasses/sunglasses))
continue
flick("e_flash", M.flash)
M.flash_eyes()
M.Stun(5)
/datum/chemical_reaction/emp_pulse
@@ -1350,7 +1350,7 @@
playsound(get_turf(holder.my_atom), 'sound/effects/phasein.ogg', 100, 1)
for(var/mob/living/carbon/human/M in viewers(get_turf(holder.my_atom), null))
if(M.eyecheck(TRUE) <= 0)
flick("e_flash", M.flash)
M.flash_eyes()
for(var/i = 1, i <= 5, i++)
var/chosen = pick(critters)
@@ -1410,7 +1410,7 @@
playsound(get_turf(holder.my_atom), 'sound/effects/phasein.ogg', 100, 1)
for(var/mob/living/carbon/human/M in viewers(get_turf(holder.my_atom), null))
if(M.eyecheck(TRUE) < FLASH_PROTECTION_MODERATE)
flick("e_flash", M.flash)
M.flash_eyes()
for(var/i = 1, i <= 4 + rand(1,2), i++)
var/chosen = pick(borks)

View File

@@ -0,0 +1,44 @@
################################
# Example Changelog File
#
# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
#
# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
# When it is, any changes listed below will disappear.
#
# Valid Prefixes:
# bugfix
# wip (For works in progress)
# tweak
# soundadd
# sounddel
# rscadd (general adding of nice things)
# rscdel (general deleting of nice things)
# imageadd
# imagedel
# maptweak
# spellcheck (typo fixes)
# experiment
# balance
# admin
# backend
# security
# refactor
#################################
# Your name.
author: MattAtlas
# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
delete-after: True
# Any changes you've made. See valid prefix list above.
# INDENT WITH TWO SPACES. NOT TABS. SPACES.
# SCREW THIS UP AND IT WON'T WORK.
# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries.
# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog.
changes:
- rscadd: "You can now click dark spots to turn."
- bugfix: "Fixed the vampire frenzy overlay never showing up."
- tweak: "Unconsciousness is now a fully black overlay."
- rscadd: "Added fadeout animations to flashing, pain and damage overlays."

Binary file not shown.

Before

Width:  |  Height:  |  Size: 272 KiB

After

Width:  |  Height:  |  Size: 272 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 MiB

After

Width:  |  Height:  |  Size: 3.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 43 KiB

BIN
icons/mob/screen_full.dmi Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB