510: HUD, Flash Refactor, Rip out unused pain system

This commit is contained in:
Tigercat2000
2016-02-28 18:09:43 -08:00
parent 976887b2e0
commit 0c9a469f2c
67 changed files with 558 additions and 955 deletions
-6
View File
@@ -291,9 +291,6 @@
"Vox" = 'icons/mob/species/vox/eyes.dmi'
)
/obj/item/clothing/glasses/welding/proc/getMask()
return global_hud.darkMask
/obj/item/clothing/glasses/welding/attack_self()
toggle()
@@ -336,9 +333,6 @@
"Vox" = 'icons/mob/species/vox/eyes.dmi'
)
/obj/item/clothing/glasses/welding/superior/getMask()
return null
/obj/item/clothing/glasses/sunglasses/blindfold
name = "blindfold"
desc = "Covers the eyes, preventing sight."
+3 -5
View File
@@ -36,10 +36,9 @@
command_announcement.Announce("Massive bluespace translocation detected.", "Anomaly Alert")
var/list/flashers = list()
for(var/mob/living/carbon/human/M in viewers(TO, null))
if(M:eyecheck() <= 0)
flick("e_flash", M.flash) // flash dose faggots
flashers += M
for(var/mob/living/carbon/C in viewers(TO, null))
if(C.flash_eyes())
flashers += C
var/y_distance = TO.y - FROM.y
var/x_distance = TO.x - FROM.x
@@ -66,4 +65,3 @@
M.client.screen -= blueeffect
qdel(blueeffect)
qdel(newAnomaly)
@@ -71,7 +71,7 @@
/mob/living/carbon/alien/proc/getPlasma()
return storedPlasma
/mob/living/carbon/alien/eyecheck()
/mob/living/carbon/alien/check_eye_prot()
return 2
/mob/living/carbon/alien/updatehealth()
@@ -314,4 +314,4 @@ Des: Removes all infected images from the alien.
playsound(T, S, volume, 1, range)
return 1
return 0
return 0
@@ -50,7 +50,6 @@
for(var/mob/O in viewers(src, null))
O.show_message("<B>[src]</B> lets out a waning guttural screech, green blood bubbling from its maw...", 1)
update_canmove()
if(client) blind.layer = 0
update_icons()
timeofdeath = worldtime2text()
@@ -130,77 +130,4 @@
if(druggy)
druggy = max(druggy-1, 0)
return 1
/mob/living/carbon/alien/humanoid/handle_regular_hud_updates()
if (stat == 2 || (XRAY in mutations))
sight |= SEE_TURFS
sight |= SEE_MOBS
sight |= SEE_OBJS
see_in_dark = 8
see_invisible = SEE_INVISIBLE_LEVEL_TWO
else if (stat != 2)
sight |= SEE_MOBS
sight &= ~SEE_TURFS
sight &= ~SEE_OBJS
if(nightvision)
see_in_dark = 8
see_invisible = SEE_INVISIBLE_MINIMUM
else if(!nightvision)
see_in_dark = 4
see_invisible = 45
if(see_override)
see_invisible = see_override
if (healths)
if (stat != 2)
switch(health)
if(100 to INFINITY)
healths.icon_state = "health0"
if(75 to 100)
healths.icon_state = "health1"
if(50 to 75)
healths.icon_state = "health2"
if(25 to 50)
healths.icon_state = "health3"
if(0 to 25)
healths.icon_state = "health4"
else
healths.icon_state = "health5"
else
healths.icon_state = "health6"
if (toxin) toxin.icon_state = "tox[toxins_alert ? 1 : 0]"
if (oxygen) oxygen.icon_state = "oxy[oxygen_alert ? 1 : 0]"
if (fire) fire.icon_state = "fire[fire_alert ? 1 : 0]"
//NOTE: the alerts dont reset when youre out of danger. dont blame me,
//blame the person who coded them. Temporary fix added.
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 (machine)
if (!( machine.check_eye(src) ))
reset_view(null)
else
if(!client.adminobs)
reset_view(null)
return 1
return 1
@@ -7,7 +7,6 @@
if(!gibbed)
visible_message("<span class='name'>[src]</span> lets out a waning high-pitched cry.")
update_canmove()
if(client) blind.layer = 0
timeofdeath = worldtime2text()
if(mind) mind.store_memory("Time of death: [timeofdeath]", 0)
@@ -85,84 +85,4 @@
if(druggy)
druggy = max(druggy-1, 0)
return 1
/mob/living/carbon/alien/larva/handle_regular_hud_updates()
if (stat == 2 || (XRAY in mutations))
sight |= SEE_TURFS
sight |= SEE_MOBS
sight |= SEE_OBJS
see_in_dark = 8
see_invisible = SEE_INVISIBLE_LEVEL_TWO
else if (stat != 2)
sight |= SEE_MOBS
sight &= ~SEE_TURFS
sight &= ~SEE_OBJS
if(nightvision)
see_in_dark = 8
see_invisible = SEE_INVISIBLE_MINIMUM
else if(!nightvision)
see_in_dark = 4
see_invisible = 45
if(see_override)
see_invisible = see_override
if (healths)
if (stat != 2)
switch(health)
if(25 to INFINITY)
healths.icon_state = "health0"
if(19 to 25)
healths.icon_state = "health1"
if(13 to 19)
healths.icon_state = "health2"
if(7 to 13)
healths.icon_state = "health3"
if(0 to 7)
healths.icon_state = "health4"
else
healths.icon_state = "health5"
else
healths.icon_state = "health6"
if(pullin)
if(pulling)
pullin.icon_state = "pull"
else
pullin.icon_state = "pull0"
if (toxin) toxin.icon_state = "tox[toxins_alert ? 1 : 0]"
if (oxygen) oxygen.icon_state = "oxy[oxygen_alert ? 1 : 0]"
if (fire) fire.icon_state = "fire[fire_alert ? 1 : 0]"
//NOTE: the alerts dont reset when youre out of danger. dont blame me,
//blame the person who coded them. Temporary fix added.
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 (machine)
if (!( machine.check_eye(src) ))
reset_view(null)
else
if(!client.adminobs)
reset_view(null)
return 1
+21 -1
View File
@@ -36,4 +36,24 @@
src << "<span class='danger'>You feel a searing heat in your lungs!</span>"
fire_alert = max(fire_alert, 1)
else
fire_alert = 0
fire_alert = 0
/mob/living/carbon/alien/update_sight()
if(stat == 2 || (XRAY in mutations))
sight |= SEE_TURFS
sight |= SEE_MOBS
sight |= SEE_OBJS
see_in_dark = 8
see_invisible = SEE_INVISIBLE_LEVEL_TWO
else if(stat != 2)
sight |= SEE_MOBS
sight &= ~SEE_TURFS
sight &= ~SEE_OBJS
if(nightvision)
see_in_dark = 8
see_invisible = SEE_INVISIBLE_MINIMUM
else if(!nightvision)
see_in_dark = 4
see_invisible = 45
if(see_override)
see_invisible = see_override
@@ -6,7 +6,6 @@
container.icon_state = "mmi_dead"
stat = DEAD
if(blind) blind.layer = 0
sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS
see_in_dark = 8
see_invisible = SEE_INVISIBLE_LEVEL_TWO
+38 -2
View File
@@ -286,9 +286,45 @@ mob/living
if(H.w_uniform)
H.w_uniform.add_fingerprint(M)
/mob/living/carbon/flash_eyes(intensity = 1, override_blindness_check = 0, affect_silicon = 0, visual = 0)
. = ..()
var/damage = intensity - check_eye_prot()
if(.)
if(visual)
return
switch(damage)
if(1)
src << "<span class='warning'>Your eyes sting a little.</span>"
/*if(prob(40)) //waiting on carbon organs
eye_stat += 1*/
if(2)
src << "<span class='warning'>Your eyes burn.</span>"
//eye_stat += rand(2, 4)
else
src << "Your eyes itch and burn severely!</span>"
//eye_stat += rand(12, 16)
/*if(eye_stat > 10)
eye_blind += damage
eye_blurry += damage * rand(3, 6)
if(eye_stat > 20)
if (prob(eye_stat - 20))
src << "<span class='warning'>Your eyes start to burn badly!</span>"
disabilities |= NEARSIGHTED
else if(prob(eye_stat - 25))
src << "<span class='warning'>You can't see anything!</span>"
sdisabilities |= BLIND
else
src << "<span class='warning'>Your eyes are really starting to hurt. This can't be good for you!</span>"*/
return 1
else if(damage == 0) // just enough protection
if(prob(20))
src << "<span class='notice'>Something bright flashes in the corner of your vision!</span>"
/mob/living/carbon/proc/eyecheck()
return 0
/mob/living/carbon/proc/tintcheck()
return 0
@@ -122,7 +122,6 @@
if(!gibbed)
update_canmove()
if(client) blind.layer = 0
timeofdeath = worldtime2text()
med_hud_set_health()
+10 -2
View File
@@ -1113,9 +1113,9 @@
. = ..()
///eyecheck()
///check_eye_prot()
///Returns a number between -1 to 2
/mob/living/carbon/human/eyecheck()
/mob/living/carbon/human/check_eye_prot()
var/number = 0
if(istype(src.head, /obj/item/clothing/head)) //are they wearing something on their head
var/obj/item/clothing/head/HFP = src.head //if yes gets the flash protection value from that item
@@ -1128,6 +1128,14 @@
number += MFP.flash_protect
return number
/mob/living/carbon/human/check_ear_prot()
if(head && (head.flags & HEADBANGPROTECT))
return 1
if(l_ear && (l_ear.flags & EARBANGPROTECT))
return 1
if(r_ear && (r_ear.flags & EARBANGPROTECT))
return 1
///tintcheck()
///Checks eye covering items for visually impairing tinting, such as welding masks
///Checked in life.dm. 0 & 1 = no impairment, 2 = welding mask overlay, 3 = You can see jack, but you can't see shit.
@@ -406,4 +406,44 @@ This function restores all organs.
// Will set our damageoverlay icon to the next level, which will then be set back to the normal level the next mob.Life().
updatehealth()
return 1
return 1
// CARBON ORGANS: REMOVE THIS SHIT
/mob/living/carbon/human/flash_eyes(intensity = 1, override_blindness_check = 0, affect_silicon = 0, visual = 0)
. = ..()
var/obj/item/organ/eyes/E = internal_organs_by_name["eyes"]
if(!E)
return
var/damage = intensity - check_eye_prot()
if(.)
if(visual)
return
switch(damage)
if(1)
if(prob(40))
E.damage += 1
if(2)
E.damage += rand(2, 4)
else
E.damage += rand(12, 16)
if(E.damage > 10)
eye_blind += damage
eye_blurry += damage * rand(3, 6)
if(E.damage > 20)
if (prob(E.damage - 20))
src << "<span class='warning'>Your eyes start to burn badly!</span>"
disabilities |= NEARSIGHTED
else if(prob(E.damage - 25))
src << "<span class='warning'>You can't see anything!</span>"
sdisabilities |= BLIND
else
src << "<span class='warning'>Your eyes are really starting to hurt. This can't be good for you!</span>"
return 1
else if(damage == 0) // just enough protection
if(prob(20))
src << "<span class='notice'>Something bright flashes in the corner of your vision!</span>"
@@ -1,30 +1,5 @@
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32
var/global/list/unconscious_overlays = list("1" = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "passage1"),\
"2" = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "passage2"),\
"3" = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "passage3"),\
"4" = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "passage4"),\
"5" = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "passage5"),\
"6" = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "passage6"),\
"7" = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "passage7"),\
"8" = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "passage8"),\
"9" = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "passage9"),\
"10" = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "passage10"))
var/global/list/oxyloss_overlays = list("1" = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "oxydamageoverlay1"),\
"2" = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "oxydamageoverlay2"),\
"3" = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "oxydamageoverlay3"),\
"4" = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "oxydamageoverlay4"),\
"5" = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "oxydamageoverlay5"),\
"6" = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "oxydamageoverlay6"),\
"7" = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "oxydamageoverlay7"))
var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "brutedamageoverlay1"),\
"2" = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "brutedamageoverlay2"),\
"3" = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "brutedamageoverlay3"),\
"4" = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "brutedamageoverlay4"),\
"5" = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "brutedamageoverlay5"),\
"6" = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "brutedamageoverlay6"))
#define TINT_IMPAIR 2 //Threshold of tint level to apply weld mask overlay
#define TINT_BLIND 3 //Threshold of tint level to obscure vision fully
@@ -51,10 +26,6 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc
loc_as_cryobag.used++
in_stasis = 1
//if(mob_master.current_cycle % 30 == 15)
//hud_updateflag = 1022
//HudRefactor:WTF do i put here....
voice = GetVoice()
if(..() && !in_stasis)
@@ -952,7 +923,6 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc
/mob/living/carbon/human/handle_vision()
client.screen.Remove(global_hud.blurry, global_hud.druggy, global_hud.vimpaired, global_hud.darkMask)
if(machine)
if(!machine.check_eye(src)) reset_view(null)
else
@@ -377,127 +377,148 @@
return 0
/datum/species/proc/handle_vision(mob/living/carbon/human/H)
if( H.stat == DEAD )
if(H.stat == DEAD)
H.sight |= (SEE_TURFS|SEE_MOBS|SEE_OBJS)
H.see_in_dark = 8
if(!H.druggy) H.see_invisible = SEE_INVISIBLE_LEVEL_TWO
else
H.sight &= ~(SEE_TURFS|SEE_MOBS|SEE_OBJS)
if(!H.druggy)
H.see_invisible = SEE_INVISIBLE_LEVEL_TWO
return
H.see_in_dark = darksight //set their variables to default, modify them later
H.see_invisible = SEE_INVISIBLE_LIVING
H.sight &= ~(SEE_TURFS|SEE_MOBS|SEE_OBJS)
if(H.mind && H.mind.vampire)
if((VAMP_VISION in H.mind.vampire.powers) && (!(VAMP_FULL in H.mind.vampire.powers)))
H.sight |= SEE_MOBS
H.see_in_dark = darksight //set their variables to default, modify them later
H.see_invisible = SEE_INVISIBLE_LIVING
else if(VAMP_FULL in H.mind.vampire.powers)
H.sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS
H.see_in_dark = 8
H.see_invisible = SEE_INVISIBLE_MINIMUM
if(H.mind && H.mind.vampire)
if((VAMP_VISION in H.mind.vampire.powers) && (!(VAMP_FULL in H.mind.vampire.powers)))
H.sight |= SEE_MOBS
if(XRAY in H.mutations)
else if(VAMP_FULL in H.mind.vampire.powers)
H.sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS
H.see_in_dark = 8
H.see_invisible = SEE_INVISIBLE_MINIMUM
if(H.seer == 1)
var/obj/effect/rune/R = locate() in H.loc
if(R && R.word1 == cultwords["see"] && R.word2 == cultwords["hell"] && R.word3 == cultwords["join"])
H.see_invisible = SEE_INVISIBLE_OBSERVER
else
H.see_invisible = SEE_INVISIBLE_LIVING
H.seer = 0
if(XRAY in H.mutations)
H.sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS
H.see_in_dark = 8
//This checks how much the mob's eyewear impairs their vision
if(H.tinttotal >= TINT_IMPAIR)
if(tinted_weldhelh)
if(H.tinttotal >= TINT_BLIND)
H.eye_blind = max(H.eye_blind, 1)
if(H.client)
H.client.screen += global_hud.darkMask
H.see_invisible = SEE_INVISIBLE_MINIMUM
var/minimum_darkness_view = INFINITY
if(H.glasses)
if(istype(H.glasses, /obj/item/clothing/glasses))
var/obj/item/clothing/glasses/G = H.glasses
H.sight |= G.vision_flags
if(G.darkness_view)
H.see_in_dark = G.darkness_view
minimum_darkness_view = G.darkness_view
if(H.seer == 1)
var/obj/effect/rune/R = locate() in H.loc
if(R && R.word1 == cultwords["see"] && R.word2 == cultwords["hell"] && R.word3 == cultwords["join"])
H.see_invisible = SEE_INVISIBLE_OBSERVER
else
H.see_invisible = SEE_INVISIBLE_LIVING
H.seer = 0
if(!G.see_darkness)
H.see_invisible = SEE_INVISIBLE_MINIMUM
//This checks how much the mob's eyewear impairs their vision
if(H.tinttotal >= TINT_IMPAIR)
if(tinted_weldhelh)
H.overlay_fullscreen("tint", /obj/screen/fullscreen/impaired, 2)
if(H.tinttotal >= TINT_BLIND)
H.eye_blind = max(H.eye_blind, 1)
else
H.clear_fullscreen("tint")
if(H.head)
if(istype(H.head, /obj/item/clothing/head))
var/obj/item/clothing/head/hat = H.head
H.sight |= hat.vision_flags
var/minimum_darkness_view = INFINITY
if(H.glasses)
if(istype(H.glasses, /obj/item/clothing/glasses))
var/obj/item/clothing/glasses/G = H.glasses
H.sight |= G.vision_flags
if(hat.darkness_view && hat.darkness_view < minimum_darkness_view) // Pick the lowest of the two darkness_views between the glasses and helmet.
H.see_in_dark = hat.darkness_view
if(G.darkness_view)
H.see_in_dark = G.darkness_view
minimum_darkness_view = G.darkness_view
if(!hat.see_darkness)
H.see_invisible = SEE_INVISIBLE_MINIMUM
if(!G.see_darkness)
H.see_invisible = SEE_INVISIBLE_MINIMUM
//switch(hat.HUDType)
// if(SECHUD)
// process_sec_hud(H,1)
// if(MEDHUD)
// process_med_hud(H,1)
// if(ANTAGHUD)
// process_antag_hud(H)
if(H.head)
if(istype(H.head, /obj/item/clothing/head))
var/obj/item/clothing/head/hat = H.head
H.sight |= hat.vision_flags
if(istype(H.back, /obj/item/weapon/rig)) ///ahhhg so snowflakey
var/obj/item/weapon/rig/rig = H.back
if(rig.visor)
if(!rig.helmet || (H.head && rig.helmet == H.head))
if(rig.visor && rig.visor.vision && rig.visor.active && rig.visor.vision.glasses)
var/obj/item/clothing/glasses/G = rig.visor.vision.glasses
if(istype(G))
H.see_in_dark = (G.darkness_view ? G.darkness_view : darksight) // Otherwise we keep our darkness view with togglable nightvision.
if(G.vision_flags) // MESONS
H.sight |= G.vision_flags
if(hat.darkness_view && hat.darkness_view < minimum_darkness_view) // Pick the lowest of the two darkness_views between the glasses and helmet.
H.see_in_dark = hat.darkness_view
if(!G.see_darkness)
H.see_invisible = SEE_INVISIBLE_MINIMUM
if(!hat.see_darkness)
H.see_invisible = SEE_INVISIBLE_MINIMUM
//switch(G.HUDType)
// if(SECHUD)
// process_sec_hud(H,1)
// if(MEDHUD)
// process_med_hud(H,1)
// if(ANTAGHUD)
// process_antag_hud(H)
//switch(hat.HUDType)
// if(SECHUD)
// process_sec_hud(H,1)
// if(MEDHUD)
// process_med_hud(H,1)
// if(ANTAGHUD)
// process_antag_hud(H)
if(H.vision_type)
H.see_in_dark = max(H.see_in_dark, H.vision_type.see_in_dark, darksight)
H.see_invisible = H.vision_type.see_invisible
if(H.vision_type.light_sensitive)
H.weakeyes = 1
H.sight |= H.vision_type.sight_flags
if(istype(H.back, /obj/item/weapon/rig)) ///ahhhg so snowflakey
var/obj/item/weapon/rig/rig = H.back
if(rig.visor)
if(!rig.helmet || (H.head && rig.helmet == H.head))
if(rig.visor && rig.visor.vision && rig.visor.active && rig.visor.vision.glasses)
var/obj/item/clothing/glasses/G = rig.visor.vision.glasses
if(istype(G))
H.see_in_dark = (G.darkness_view ? G.darkness_view : darksight) // Otherwise we keep our darkness view with togglable nightvision.
if(G.vision_flags) // MESONS
H.sight |= G.vision_flags
if(H.see_override) //Override all
H.see_invisible = H.see_override
if(!G.see_darkness)
H.see_invisible = SEE_INVISIBLE_MINIMUM
if(H.blind)
if(H.blinded) H.blind.layer = 18
else H.blind.layer = 0
//switch(G.HUDType)
// if(SECHUD)
// process_sec_hud(H,1)
// if(MEDHUD)
// process_med_hud(H,1)
// if(ANTAGHUD)
// process_antag_hud(H)
if(H.disabilities & NEARSIGHTED) //this looks meh but saves a lot of memory by not requiring to add var/prescription
if(H.glasses) //to every /obj/item
var/obj/item/clothing/glasses/G = H.glasses
if(!G.prescription)
H.client.screen += global_hud.vimpaired
else
H.client.screen += global_hud.vimpaired
if(H.vision_type)
H.see_in_dark = max(H.see_in_dark, H.vision_type.see_in_dark, darksight)
H.see_invisible = H.vision_type.see_invisible
if(H.vision_type.light_sensitive)
H.weakeyes = 1
H.sight |= H.vision_type.sight_flags
if(H.eye_blurry) H.client.screen += global_hud.blurry
if(H.druggy) H.client.screen += global_hud.druggy
if(H.see_override) //Override all
H.see_invisible = H.see_override
if(!H.client)
return 1
if(H.blinded || H.eye_blind)
H.overlay_fullscreen("blind", /obj/screen/fullscreen/blind)
//H.throw_alert("blind", /obj/screen/alert/blind)
else
H.clear_fullscreen("blind")
//H.clear_alert("blind")
if(H.disabilities & NEARSIGHTED) //this looks meh but saves a lot of memory by not requiring to add var/prescription
if(H.glasses) //to every /obj/item
var/obj/item/clothing/glasses/G = H.glasses
if(!G.prescription)
H.overlay_fullscreen("nearsighted", /obj/screen/fullscreen/impaired, 1)
else
H.overlay_fullscreen("nearsighted", /obj/screen/fullscreen/impaired, 1)
else
H.clear_fullscreen("nearsighted")
if(H.eye_blurry)
H.overlay_fullscreen("blurry", /obj/screen/fullscreen/blurry)
else
H.clear_fullscreen("blurry")
if(H.druggy)
H.overlay_fullscreen("high", /obj/screen/fullscreen/high)
//H.throw_alert("high", /obj/screen/alert/high)
else
H.clear_fullscreen("high")
//H.clear_alert("high")
/datum/species/proc/handle_hud_icons(mob/living/carbon/human/H)
if(H.healths)
+46 -74
View File
@@ -367,83 +367,55 @@
//this handles hud updates. Calls update_vision() and handle_hud_icons()
/mob/living/carbon/handle_regular_hud_updates()
if(!client) return 0
if(!client)
return 0
if(damageoverlay)
if(damageoverlay.overlays)
damageoverlay.overlays = list()
if(stat == UNCONSCIOUS)
//Critical damage passage overlay
if(health <= config.health_threshold_crit)
var/image/I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "passage0")
I.blend_mode = BLEND_OVERLAY //damageoverlay is BLEND_MULTIPLY
switch(health)
if(-20 to -10)
I.icon_state = "passage1"
if(-30 to -20)
I.icon_state = "passage2"
if(-40 to -30)
I.icon_state = "passage3"
if(-50 to -40)
I.icon_state = "passage4"
if(-60 to -50)
I.icon_state = "passage5"
if(-70 to -60)
I.icon_state = "passage6"
if(-80 to -70)
I.icon_state = "passage7"
if(-90 to -80)
I.icon_state = "passage8"
if(-95 to -90)
I.icon_state = "passage9"
if(-INFINITY to -95)
I.icon_state = "passage10"
damageoverlay.overlays += I
if(stat == UNCONSCIOUS && health <= config.health_threshold_crit)
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")
if(oxyloss)
var/severity = 0
switch(oxyloss)
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
//Oxygen damage overlay
if(oxyloss)
var/image/I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "oxydamageoverlay0")
switch(oxyloss)
if(10 to 20)
I.icon_state = "oxydamageoverlay1"
if(20 to 25)
I.icon_state = "oxydamageoverlay2"
if(25 to 30)
I.icon_state = "oxydamageoverlay3"
if(30 to 35)
I.icon_state = "oxydamageoverlay4"
if(35 to 40)
I.icon_state = "oxydamageoverlay5"
if(40 to 45)
I.icon_state = "oxydamageoverlay6"
if(45 to INFINITY)
I.icon_state = "oxydamageoverlay7"
damageoverlay.overlays += I
clear_fullscreen("oxy")
//Fire and Brute damage overlay (BSSR)
var/hurtdamage = getBruteLoss() + getFireLoss() + damageoverlaytemp
damageoverlaytemp = 0 // We do this so we can detect if someone hits us or not.
if(hurtdamage)
var/severity = 0
switch(hurtdamage)
if(5 to 15) severity = 1
if(15 to 30) severity = 2
if(30 to 45) severity = 3
if(45 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")
//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 = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "brutedamageoverlay0")
I.blend_mode = BLEND_ADD
switch(hurtdamage)
if(5 to 15)
I.icon_state = "brutedamageoverlay1"
if(15 to 30)
I.icon_state = "brutedamageoverlay2"
if(30 to 45)
I.icon_state = "brutedamageoverlay3"
if(45 to 70)
I.icon_state = "brutedamageoverlay4"
if(70 to 85)
I.icon_state = "brutedamageoverlay5"
if(85 to INFINITY)
I.icon_state = "brutedamageoverlay6"
var/image/black = image(I.icon, I.icon_state) //BLEND_ADD doesn't let us darken, so this is just to blacken the edge of the screen
black.color = "#170000"
damageoverlay.overlays += I
damageoverlay.overlays += black
..()
return 1
@@ -20,8 +20,6 @@
O.show_message("<b>The [name]</b> seizes up and falls limp...", 1) //ded -- Urist
update_canmove()
if(blind)
blind.layer = 0
if(ticker && ticker.mode)
ticker.mode.check_win()
+5
View File
@@ -0,0 +1,5 @@
/mob/living/death(gibbed)
blinded = max(blinded, 1)
clear_fullscreens()
..(gibbed)
+31 -24
View File
@@ -161,7 +161,7 @@
/mob/living/proc/handle_disabilities()
//Eyes
if(disabilities & BLIND || stat) //blindness from disability or unconsciousness doesn't get better on its own
if(sdisabilities & BLIND || stat) //blindness from disability or unconsciousness doesn't get better on its own
eye_blind = max(eye_blind, 1)
else if(eye_blind) //blindness, heals slowly over time
eye_blind = max(eye_blind-1,0)
@@ -187,33 +187,40 @@
return 1
/mob/living/proc/handle_vision()
client.screen.Remove(global_hud.blurry, global_hud.druggy, global_hud.vimpaired, global_hud.darkMask)
update_sight()
if(stat != DEAD)
if(blind)
if(eye_blind)
blind.layer = 18
else
blind.layer = 0
if(stat == DEAD)
return
if(blinded || eye_blind)
overlay_fullscreen("blind", /obj/screen/fullscreen/blind)
//throw_laert("blind", /obj/screen/alert/blind)
else
clear_fullscreen("blind")
//clear_alert("blind")
if (disabilities & NEARSIGHTED)
client.screen += global_hud.vimpaired
if (eye_blurry)
client.screen += global_hud.blurry
if (druggy)
client.screen += global_hud.druggy
if(machine)
if (!( machine.check_eye(src) ))
reset_view(null)
if(disabilities & NEARSIGHTED)
overlay_fullscreen("nearsighted", /obj/screen/fullscreen/impaired, 1)
else
if(!client.adminobs)
reset_view(null)
clear_fullscreen("nearsighted")
if(eye_blurry)
overlay_fullscreen("blurry", /obj/screen/fullscreen/blurry)
else
clear_fullscreen("blurry")
if(druggy)
overlay_fullscreen("high", /obj/screen/fullscreen/high)
//throw_alert("high", /obj/screen/alert/high)
else
clear_fullscreen("high")
//clear_alert("high")
if(machine)
if (!( machine.check_eye(src) ))
reset_view(null)
else
if(!client.adminobs)
reset_view(null)
/mob/living/proc/update_sight()
return
+13 -2
View File
@@ -51,8 +51,7 @@
/mob/living/ex_act(severity)
..()
if(client && !eye_blind)
flick("flash", src.flash)
flash_eyes()
/mob/living/proc/updatehealth()
if(status_flags & GODMODE)
@@ -794,6 +793,18 @@
/mob/living/proc/can_use_vents()
return "You can't fit into that vent."
//called when the mob receives a bright flash
/mob/living/proc/flash_eyes(intensity = 1, override_blindness_check = 0, affect_silicon = 0, visual = 0, type = /obj/screen/fullscreen/flash)
if(check_eye_prot() < intensity && (override_blindness_check || !(sdisabilities & BLIND)))
overlay_fullscreen("flash", type)
addtimer(src, "clear_fullscreen", 25, FALSE, "flash", 25)
return 1
/mob/living/proc/check_eye_prot()
return 0
/mob/living/proc/check_ear_prot()
// The src mob is trying to strip an item from someone
// Override if a certain type of mob should be behave differently when stripping items (can't, for example)
/mob/living/stripPanelUnequip(obj/item/what, mob/who, where, var/silent = 0)
@@ -39,8 +39,6 @@
/mob/living/bullet_act(var/obj/item/projectile/P, var/def_zone)
flash_weak_pain()
//Being hit while using a cloaking device
var/obj/item/weapon/cloaking_device/C = locate((/obj/item/weapon/cloaking_device) in src)
if(C && C.active)
-2
View File
@@ -573,8 +573,6 @@ var/list/ai_verbs_default = list(
playsound(loc, 'sound/weapons/slash.ogg', 25, 1, -1)
visible_message("<span class='danger'>[M] has slashed at [src]!</span>",\
"<span class='userdanger'>[M] has slashed at [src]!</span>")
if(prob(8))
flick("noise", flash)
adjustBruteLoss(damage)
updatehealth()
else
+2 -3
View File
@@ -5,9 +5,8 @@
icon_state = "[ckey]-ai-crash"
else icon_state = "ai-crash"
update_canmove()
if(src.eyeobj)
src.eyeobj.setLoc(get_turf(src))
if(blind) blind.layer = 0
if(eyeobj)
eyeobj.setLoc(get_turf(src))
sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS
see_in_dark = 8
see_invisible = SEE_INVISIBLE_LEVEL_TWO
+5 -8
View File
@@ -49,22 +49,20 @@
if(aiRestorePowerRoutine == 2)
src << "Alert cancelled. Power has been restored without our assistance."
aiRestorePowerRoutine = 0
blind.layer = 0
clear_fullscreen("blind")
else if(aiRestorePowerRoutine == 3)
src << "Alert cancelled. Power has been restored."
aiRestorePowerRoutine = 0
blind.layer = 0
clear_fullscreen("blind")
else
blind.screen_loc = "1,1 to 15,15"
if(blind.layer != 18)
blind.layer = 18
sight &= ~SEE_TURFS
sight &= ~SEE_MOBS
sight &= ~SEE_OBJS
overlay_fullscreen("blind", /obj/screen/fullscreen/blind)
see_in_dark = 0
see_invisible = SEE_INVISIBLE_LIVING
@@ -85,7 +83,6 @@
if(my_area && my_area.power_equip && !istype(T, /turf/space))
src << "Alert cancelled. Power has been restored without our assistance."
aiRestorePowerRoutine = 0
blind.layer = 0
return
src << "Fault confirmed: missing external power. Shutting down main control system to save power."
sleep(20)
@@ -122,7 +119,7 @@
if (!istype(T, /turf/space))
src << "Alert cancelled. Power has been restored without our assistance."
aiRestorePowerRoutine = 0
blind.layer = 0
clear_fullscreen("blind")
return
switch(PRP)
+1 -13
View File
@@ -5,21 +5,9 @@
blood.override = 1
client.images += blood
regenerate_icons()
flash = new /obj/screen()
flash.icon_state = "blank"
flash.name = "flash"
flash.screen_loc = "WEST,SOUTH to EAST,NORTH"
flash.layer = 17
blind = new /obj/screen()
blind.icon_state = "black"
blind.name = " "
blind.screen_loc = "1,1 to 15,15"
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
O.emotion = "Neutral"
src.view_core()
return
view_core()
@@ -12,7 +12,6 @@
card.overlays += "pai-off"
stat = DEAD
canmove = 0
if(blind) blind.layer = 0
sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS
see_in_dark = 8
see_invisible = SEE_INVISIBLE_LEVEL_TWO
+1 -1
View File
@@ -245,7 +245,7 @@
if ((O.client && !( O.blinded )))
O.show_message(text("\red <B>[] has slashed at []!</B>", M, src), 1)
if(prob(8))
flick("noise", src.flash)
flash_eyes(affect_silicon = 1)
src.adjustBruteLoss(damage)
src.updatehealth()
else
@@ -57,7 +57,6 @@
var/obj/machinery/recharge_station/RC = loc
RC.go_out()
if(blind) blind.layer = 0
sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS
see_in_dark = 8
see_invisible = SEE_INVISIBLE_LEVEL_TWO
@@ -337,3 +337,7 @@
/mob/living/silicon/robot/drone/update_canmove()
. = ..()
density = 0 //this is reset every canmove update otherwise
/mob/living/simple_animal/drone/flash_eyes(intensity = 1, override_blindness_check = 0, affect_silicon = 0)
if(affect_silicon)
return ..()
@@ -865,7 +865,7 @@ var/list/robot_verbs_default = list(
visible_message("<span class='danger'>[M] has slashed at [src]!</span>",\
"<span class='userdanger'>[M] has slashed at [src]!</span>")
if(prob(8))
flick("noise", flash)
flash_eyes(affect_silicon = 1)
adjustBruteLoss(damage)
updatehealth()
else
@@ -894,7 +894,7 @@ var/list/robot_verbs_default = list(
/mob/living/silicon/robot/attack_slime(mob/living/carbon/slime/M as mob)
if(..()) //successful slime shock
flick("noise", flash)
flash_eyes(affect_silicon = 1)
var/stunprob = M.powerlevel * 7 + 10
if(prob(stunprob) && M.powerlevel >= 8)
adjustBruteLoss(M.powerlevel * rand(6,10))
+4 -2
View File
@@ -73,7 +73,7 @@
if(2)
src.take_organ_damage(10)
Stun(3)
flick("noise", src:flash)
flash_eyes(affect_silicon = 1)
src << "\red <B>*BZZZT*</B>"
src << "\red Warning: Electromagnetic pulse detected."
..()
@@ -349,4 +349,6 @@
/mob/living/silicon/adjustToxLoss(var/amount)
return
/mob/living/silicon/flash_eyes(intensity = 1, override_blindness_check = 0, affect_silicon = 0, visual = 0, type = /obj/screen/fullscreen/flash/noise)
if(affect_silicon)
return ..()
@@ -56,7 +56,6 @@
M.apply_damage(min(strength,2)+mut, BRUTE, sharp=1) // Stinging. The more mutated I am, the harder I sting.
M.apply_damage((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!
M << "\red You have been stung!"
M.flash_pain()
//if we're chasing someone, get a little bit angry
if(target_mob && prob(10))
-3
View File
@@ -1213,9 +1213,6 @@ var/list/slot_equipment_priority = list( \
/mob/proc/get_species()
return ""
/mob/proc/flash_weak_pain()
flick("weak_pain",pain)
/mob/proc/get_visible_implants(var/class = 0)
var/list/visible_implants = list()
for(var/obj/item/O in embedded)
-4
View File
@@ -11,8 +11,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/internals = null
@@ -26,8 +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/move/gun_move_icon = null
var/obj/screen/gun/run/gun_run_icon = null
-7
View File
@@ -1,6 +1,3 @@
mob/proc/flash_pain()
flick("pain",pain)
mob/var/list/pain_stored = list()
mob/var/last_pain_message = ""
mob/var/next_pain_time = 0
@@ -30,20 +27,16 @@ mob/living/carbon/proc/pain(var/partname, var/amount, var/force, var/burning = 0
if(1 to 10)
msg = "\red <b>Your [partname] burns.</b>"
if(11 to 90)
flash_weak_pain()
msg = "\red <b><font size=2>Your [partname] burns badly!</font></b>"
if(91 to 10000)
flash_pain()
msg = "\red <b><font size=3>OH GOD! Your [partname] is on fire!</font></b>"
else
switch(amount)
if(1 to 10)
msg = "<b>Your [partname] hurts.</b>"
if(11 to 90)
flash_weak_pain()
msg = "<b><font size=2>Your [partname] hurts badly.</font></b>"
if(91 to 10000)
flash_pain()
msg = "<b><font size=3>OH GOD! Your [partname] is hurting terribly!</font></b>"
if(msg && (msg != last_pain_message || prob(10)))
last_pain_message = msg
+11 -14
View File
@@ -248,13 +248,12 @@ datum/reagent/blackpowder/reaction_turf(var/turf/T, var/volume) //oh shit
s.set_up(2, 1, location)
s.start()
for(var/mob/living/carbon/C in viewers(5, location))
if(C.eyecheck())
continue
flick("e_flash", C.flash)
if(get_dist(C, location) < 4)
C.Weaken(5)
continue
C.Stun(5)
if(C.flash_eyes())
if(get_dist(C, location) < 4)
C.Weaken(5)
continue
C.Stun(5)
/datum/chemical_reaction/flash_powder/on_reaction(var/datum/reagents/holder, var/created_volume)
if(holder.has_reagent("stabilizing_agent"))
@@ -264,13 +263,11 @@ datum/reagent/blackpowder/reaction_turf(var/turf/T, var/volume) //oh shit
s.set_up(2, 1, location)
s.start()
for(var/mob/living/carbon/C in viewers(5, location))
if(C.eyecheck())
continue
flick("e_flash", C.flash)
if(get_dist(C, location) < 4)
C.Weaken(5)
continue
C.Stun(5)
if(C.flash_eyes())
if(get_dist(C, location) < 4)
C.Weaken(5)
continue
C.Stun(5)
holder.remove_reagent("flash_powder", created_volume)
/datum/reagent/smoke_powder
@@ -89,9 +89,8 @@
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() <= 0)
flick("e_flash", M.flash)
for(var/mob/living/carbon/C in viewers(get_turf(holder.my_atom), null))
C.flash_eyes()
for(var/i = 1, i <= 5, i++)
var/chosen = pick(critters)
@@ -127,9 +126,8 @@
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() <= 0)
flick("e_flash", M.flash)
for(var/mob/living/carbon/C in viewers(get_turf(holder.my_atom), null))
C.flash_eyes()
var/chosen = pick(critters)
var/mob/living/simple_animal/hostile/C = new chosen
@@ -153,9 +151,8 @@
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() <= 0)
flick("e_flash", M.flash)
for(var/mob/living/carbon/C in viewers(get_turf(holder.my_atom), null))
C.flash_eyes()
for(var/i = 1, i <= 4 + rand(1,2), i++)
var/chosen = pick(borks)
@@ -181,9 +178,8 @@
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() <= 0)
flick("e_flash", M.flash)
for(var/mob/living/carbon/C in viewers(get_turf(holder.my_atom), null))
C.flash_eyes()
for(var/i = 1, i <= 4 + rand(1,2), i++)
var/chosen = pick(borks)