510 Improved Overlays

Fixes auto blindness and no click on 510 servers, lessens the lag of
mesons and material scanners, and I suspect the general speed as well.

I only made it work for Polaris (and by extention, to our server, Eros),
and adapted it a bit.

Ported from:

7c2cc890ab
This commit is contained in:
Richard D'angelo
2016-06-18 15:50:10 -03:00
parent 1a53790a4c
commit 7ab5220f64
41 changed files with 287 additions and 317 deletions

View File

@@ -0,0 +1 @@
#define CLICKCATCHER_PLANE -99

View File

@@ -321,11 +321,19 @@
facedir(direction)
/obj/screen/click_catcher
icon = 'icons/mob/screen1_full.dmi'
icon_state = "passage0"
layer = 0
icon = 'icons/mob/screen_gen.dmi'
icon_state = "click_catcher"
plane = CLICKCATCHER_PLANE
mouse_opacity = 2
screen_loc = "1,1"
screen_loc = "CENTER-7,CENTER-7"
/obj/screen/click_catcher/proc/MakeGreed()
. = 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)
@@ -333,6 +341,6 @@
var/mob/living/carbon/C = usr
C.swap_hand()
else
var/turf/T = screen_loc2turf(modifiers["screen-loc"], get_turf(usr))
var/turf/T = screen_loc2turf("screen-loc", get_turf(usr))
T.Click(location, control, params)
return 1
. = 1

View File

@@ -132,6 +132,6 @@
mymob.client.screen = list()
mymob.client.screen += adding + other
mymob.client.screen += mymob.client.void
// mymob.client.screen += mymob.client.void
return

View File

@@ -21,20 +21,6 @@
mymob.healths.name = "health"
mymob.healths.screen_loc = ui_alien_health
mymob.blind = new /obj/screen()
mymob.blind.icon = 'icons/mob/screen1_full.dmi'
mymob.blind.icon_state = "blackimageoverlay"
mymob.blind.name = " "
mymob.blind.screen_loc = "1,1"
mymob.blind.layer = 0
mymob.flash = new /obj/screen()
mymob.flash.icon = 'icons/mob/screen1_alien.dmi'
mymob.flash.icon_state = "blank"
mymob.flash.name = "flash"
mymob.flash.screen_loc = ui_entire_screen
mymob.flash.layer = 17
mymob.fire = new /obj/screen()
mymob.fire.icon = 'icons/mob/screen1_alien.dmi'
mymob.fire.icon_state = "fire0"
@@ -42,6 +28,6 @@
mymob.fire.screen_loc = ui_fire
mymob.client.screen = list()
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.rest, mymob.sleep, mymob.mach )
mymob.client.screen += src.adding + src.other
mymob.client.screen += mymob.client.void
// mymob.client.screen += mymob.client.void

View File

@@ -0,0 +1,118 @@
#define FULLSCREEN_LAYER 18
#define DAMAGE_LAYER FULLSCREEN_LAYER + 0.1
#define BLIND_LAYER DAMAGE_LAYER + 0.1
#define CRIT_LAYER BLIND_LAYER + 0.1
/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 = PoolOrNew(type)
screen.icon_state = "[initial(screen.icon_state)][severity]"
screen.severity = severity
screens[category] = screen
if(client && stat != DEAD)
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 && stat != DEAD) //dead mob do not see any of the fullscreen overlays that he has.
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"
layer = FULLSCREEN_LAYER
mouse_opacity = 0
var/severity = 0
/obj/screen/fullscreen/Destroy()
severity = 0
return ..()
/obj/screen/fullscreen/brute
icon_state = "brutedamageoverlay"
layer = DAMAGE_LAYER
/obj/screen/fullscreen/oxy
icon_state = "oxydamageoverlay"
layer = DAMAGE_LAYER
/obj/screen/fullscreen/crit
icon_state = "passage"
layer = CRIT_LAYER
/obj/screen/fullscreen/blind
icon_state = "blackimageoverlay"
layer = BLIND_LAYER
/obj/screen/fullscreen/impaired
icon_state = "impairedoverlay"
/obj/screen/fullscreen/blurry
icon = 'icons/mob/screen1.dmi'
screen_loc = "WEST,SOUTH to EAST,NORTH"
icon_state = "blurry"
/obj/screen/fullscreen/flash
icon = 'icons/mob/screen1.dmi'
screen_loc = "WEST,SOUTH to EAST,NORTH"
icon_state = "flash"
/obj/screen/fullscreen/flash/noise
icon_state = "noise"
/obj/screen/fullscreen/high
icon = 'icons/mob/screen1.dmi'
screen_loc = "WEST,SOUTH to EAST,NORTH"
icon_state = "druggy"
#undef FULLSCREEN_LAYER
#undef BLIND_LAYER
#undef DAMAGE_LAYER
#undef CRIT_LAYER

View File

@@ -269,7 +269,7 @@ datum/hud/New(mob/owner)
else if(isrobot(mymob))
robot_hud(ui_style, ui_color, ui_alpha, mymob)
else if(isbrain(mymob))
brain_hud(ui_style)
mymob.instantiate_hud(src)
else if(isalien(mymob))
larva_hud()
else if(isslime(mymob))
@@ -382,3 +382,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 += client.void
///mob/new_player/add_click_catcher()
// return

View File

@@ -303,32 +303,6 @@
mymob.ling_chem_display.icon_state = "ling_chems"
hud_elements |= mymob.ling_chem_display
mymob.blind = new /obj/screen()
mymob.blind.icon = 'icons/mob/screen1_full.dmi'
mymob.blind.icon_state = "blackimageoverlay"
mymob.blind.name = " "
mymob.blind.screen_loc = "1,1"
mymob.blind.mouse_opacity = 0
mymob.blind.layer = 0
hud_elements |= mymob.blind
mymob.damageoverlay = new /obj/screen()
mymob.damageoverlay.icon = 'icons/mob/screen1_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
hud_elements |= mymob.flash
mymob.pain = new /obj/screen( null )
mymob.zone_sel = new /obj/screen/zone_sel( null )
@@ -365,8 +339,7 @@
mymob.client.screen += hud_elements
mymob.client.screen += src.adding + src.hotkeybuttons
mymob.client.screen += mymob.client.void
inventory_shown = 0;
inventory_shown = 0
return

View File

@@ -5,14 +5,6 @@
/datum/hud/proc/ghost_hud()
return
/datum/hud/proc/brain_hud(ui_style = 'icons/mob/screen1_Midnight.dmi')
mymob.blind = new /obj/screen()
mymob.blind.icon = 'icons/mob/screen1_full.dmi'
mymob.blind.icon_state = "blackimageoverlay"
mymob.blind.name = " "
mymob.blind.screen_loc = "1,1"
mymob.blind.layer = 0
/datum/hud/proc/blob_hud(ui_style = 'icons/mob/screen1_Midnight.dmi')
blobpwrdisplay = new /obj/screen()
@@ -116,13 +108,6 @@
else if(istype(mymob,/mob/living/simple_animal/construct/harvester))
constructtype = "harvester"
mymob.flash = new /obj/screen()
mymob.flash.icon = 'icons/mob/screen1.dmi'
mymob.flash.icon_state = "blank"
mymob.flash.name = "flash"
mymob.flash.screen_loc = ui_entire_screen
mymob.flash.layer = 17
if(constructtype)
mymob.fire = new /obj/screen()
mymob.fire.icon = 'icons/mob/screen1_construct.dmi'
@@ -155,5 +140,5 @@
mymob.client.screen = list()
mymob.client.screen += list(mymob.fire, mymob.healths, mymob.pullin, mymob.zone_sel, mymob.purged, mymob.flash)
mymob.client.screen += mymob.client.void
mymob.client.screen += list(mymob.fire, mymob.healths, mymob.pullin, mymob.zone_sel, mymob.purged)
// mymob.client.screen += mymob.client.void

View File

@@ -173,21 +173,6 @@ var/obj/screen/robot_inventory
mymob.pullin.screen_loc = ui_borg_pull
src.other += mymob.pullin
mymob.blind = new /obj/screen()
mymob.blind.icon = 'icons/mob/screen1_full.dmi'
mymob.blind.icon_state = "blackimageoverlay"
mymob.blind.name = " "
mymob.blind.screen_loc = "1,1"
mymob.blind.layer = 0
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
src.other += mymob.flash
mymob.zone_sel = new /obj/screen/zone_sel()
mymob.zone_sel.icon = ui_style
mymob.zone_sel.alpha = ui_alpha
@@ -210,9 +195,9 @@ var/obj/screen/robot_inventory
mymob.client.screen = list()
mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.fire, mymob.hands, mymob.healths, mymob:cells, mymob.pullin, mymob.blind, mymob.flash, robot_inventory, mymob.gun_setting_icon)
mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.fire, mymob.hands, mymob.healths, mymob:cells, mymob.pullin, robot_inventory, mymob.gun_setting_icon)
mymob.client.screen += src.adding + src.other
mymob.client.screen += mymob.client.void
// mymob.client.screen += mymob.client.void
return

View File

@@ -465,7 +465,6 @@ var/list/sacrificed = list()
break
D.universal_speak = 1
D.status_flags &= ~GODMODE
D.s_tone = 35
D.b_eyes = 200
D.r_eyes = 200
D.g_eyes = 200
@@ -1052,7 +1051,7 @@ var/list/sacrificed = list()
for(var/mob/living/L in viewers(src))
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
C.Weaken(1)
@@ -1081,7 +1080,7 @@ var/list/sacrificed = list()
admin_attack_log(usr, T, "Used a stun rune.", "Was victim of a stun rune.", "used a stun rune on")
else if(iscarbon(T))
var/mob/living/carbon/C = T
flick("e_flash", C.flash)
C.flash_eyes()
if (!(HULK in C.mutations))
C.silent += 15
C.Weaken(25)

View File

@@ -43,7 +43,7 @@ var/global/universe_has_ended = 0
world << sound('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.")
@@ -122,6 +122,6 @@ 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)

View File

@@ -77,11 +77,12 @@
if(!E)
return
if(E.is_bruised() && prob(E.damage + 50))
flick("e_flash", O:flash)
H.flash_eyes()
E.damage += rand(1, 5)
else
if(!O.blinded)
flick("flash", O:flash)
if(!O.blinded && isliving(O))
var/mob/living/L = O
L.flash_eyes()
O.Weaken(flash_time)
/obj/machinery/flasher/emp_act(severity)

View File

@@ -80,7 +80,7 @@
flash_strength *= H.species.flash_mod
if(flash_strength > 0)
M.Weaken(flash_strength)
flick("e_flash", M.flash)
M.flash_eyes()
else
flashfail = 1
@@ -158,7 +158,7 @@
var/safety = M:eyecheck()
if(!safety)
if(!M.blinded)
flick("flash", M.flash)
M.flash_eyes()
return
@@ -177,7 +177,7 @@
var/safety = M.eyecheck()
if(safety <= 0)
M.Weaken(10)
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

@@ -81,7 +81,7 @@
user << "<span class='notice'>\The [M]'s pupils narrow.</span>"
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) //can be used offensively
flick("flash", M.flash)
M.flash_eyes()
else
return ..()

View File

@@ -40,7 +40,7 @@
//Flashing everyone
if(eye_safety < 1)
flick("e_flash", M.flash)
M.flash_eyes()
M.Stun(2)
M.Weaken(10)

View File

@@ -18,7 +18,7 @@
playsound(T, 'sound/effects/phasein.ogg', 100, 1)
for(var/mob/living/carbon/human/M in viewers(T, null))
if(M:eyecheck() <= 0)
flick("e_flash", M.flash)
M.flash_eyes()
// Spawn some hostile syndicate critters
for(var/i=1, i<=deliveryamt, i++)

View File

@@ -157,7 +157,7 @@
nanomanager.send_resources(src)
if(!void)
void = new()
void = void.MakeGreed()
screen += void
if(prefs.lastchangelog != changelog_hash) //bolds the changelog button on the interface so we know there are updates.

View File

@@ -450,7 +450,7 @@ var/list/mining_overlay_cache = list()
if(prob(50))
M.adjustBruteLoss(5)
else
flick("flash",M.flash)
M.flash_eyes()
if(prob(50))
M.Stun(5)
M.apply_effect(25, IRRADIATE)

View File

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

View File

@@ -1,7 +1,7 @@
/mob/living/carbon/alien/ex_act(severity)
if(!blinded)
flick("flash", flash)
flash_eyes()
var/b_loss = null
var/f_loss = null

View File

@@ -124,21 +124,16 @@
if (client)
client.screen.Remove(global_hud.blurry,global_hud.druggy,global_hud.vimpaired)
if ((blind && stat != 2))
if ( stat != 2)
if ((blinded))
blind.layer = 18
overlay_fullscreen("blind", /obj/screen/fullscreen/blind)
else
blind.layer = 0
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)
set_fullscreen(druggy, "high", /obj/screen/fullscreen/high)
if(machine)
if(machine.check_eye(src) < 0)
reset_view(null)
else
if(client && !client.adminobs)

View File

@@ -208,22 +208,15 @@
if (client)
client.screen.Remove(global_hud.blurry,global_hud.druggy,global_hud.vimpaired)
if ((blind && stat != 2))
if ((blinded))
blind.layer = 18
else
blind.layer = 0
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 ((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)
set_fullscreen(druggy, "high", /obj/screen/fullscreen/high)
if (machine)
if (!( machine.check_eye(src) ))
reset_view(null)
@@ -240,16 +233,3 @@
else
if(client && !client.adminobs)
reset_view(null)
/*/mob/living/carbon/brain/emp_act(severity)
if(!(container && istype(container, /obj/item/device/mmi)))
return
else
switch(severity)
if(1)
emp_damage += rand(20,30)
if(2)
emp_damage += rand(10,20)
if(3)
emp_damage += rand(0,10)
..()*/

View File

@@ -84,7 +84,7 @@
/mob/living/carbon/human/ex_act(severity)
if(!blinded)
flick("flash", flash)
flash_eyes()
var/shielded = 0
var/b_loss = null
@@ -774,13 +774,6 @@
b_eyes = hex2num(copytext(new_eyes, 6, 8))
update_eyes()
var/new_tone = input("Please select skin tone level: 1-220 (1=albino, 35=caucasian, 150=black, 220='very' black)", "Character Generation", "[35-s_tone]") as text
if (!new_tone)
new_tone = 35
s_tone = max(min(round(text2num(new_tone)), 220), 1)
s_tone = -s_tone + 35
// hair
var/list/all_hairs = typesof(/datum/sprite_accessory/hair) - /datum/sprite_accessory/hair
var/list/hairs = list()

View File

@@ -32,7 +32,6 @@
var/temperature_alert = 0
var/in_stasis = 0
var/heartbeat = 0
var/global/list/overlays_cache = null
/mob/living/carbon/human/Life()
set invisibility = 0
@@ -1012,33 +1011,6 @@
return 1
/mob/living/carbon/human/handle_regular_hud_updates()
if(!overlays_cache)
overlays_cache = list()
overlays_cache.len = 23
overlays_cache[1] = image('icons/mob/screen1_full.dmi', "icon_state" = "passage1")
overlays_cache[2] = image('icons/mob/screen1_full.dmi', "icon_state" = "passage2")
overlays_cache[3] = image('icons/mob/screen1_full.dmi', "icon_state" = "passage3")
overlays_cache[4] = image('icons/mob/screen1_full.dmi', "icon_state" = "passage4")
overlays_cache[5] = image('icons/mob/screen1_full.dmi', "icon_state" = "passage5")
overlays_cache[6] = image('icons/mob/screen1_full.dmi', "icon_state" = "passage6")
overlays_cache[7] = image('icons/mob/screen1_full.dmi', "icon_state" = "passage7")
overlays_cache[8] = image('icons/mob/screen1_full.dmi', "icon_state" = "passage8")
overlays_cache[9] = image('icons/mob/screen1_full.dmi', "icon_state" = "passage9")
overlays_cache[10] = image('icons/mob/screen1_full.dmi', "icon_state" = "passage10")
overlays_cache[11] = image('icons/mob/screen1_full.dmi', "icon_state" = "oxydamageoverlay1")
overlays_cache[12] = image('icons/mob/screen1_full.dmi', "icon_state" = "oxydamageoverlay2")
overlays_cache[13] = image('icons/mob/screen1_full.dmi', "icon_state" = "oxydamageoverlay3")
overlays_cache[14] = image('icons/mob/screen1_full.dmi', "icon_state" = "oxydamageoverlay4")
overlays_cache[15] = image('icons/mob/screen1_full.dmi', "icon_state" = "oxydamageoverlay5")
overlays_cache[16] = image('icons/mob/screen1_full.dmi', "icon_state" = "oxydamageoverlay6")
overlays_cache[17] = image('icons/mob/screen1_full.dmi', "icon_state" = "oxydamageoverlay7")
overlays_cache[18] = image('icons/mob/screen1_full.dmi', "icon_state" = "brutedamageoverlay1")
overlays_cache[19] = image('icons/mob/screen1_full.dmi', "icon_state" = "brutedamageoverlay2")
overlays_cache[20] = image('icons/mob/screen1_full.dmi', "icon_state" = "brutedamageoverlay3")
overlays_cache[21] = image('icons/mob/screen1_full.dmi', "icon_state" = "brutedamageoverlay4")
overlays_cache[22] = image('icons/mob/screen1_full.dmi', "icon_state" = "brutedamageoverlay5")
overlays_cache[23] = image('icons/mob/screen1_full.dmi', "icon_state" = "brutedamageoverlay6")
if(hud_updateflag) // update our mob's hud overlays, AKA what others see flaoting above our head
handle_hud_list()
@@ -1057,75 +1029,53 @@
var/obj/machinery/camera/cam = client.eye
client.screen |= cam.client_huds
if(damageoverlay.overlays)
damageoverlay.overlays = list()
if(stat == UNCONSCIOUS)
if(stat == UNCONSCIOUS && health <= 0)
//Critical damage passage overlay
if(health <= 0)
var/image/I
switch(health)
if(-20 to -10)
I = overlays_cache[1]
if(-30 to -20)
I = overlays_cache[2]
if(-40 to -30)
I = overlays_cache[3]
if(-50 to -40)
I = overlays_cache[4]
if(-60 to -50)
I = overlays_cache[5]
if(-70 to -60)
I = overlays_cache[6]
if(-80 to -70)
I = overlays_cache[7]
if(-90 to -80)
I = overlays_cache[8]
if(-95 to -90)
I = overlays_cache[9]
if(-INFINITY to -95)
I = overlays_cache[10]
damageoverlay.overlays += I
var/severity = 0
switch(health)
if(-20 to -10) severity = 1
if(-30 to -20) severity = 2
if(-40 to -30) severity = 3
if(-50 to -40) severity = 4
if(-60 to -50) severity = 5
if(-70 to -60) severity = 6
if(-80 to -70) severity = 7
if(-90 to -80) severity = 8
if(-95 to -90) severity = 9
if(-INFINITY to -95) severity = 10
overlay_fullscreen("crit", /obj/screen/fullscreen/crit, severity)
else
clear_fullscreen("crit")
//Oxygen damage overlay
if(oxyloss)
var/image/I
var/severity = 0
switch(oxyloss)
if(10 to 20)
I = overlays_cache[11]
if(20 to 25)
I = overlays_cache[12]
if(25 to 30)
I = overlays_cache[13]
if(30 to 35)
I = overlays_cache[14]
if(35 to 40)
I = overlays_cache[15]
if(40 to 45)
I = overlays_cache[16]
if(45 to INFINITY)
I = overlays_cache[17]
damageoverlay.overlays += I
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.
if(hurtdamage)
var/image/I
var/severity = 0
switch(hurtdamage)
if(10 to 25)
I = overlays_cache[18]
if(25 to 40)
I = overlays_cache[19]
if(40 to 55)
I = overlays_cache[20]
if(55 to 70)
I = overlays_cache[21]
if(70 to 85)
I = overlays_cache[22]
if(85 to INFINITY)
I = overlays_cache[23]
damageoverlay.overlays += I
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( stat == DEAD )
sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS|SEE_SELF
@@ -1269,20 +1219,20 @@
bodytemp.icon_state = "temp-1"
else
bodytemp.icon_state = "temp0"
if(blind)
if(blinded) blind.layer = 18
else blind.layer = 0
if(blinded) overlay_fullscreen("blind", /obj/screen/fullscreen/blind)
else clear_fullscreens()
if(disabilities & NEARSIGHTED) //this looks meh but saves a lot of memory by not requiring to add var/prescription
if(glasses) //to every /obj/item
var/obj/item/clothing/glasses/G = glasses
if(!G.prescription)
client.screen += global_hud.vimpaired
set_fullscreen(disabilities & NEARSIGHTED, "impaired", /obj/screen/fullscreen/impaired, 1)
else
client.screen += global_hud.vimpaired
set_fullscreen(disabilities & NEARSIGHTED, "impaired", /obj/screen/fullscreen/impaired, 1)
if(eye_blurry) client.screen += global_hud.blurry
if(druggy) client.screen += global_hud.druggy
set_fullscreen(eye_blurry, "blurry", /obj/screen/fullscreen/blurry)
set_fullscreen(druggy, "high", /obj/screen/fullscreen/high)
if(config.welder_vision)
var/found_welder

View File

@@ -0,0 +1,3 @@
/mob/living/death()
clear_fullscreens()
. = ..()

View File

@@ -454,6 +454,7 @@ default behaviour is:
BITSET(hud_updateflag, LIFE_HUD)
failed_last_breath = 0 //So mobs that died of oxyloss don't revive and have perpetual out of breath.
reload_fullscreen()
return
@@ -630,9 +631,7 @@ default behaviour is:
resisting++
switch(G.state)
if(GRAB_PASSIVE)
if(!incapacitated(INCAPACITATION_KNOCKDOWN))
visible_message("<span class='warning'>[src] has broken free of [G.assailant]'s grip!</span>")
qdel(G)
qdel(G)
if(GRAB_AGGRESSIVE)
//Not standing up makes it much harder to break, so it is easier to cuff someone who is down without forcing them into unconsciousness.
//Otherwise, it's the same chance of breaking the grab as disarm.
@@ -662,6 +661,15 @@ default behaviour is:
return 0
return ..()
//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
/mob/living/proc/handle_ventcrawl(var/obj/machinery/atmospherics/unary/vent_pump/vent_found = null, var/ignore_items = 0) // -- TLE -- Merged by Carn
if(stat)
src << "You must be conscious to do this!"
@@ -669,7 +677,6 @@ default behaviour is:
if(lying)
src << "You can't vent crawl while you're stunned!"
return
var/special_fail_msg = cannot_use_vents()
if(special_fail_msg)
src << "<span class='warning'>[special_fail_msg]</span>"

View File

@@ -56,18 +56,18 @@
if (aiRestorePowerRoutine==2)
src << "Alert cancelled. Power has been restored without our assistance."
aiRestorePowerRoutine = 0
src.blind.layer = 0
clear_fullscreen("blind")
updateicon()
return
else if (aiRestorePowerRoutine==3)
src << "Alert cancelled. Power has been restored."
aiRestorePowerRoutine = 0
src.blind.layer = 0
clear_fullscreen("blind")
updateicon()
return
else if (APU_power)
aiRestorePowerRoutine = 0
src.blind.layer = 0
clear_fullscreen("blind")
updateicon()
return
else
@@ -79,9 +79,7 @@
//Blind the AI
updateicon()
src.blind.screen_loc = ui_entire_screen
if (src.blind.layer!=18)
src.blind.layer = 18
overlay_fullscreen("blind", /obj/screen/fullscreen/blind)
src.sight = src.sight&~SEE_TURFS
src.sight = src.sight&~SEE_MOBS
src.sight = src.sight&~SEE_OBJS
@@ -99,7 +97,7 @@
if (!istype(T, /turf/space))
src << "Alert cancelled. Power has been restored without our assistance."
aiRestorePowerRoutine = 0
src.blind.layer = 0
clear_fullscreen("blind")
return
src << "Fault confirmed: missing external power. Shutting down main control system to save power."
sleep(20)
@@ -129,7 +127,7 @@
if (!istype(T, /turf/space))
src << "Alert cancelled. Power has been restored without our assistance."
aiRestorePowerRoutine = 0
src.blind.layer = 0 //This, too, is a fix to issue 603
clear_fullscreen("blind") //This, too, is a fix to issue 603
return
switch(PRP)
if (1) src << "APC located. Optimizing route to APC to avoid needless power waste."

View File

@@ -2,19 +2,6 @@
..()
for(var/obj/effect/rune/rune in rune_list)
client.images += rune.blood_image
regenerate_icons()
flash = new /obj/screen()
flash.icon_state = "blank"
flash.name = "flash"
flash.screen_loc = ui_entire_screen
flash.layer = 17
blind = new /obj/screen()
blind.icon_state = "black"
blind.name = " "
blind.screen_loc = ui_entire_screen
blind.layer = 0
client.screen.Add( blind, flash )
if(stat != DEAD)
for(var/obj/machinery/ai_status_display/O in machines) //change status
O.mode = 1

View File

@@ -275,29 +275,21 @@
// if (src.oxygen) src.oxygen.icon_state = "oxy[src.oxygen_alert ? 1 : 0]"
// if (src.fire) src.fire.icon_state = "fire[src.fire_alert ? 1 : 0]"
client.screen.Remove(global_hud.blurry,global_hud.druggy,global_hud.vimpaired)
if ((src.blind && src.stat != 2))
if(src.blinded)
src.blind.layer = 18
if(stat != 2)
if(blinded)
overlay_fullscreen("blind", /obj/screen/fullscreen/blind)
else
src.blind.layer = 0
if (src.disabilities & NEARSIGHTED)
src.client.screen += global_hud.vimpaired
clear_fullscreen("blind")
set_fullscreen(disabilities & NEARSIGHTED, "impaired", /obj/screen/fullscreen/impaired, 1)
set_fullscreen(eye_blurry, "blurry", /obj/screen/fullscreen/blurry)
set_fullscreen(druggy, "high", /obj/screen/fullscreen/high)
if (src.eye_blurry)
src.client.screen += global_hud.blurry
if (src.druggy)
src.client.screen += global_hud.druggy
if (src.stat != 2)
if (src.machine)
if (src.machine.check_eye(src) < 0)
src.reset_view(null)
else
if(client && !client.adminobs)
reset_view(null)
if (src.machine)
if (src.machine.check_eye(src) < 0)
src.reset_view(null)
else
if(client && !client.adminobs)
reset_view(null)
return 1

View File

@@ -67,7 +67,7 @@
if(2)
src.take_organ_damage(0,10,emp=1)
confused = (min(confused + 2, 30))
flick("noise", src.flash)
flash_eyes(affect_silicon = 1)
src << "<span class='danger'><B>*BZZZT*</B></span>"
src << "<span class='danger'>Warning: Electromagnetic pulse detected.</span>"
..()
@@ -264,7 +264,7 @@
/mob/living/silicon/ex_act(severity)
if(!blinded)
flick("flash", flash)
flash_eyes()
switch(severity)
if(1.0)
@@ -361,3 +361,7 @@
..()
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 ..()

View File

@@ -380,7 +380,7 @@
/mob/living/simple_animal/ex_act(severity)
if(!blinded)
flick("flash", flash)
flash_eyes()
switch (severity)
if (1.0)
adjustBruteLoss(500)

View File

@@ -44,6 +44,7 @@
else
client.eye = src
client.perspective = MOB_PERSPECTIVE
reload_fullscreen() // Reload any fullscreen overlays this mob has.
// add_click_catcher()
//set macro to normal incase it was overriden (like cyborg currently does)
winset(src, null, "mainwindow.macro=macro hotkey_toggle.is-checked=false input.focus=true input.background-color=#D3B5B5")

View File

@@ -4,6 +4,7 @@
living_mob_list -= src
unset_machine()
qdel(hud_used)
clear_fullscreen()
if(client)
for(var/obj/screen/movable/spell_master/spell_master in spell_masters)
qdel(spell_master)
@@ -17,8 +18,6 @@
..()
/mob/proc/remove_screen_obj_references()
flash = null
blind = null
hands = null
pullin = null
purged = null
@@ -33,7 +32,6 @@
throw_icon = null
nutrition_icon = null
pressure = null
damageoverlay = null
pain = null
item_use_icon = null
gun_move_icon = null
@@ -360,8 +358,8 @@
var/deathtimeseconds = round((deathtime - deathtimeminutes * 600) / 10,1)
usr << "You have been dead for[pluralcheck] [deathtimeseconds] seconds."
if (deathtime < (15 * 600))
usr << "You must wait 15 minutes to respawn!"
if (deathtime < (5 * 600))
usr << "You must wait 5 minutes to respawn!"
return
else
usr << "You can respawn now, enjoy your new life!"

View File

@@ -10,8 +10,6 @@
//Not in use yet
var/obj/effect/organstructure/organStructure = null
var/obj/screen/flash = null
var/obj/screen/blind = null
var/obj/screen/hands = null
var/obj/screen/pullin = null
var/obj/screen/purged = null
@@ -26,7 +24,6 @@
var/obj/screen/throw_icon = null
var/obj/screen/nutrition_icon = null
var/obj/screen/pressure = null
var/obj/screen/damageoverlay = null
var/obj/screen/pain = null
var/obj/screen/gun/item/item_use_icon = null
var/obj/screen/gun/radio/radio_use_icon = null

View File

@@ -571,3 +571,6 @@ var/list/global/organ_rel_size = list(
"l_foot" = 10,
"r_foot" = 10,
)
/mob/proc/flash_eyes(intensity = FLASH_PROTECTION_MODERATE, override_blindness_check = FALSE, affect_silicon = FALSE, visual = FALSE, type = /obj/screen/fullscreen/flash)
return

View File

@@ -23,7 +23,7 @@
//blind adjacent people
for (var/mob/living/carbon/M in viewers(T, flash_range))
if(M.eyecheck() < 1)
flick("e_flash", M.flash)
M.flash_eyes()
//snap pop
playsound(src, 'sound/effects/snap.ogg', 50, 1)

View File

@@ -622,7 +622,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)
@@ -630,7 +630,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
@@ -1499,7 +1499,7 @@
name = "Allies Cocktail"
id = "alliescocktail"
result = "alliescocktail"
required_reagents = list("classicmartini" = 1, "vodka" = 1)
required_reagents = list("martini" = 1, "vodka" = 1)
result_amount = 2
/datum/chemical_reaction/demonsblood

View File

@@ -26,7 +26,7 @@
for(var/mob/living/target in targets)
target.visible_message( "<span class='danger'>[target]'s face lights up in fire, and after the event a horse's head takes its place!</span>", \
"<span class='danger'>Your face burns up, and shortly after the fire you realise you have the face of a horse!</span>")
flick("e_flash", target.flash)
target.flash_eyes()
/spell/targeted/equip_item/horsemask/summon_item(var/new_type)
var/obj/item/new_item = new new_type

BIN
icons/mob/screen_full.dmi Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

BIN
icons/mob/screen_gen.dmi Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 B

View File

@@ -63,6 +63,7 @@
#include "code\_helpers\type2type.dm"
#include "code\_helpers\unsorted.dm"
#include "code\_helpers\vector.dm"
#include "code\_onclick\_defines.dm"
#include "code\_onclick\adjacent.dm"
#include "code\_onclick\ai.dm"
#include "code\_onclick\click.dm"
@@ -77,6 +78,7 @@
#include "code\_onclick\hud\action.dm"
#include "code\_onclick\hud\ai.dm"
#include "code\_onclick\hud\alien_larva.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"
@@ -1342,6 +1344,7 @@
#include "code\modules\mob\language\synthetic.dm"
#include "code\modules\mob\living\autohiss.dm"
#include "code\modules\mob\living\damage_procs.dm"
#include "code\modules\mob\living\death.dm"
#include "code\modules\mob\living\default_language.dm"
#include "code\modules\mob\living\inventory.dm"
#include "code\modules\mob\living\life.dm"