diff --git a/code/_onclick/hud/alien.dm b/code/_onclick/hud/alien.dm index 7b183381253..9e9c2aa3dac 100644 --- a/code/_onclick/hud/alien.dm +++ b/code/_onclick/hud/alien.dm @@ -152,7 +152,7 @@ mymob.blind.layer = 0 mymob.flash = new /obj/screen() - mymob.flash.icon = 'icons/mob/screen_alien.dmi' + mymob.flash.icon = 'icons/mob/screen_gen.dmi' mymob.flash.icon_state = "blank" mymob.flash.name = "flash" mymob.flash.screen_loc = "WEST,SOUTH to EAST,NORTH" diff --git a/code/_onclick/hud/alien_larva.dm b/code/_onclick/hud/alien_larva.dm index 716947a1245..47b519f9066 100644 --- a/code/_onclick/hud/alien_larva.dm +++ b/code/_onclick/hud/alien_larva.dm @@ -60,7 +60,7 @@ mymob.blind.layer = 0 mymob.flash = new /obj/screen() - mymob.flash.icon = 'icons/mob/screen_alien.dmi' + mymob.flash.icon = 'icons/mob/screen_gen.dmi' mymob.flash.icon_state = "blank" mymob.flash.name = "flash" mymob.flash.screen_loc = "WEST,SOUTH to EAST,NORTH" diff --git a/code/_onclick/hud/monkey.dm b/code/_onclick/hud/monkey.dm index 8b2227e1009..0f2b38e9d3e 100644 --- a/code/_onclick/hud/monkey.dm +++ b/code/_onclick/hud/monkey.dm @@ -137,8 +137,17 @@ mymob.blind.screen_loc = "CENTER-7,CENTER-7" mymob.blind.layer = 0 + mymob.damageoverlay = new /obj/screen() + mymob.damageoverlay.icon = 'icons/mob/screen_full.dmi' + mymob.damageoverlay.icon_state = "oxydamageoverlay0" + mymob.damageoverlay.name = "dmg" + mymob.damageoverlay.blend_mode = BLEND_MULTIPLY + mymob.damageoverlay.screen_loc = "CENTER-7,CENTER-7" + 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. + mymob.flash = new /obj/screen() - mymob.flash.icon = ui_style + mymob.flash.icon = 'icons/mob/screen_gen.dmi' mymob.flash.icon_state = "blank" mymob.flash.name = "flash" mymob.flash.screen_loc = "WEST,SOUTH to EAST,NORTH" diff --git a/code/_onclick/hud/other_mobs.dm b/code/_onclick/hud/other_mobs.dm index a6a76e74355..c74f1ee7849 100644 --- a/code/_onclick/hud/other_mobs.dm +++ b/code/_onclick/hud/other_mobs.dm @@ -13,6 +13,9 @@ mymob.blind.screen_loc = "CENTER-7,CENTER-7" mymob.blind.layer = 0 + mymob.client.screen = null + mymob.client.screen += list(mymob.blind) + /datum/hud/proc/blob_hud(ui_style = 'icons/mob/screen_midnight.dmi') blobpwrdisplay = new /obj/screen() @@ -28,6 +31,5 @@ blobhealthdisplay.layer = 20 mymob.client.screen = null - mymob.client.screen += list(blobpwrdisplay, blobhealthdisplay) diff --git a/code/_onclick/hud/robot.dm b/code/_onclick/hud/robot.dm index 66258562b5c..4f9d70a1b5e 100644 --- a/code/_onclick/hud/robot.dm +++ b/code/_onclick/hud/robot.dm @@ -164,7 +164,7 @@ mymob.blind.layer = 0 mymob.flash = new /obj/screen() - mymob.flash.icon = 'icons/mob/screen_cyborg.dmi' + mymob.flash.icon = 'icons/mob/screen_gen.dmi' mymob.flash.icon_state = "blank" mymob.flash.name = "flash" mymob.flash.screen_loc = "WEST,SOUTH to EAST,NORTH" diff --git a/code/modules/mob/living/carbon/alien/alien.dm b/code/modules/mob/living/carbon/alien/alien.dm index fd9af671dab..7ef86c2c9ab 100644 --- a/code/modules/mob/living/carbon/alien/alien.dm +++ b/code/modules/mob/living/carbon/alien/alien.dm @@ -25,10 +25,6 @@ var/heal_rate = 5 var/plasma_rate = 5 - var/oxygen_alert = 0 - var/toxins_alert = 0 - var/fire_alert = 0 - var/heat_protection = 0.5 var/leaping = 0 @@ -111,31 +107,28 @@ fire_alert = max(fire_alert, 2) return -/mob/living/carbon/alien/handle_mutations_and_radiation() - // Aliens love radiation nom nom nom - if (radiation) - if (radiation > 100) - radiation = 100 +/mob/living/carbon/alien/ex_act(severity, target) + ..() - if (radiation < 0) - radiation = 0 + switch (severity) + if (1.0) + gib() + return - switch(radiation) - if(0 to 50) - radiation-- - if(prob(25)) - adjustToxLoss(1) + if (2.0) + adjustBruteLoss(60) + adjustFireLoss(60) + adjustEarDamage(30,120) - if(50 to 75) - radiation -= 2 - adjustToxLoss(1) - if(prob(5)) - radiation -= 5 + if(3.0) + adjustBruteLoss(30) + if (prob(50)) + Paralyse(1) + adjustEarDamage(15,60) + + updatehealth() - if(75 to 100) - radiation -= 3 - adjustToxLoss(3) /mob/living/carbon/alien/handle_fire()//Aliens on fire code if(..()) diff --git a/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm b/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm index 1b06c1e1766..98067011363 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm @@ -15,26 +15,26 @@ real_name = name ..() -/mob/living/carbon/alien/humanoid/hunter/handle_regular_hud_updates() - ..() //-Yvarov - +/mob/living/carbon/alien/humanoid/hunter/handle_hud_icons_health() if (healths) if (stat != 2) switch(health) if(150 to INFINITY) healths.icon_state = "health0" - if(100 to 150) + if(120 to 150) healths.icon_state = "health1" - if(50 to 100) + if(90 to 120) healths.icon_state = "health2" - if(25 to 50) + if(60 to 90) healths.icon_state = "health3" - if(0 to 25) + if(30 to 60) healths.icon_state = "health4" - else + if(0 to 30) healths.icon_state = "health5" + else + healths.icon_state = "health6" else - healths.icon_state = "health6" + healths.icon_state = "health7" /mob/living/carbon/alien/humanoid/hunter/handle_environment() diff --git a/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm b/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm index f6d14be8d91..c277695df7c 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm @@ -17,9 +17,7 @@ verbs.Add(/mob/living/carbon/alien/humanoid/proc/corrosive_acid,/mob/living/carbon/alien/humanoid/proc/neurotoxin) ..() -/mob/living/carbon/alien/humanoid/sentinel/handle_regular_hud_updates() - ..() //-Yvarov - +/mob/living/carbon/alien/humanoid/sentinel/handle_hud_icons_health() if (healths) if (stat != 2) switch(health) @@ -29,14 +27,16 @@ healths.icon_state = "health1" if(75 to 100) healths.icon_state = "health2" - if(25 to 75) + if(50 to 75) healths.icon_state = "health3" - if(0 to 25) + if(25 to 50) healths.icon_state = "health4" - else + if(0 to 25) healths.icon_state = "health5" + else + healths.icon_state = "health6" else - healths.icon_state = "health6" + healths.icon_state = "health7" /mob/living/carbon/alien/humanoid/sentinel/movement_delay() . = ..() diff --git a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm index 6112f31c72d..50f8ed4b4a1 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm @@ -28,53 +28,6 @@ if(l_store) l_store.emp_act(severity) ..() -/mob/living/carbon/alien/humanoid/ex_act(severity, target) - ..() - - var/shielded = 0 - - var/b_loss = null - var/f_loss = null - switch (severity) - if (1.0) - gib() - return - - if (2.0) - if (!shielded) - b_loss += 60 - - f_loss += 60 - - adjustEarDamage(30, 120) - - if(3.0) - b_loss += 30 - if (prob(50) && !shielded) - Paralyse(1) - adjustEarDamage(15 , 60) - - adjustBruteLoss(b_loss) - adjustFireLoss(f_loss) - - updatehealth() - -/mob/living/carbon/alien/humanoid/blob_act() - if (stat == 2) - return - var/shielded = 0 - var/damage = null - if (stat != 2) - damage = rand(30,40) - - if(shielded) - damage /= 4 - - show_message("The blob attacks!") - adjustFireLoss(damage) - return - - /mob/living/carbon/alien/humanoid/attack_slime(mob/living/carbon/slime/M as mob) ..() var/damage = rand(5, 35) @@ -139,10 +92,6 @@ return 0 -/mob/living/carbon/alien/humanoid/var/co2overloadtime = null -/mob/living/carbon/alien/humanoid/var/temperature_resistance = T0C+75 - - /mob/living/carbon/alien/humanoid/show_inv(mob/user) user.set_machine(src) var/dat = {" diff --git a/code/modules/mob/living/carbon/alien/humanoid/life.dm b/code/modules/mob/living/carbon/alien/humanoid/life.dm index 3862e75e7eb..1ecd703175b 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/life.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/life.dm @@ -5,7 +5,6 @@ toxins_alert = 0 fire_alert = 0 pass_flags = PASSTABLE - var/temperature_alert = 0 /mob/living/carbon/alien/humanoid/proc/adjust_body_temperature(current, loc_temp, boost) @@ -25,162 +24,4 @@ temp_change = (temperature - current) return temp_change -/mob/living/carbon/alien/humanoid/handle_regular_status_updates() - updatehealth() - - if(stat == DEAD) //DEAD. BROWN BREAD. SWIMMING WITH THE SPESS CARP - eye_blind = 1 - silent = 0 - else //ALIVE. LIGHTS ARE ON - if(health < config.health_threshold_dead || !getorgan(/obj/item/organ/brain)) - death() - eye_blind = 1 - stat = DEAD - silent = 0 - return 1 - - //UNCONSCIOUS. NO-ONE IS HOME - if( (getOxyLoss() > 50) || (config.health_threshold_crit >= health) ) - if( health <= 20 && prob(1) ) - spawn(0) - emote("gasp") - if(!reagents.has_reagent("epinephrine")) - adjustOxyLoss(1) - Paralyse(3) - - if(paralysis) - AdjustParalysis(-1) - eye_blind = max(eye_blind, 1) - stat = UNCONSCIOUS - else if(sleeping) - sleeping = max(sleeping-1, 0) - eye_blind = max(eye_blind, 1) - stat = UNCONSCIOUS - if( prob(10) && health ) - spawn(0) - emote("hiss") - //CONSCIOUS - else - stat = CONSCIOUS - - /* What in the living hell is this?*/ - if(move_delay_add > 0) - move_delay_add = max(0, move_delay_add - rand(1, 2)) - - //Eyes - if(disabilities & BLIND) //disabled-blind, 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) - else if(eye_blurry) //blurry eyes heal slowly - eye_blurry = max(eye_blurry-1, 0) - - //Ears - if(disabilities & DEAF) //disabled-deaf, doesn't get better on its own - setEarDamage(-1, max(ear_deaf, 1)) - else - adjustEarDamage(-1, (ear_damage < 25 ? -0.05 : 0)) - //deafness, heals slowly over time - //ear damage heals slowly under this threshold. otherwise you'll need earmuffs - - //Other - if(stunned) - AdjustStunned(-1) - if(!stunned) - update_icons() - - if(weakened) - weakened = max(weakened-1,0) - if(!weakened) - update_icons() - - if(stuttering) - stuttering = max(stuttering-1, 0) - - if(silent) - silent = max(silent-1, 0) - - if(druggy) - druggy = max(druggy-1, 0) - return 1 - - -/mob/living/carbon/alien/humanoid/handle_regular_hud_updates() - - if (stat == 2) - 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(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 ((eye_blind)) - blind.layer = 18 - else - blind.layer = 0 - - if (disabilities & NEARSIGHT) - 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 diff --git a/code/modules/mob/living/carbon/alien/humanoid/queen.dm b/code/modules/mob/living/carbon/alien/humanoid/queen.dm index 8473fa5e8e1..a42e347ac21 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/queen.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/queen.dm @@ -25,26 +25,26 @@ verbs.Add(/mob/living/carbon/alien/humanoid/proc/corrosive_acid,/mob/living/carbon/alien/humanoid/proc/neurotoxin,/mob/living/carbon/alien/humanoid/proc/resin) ..() -/mob/living/carbon/alien/humanoid/queen/handle_regular_hud_updates() - ..() //-Yvarov - +/mob/living/carbon/alien/humanoid/queen/handle_hud_icons_health() if (src.healths) if (src.stat != 2) switch(health) if(250 to INFINITY) src.healths.icon_state = "health0" - if(175 to 250) + if(200 to 250) src.healths.icon_state = "health1" - if(100 to 175) + if(150 to 200) src.healths.icon_state = "health2" - if(50 to 100) + if(100 to 150) src.healths.icon_state = "health3" - if(0 to 50) + if(50 to 100) src.healths.icon_state = "health4" - else + if(0 to 50) src.healths.icon_state = "health5" + else + src.healths.icon_state = "health6" else - src.healths.icon_state = "health6" + src.healths.icon_state = "health7" /mob/living/carbon/alien/humanoid/queen/movement_delay() . = ..() diff --git a/code/modules/mob/living/carbon/alien/larva/emote.dm b/code/modules/mob/living/carbon/alien/larva/emote.dm index 1533fa673a8..57c3783ed82 100644 --- a/code/modules/mob/living/carbon/alien/larva/emote.dm +++ b/code/modules/mob/living/carbon/alien/larva/emote.dm @@ -76,9 +76,9 @@ if (!src.restrained()) message = text("[src] signs[].", (text2num(param) ? text(" the number []", text2num(param)) : null)) m_type = 1 -// if ("sit") -// message = "[src] sits down." //Larvan can't sit down, /N -// m_type = 1 + if ("snore") + message = "[src] snores." + m_type = 2 if ("sulk") message = "[src] sulks down sadly." m_type = 1 diff --git a/code/modules/mob/living/carbon/alien/larva/larva.dm b/code/modules/mob/living/carbon/alien/larva/larva.dm index cf2753460ed..6bdcbb4307d 100644 --- a/code/modules/mob/living/carbon/alien/larva/larva.dm +++ b/code/modules/mob/living/carbon/alien/larva/larva.dm @@ -34,60 +34,6 @@ amount_grown = min(amount_grown + 1, max_grown) ..(amount) - -/mob/living/carbon/alien/larva/ex_act(severity, target) - ..() - - var/b_loss = null - var/f_loss = null - switch (severity) - if (1.0) - gib() - return - - if (2.0) - - b_loss += 60 - - f_loss += 60 - - adjustEarDamage(30,120) - - if(3.0) - b_loss += 30 - if (prob(50)) - Paralyse(1) - adjustEarDamage(15,60) - - adjustBruteLoss(b_loss) - adjustFireLoss(f_loss) - - updatehealth() - - - -/mob/living/carbon/alien/larva/blob_act() - if (stat == 2) - return - var/shielded = 0 - - var/damage = null - if (stat != 2) - damage = rand(10,30) - - if(shielded) - damage /= 4 - - //paralysis += 1 - - show_message("The blob attacks you!") - - adjustFireLoss(damage) - - updatehealth() - return - - //can't equip anything /mob/living/carbon/alien/larva/attack_ui(slot_id) return @@ -137,9 +83,6 @@ /mob/living/carbon/alien/larva/restrained() return 0 -/mob/living/carbon/alien/larva/var/co2overloadtime = null -/mob/living/carbon/alien/larva/var/temperature_resistance = T0C+75 - // new damage icon system // now constructs damage icon for each organ from mask * damage field @@ -153,15 +96,6 @@ /mob/living/carbon/alien/larva/start_pulling() return -/* Commented out because it's duplicated in life.dm -/mob/living/carbon/alien/larva/proc/grow() // Larvae can grow into full fledged Xenos if they survive long enough - if(icon_state == "larva_l" && !canmove) // This is a shit death check. It is made of shit and death. Fix later. - return - else - var/mob/living/carbon/alien/humanoid/A = new(loc) - A.key = key - qdel(src) */ - /mob/living/carbon/alien/larva/stripPanelUnequip(obj/item/what, mob/who) src << "You don't have the dexterity to do this!" return diff --git a/code/modules/mob/living/carbon/alien/larva/life.dm b/code/modules/mob/living/carbon/alien/larva/life.dm index 1c114151162..bc843e1dc13 100644 --- a/code/modules/mob/living/carbon/alien/larva/life.dm +++ b/code/modules/mob/living/carbon/alien/larva/life.dm @@ -1,10 +1,11 @@ //This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32 -/mob/living/carbon/alien/larva - var/temperature_alert = 0 - /mob/living/carbon/alien/larva/Life() + set invisibility = 0 + set background = BACKGROUND_ENABLED + if (notransform) + return if(..()) // GROW! if(amount_grown < max_grown) @@ -13,160 +14,26 @@ //some kind of bug in canmove() isn't properly calling update_icons, so this is here as a placeholder update_icons() - -/mob/living/carbon/alien/larva/handle_regular_status_updates() - updatehealth() - - if(stat == DEAD) //DEAD. BROWN BREAD. SWIMMING WITH THE SPESS CARP - eye_blind = max(1, eye_blind) - silent = 0 - else //ALIVE. LIGHTS ARE ON - if(health < -25 || !getorgan(/obj/item/organ/brain)) - death() - eye_blind = max(1, eye_blind) - - silent = 0 - return 1 - - //UNCONSCIOUS. NO-ONE IS HOME - if( (getOxyLoss() > 25) || (config.health_threshold_crit >= health) ) - //if( health <= 20 && prob(1) ) - // spawn(0) - // emote("gasp") - if(!reagents.has_reagent("epinephrine")) - adjustOxyLoss(1) - Paralyse(3) - - if(paralysis) - AdjustParalysis(-2) - eye_blind = max(eye_blind, 1) - stat = UNCONSCIOUS - else if(sleeping) - sleeping = max(sleeping-1, 0) - eye_blind = max(eye_blind, 1) - stat = UNCONSCIOUS - if( prob(10) && health ) - spawn(0) - emote("hiss_") - //CONSCIOUS - else - stat = CONSCIOUS - - /* What in the living hell is this?*/ - if(move_delay_add > 0) - move_delay_add = max(0, move_delay_add - rand(1, 2)) - - //Eyes - if(disabilities & BLIND) //disabled-blind, 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) - else if(eye_blurry) //blurry eyes heal slowly - eye_blurry = max(eye_blurry-1, 0) - - //Ears - if(disabilities & DEAF) //disabled-deaf, doesn't get better on its own - setEarDamage(-1, max(ear_deaf, 1)) - else - adjustEarDamage(-1, (ear_damage < 25 ? -0.05 : 0)) - //deafness, heals slowly over time - //ear damage heals slowly under this threshold. otherwise you'll need earmuffs - - //Other - if(stunned) - AdjustStunned(-1) - - if(weakened) - weakened = max(weakened-1,0) - - if(stuttering) - stuttering = max(stuttering-1, 0) - - if(silent) - silent = max(silent-1, 0) - - if(druggy) - druggy = max(druggy-1, 0) - return 1 - - -/mob/living/carbon/alien/larva/handle_regular_hud_updates() - - if (stat == 2) - 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 +/mob/living/carbon/alien/larva/handle_hud_icons_health() if (healths) if (stat != 2) switch(health) if(25 to INFINITY) healths.icon_state = "health0" - if(19 to 25) + if(20 to 25) healths.icon_state = "health1" - if(13 to 19) + if(15 to 20) healths.icon_state = "health2" - if(7 to 13) + if(10 to 15) healths.icon_state = "health3" - if(0 to 7) + if(5 to 10) healths.icon_state = "health4" - else + if(0 to 5) healths.icon_state = "health5" + else + healths.icon_state = "health6" 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 ((eye_blind)) - blind.layer = 18 - else - blind.layer = 0 - - if (disabilities & NEARSIGHT) - 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 + healths.icon_state = "health7" diff --git a/code/modules/mob/living/carbon/alien/life.dm b/code/modules/mob/living/carbon/alien/life.dm index ac723c4cb26..a658992e26b 100644 --- a/code/modules/mob/living/carbon/alien/life.dm +++ b/code/modules/mob/living/carbon/alien/life.dm @@ -1,95 +1,5 @@ -/mob/living/carbon/alien/Life() - - if(..()) - //First, resolve location and get a breath - if(SSair.times_fired%4==2) - //Only try to take a breath every 4 seconds, unless suffocating - spawn(0) breathe() - else //Still give containing object the chance to interact - if(istype(loc, /obj/)) - var/obj/location_as_object = loc - location_as_object.handle_internal_lifeform(src, 0) - return 1 - - -/mob/living/carbon/alien/handle_chemicals_in_body() - if(reagents) - reagents.metabolize(src) - - if (drowsyness) - drowsyness-- - eye_blurry = max(2, eye_blurry) - if (prob(5)) - sleeping += 1 - Paralyse(5) - - confused = max(0, confused - 1) - // decrement dizziness counter, clamped to 0 - if(resting) - dizziness = max(0, dizziness - 5) - jitteriness = max(0, jitteriness - 5) - else - dizziness = max(0, dizziness - 1) - jitteriness = max(0, jitteriness - 1) - - updatehealth() - - return //TODO: DEFERRED - -/mob/living/carbon/alien/proc/breathe() - if(reagents) - if(reagents.has_reagent("lexorin")) return - if(istype(loc, /obj/machinery/atmospherics/unary/cryo_cell)) return - - var/datum/gas_mixture/environment = loc.return_air() - var/datum/gas_mixture/breath - // HACK NEED CHANGING LATER - if(health <= config.health_threshold_crit) - losebreath++ - - if(losebreath>0) //Suffocating so do not take a breath - losebreath-- - if (prob(75)) //High chance of gasping for air - spawn emote("gasp") - if(istype(loc, /obj/)) - var/obj/location_as_object = loc - location_as_object.handle_internal_lifeform(src, 0) - else - //First, check for air from internal atmosphere (using an air tank and mask generally) - breath = get_breath_from_internal(BREATH_VOLUME) - - //No breath from internal atmosphere so get breath from location - if(!breath) - if(istype(loc, /obj/)) - var/obj/location_as_object = loc - breath = location_as_object.handle_internal_lifeform(src, BREATH_VOLUME) - else if(istype(loc, /turf/)) - var/breath_moles = environment.total_moles()*BREATH_PERCENTAGE - - breath = loc.remove_air(breath_moles) - - // Handle chem smoke effect -- Doohl - for(var/obj/effect/effect/chem_smoke/smoke in view(1, src)) - if(smoke.reagents.total_volume) - smoke.reagents.reaction(src, INGEST) - spawn(5) - if(smoke) - smoke.reagents.copy_to(src, 10) // I dunno, maybe the reagents enter the blood stream through the lungs? - break // If they breathe in the nasty stuff once, no need to continue checking - - - else //Still give containing object the chance to interact - if(istype(loc, /obj/)) - var/obj/location_as_object = loc - location_as_object.handle_internal_lifeform(src, 0) - - handle_breath(breath) - - if(breath) - loc.assume_air(breath) - -/mob/living/carbon/alien/proc/handle_breath(datum/gas_mixture/breath) +/mob/living/carbon/alien/check_breath(datum/gas_mixture/breath) if(status_flags & GODMODE) return @@ -117,6 +27,10 @@ breath.toxins -= toxins_used breath.oxygen += toxins_used + //BREATH TEMPERATURE + handle_breath_temperature(breath) + +/mob/living/carbon/alien/handle_breath_temperature(datum/gas_mixture/breath) if(breath.temperature > (T0C+66)) // Hot air hurts :( if(prob(20)) src << "You feel a searing heat in your lungs!" @@ -124,8 +38,76 @@ else fire_alert = 0 - //Temporary fixes to the alerts. + return 1 + +/mob/living/carbon/alien/handle_regular_status_updates() + ..() + //natural reduction of movement delay due to stun. + if(move_delay_add > 0) + move_delay_add = max(0, move_delay_add - rand(1, 2)) return 1 +/mob/living/carbon/alien/handle_vision() + client.screen.Remove(global_hud.blurry, global_hud.druggy, global_hud.vimpaired, global_hud.darkMask) + + if (stat == 2) + 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 ((blind && stat != 2)) + if((eye_blind)) + blind.layer = 18 + else + blind.layer = 0 + + if (disabilities & NEARSIGHT) + 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) + + +/mob/living/carbon/alien/handle_hud_icons() + + handle_hud_icons_health() + + 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]" + + return 1 diff --git a/code/modules/mob/living/carbon/brain/brain.dm b/code/modules/mob/living/carbon/brain/brain.dm index e70ea378428..212bfc12fac 100644 --- a/code/modules/mob/living/carbon/brain/brain.dm +++ b/code/modules/mob/living/carbon/brain/brain.dm @@ -29,6 +29,9 @@ /mob/living/carbon/brain/ex_act() //you cant blow up brainmobs because it makes transfer_to() freak out when borgs blow up. return +/mob/living/carbon/brain/blob_act() + return + /mob/living/carbon/brain/Move(var/atom/newloc) if(container) container.Move(newloc) diff --git a/code/modules/mob/living/carbon/brain/life.dm b/code/modules/mob/living/carbon/brain/life.dm index e5237d1e774..0f1ef27541f 100644 --- a/code/modules/mob/living/carbon/brain/life.dm +++ b/code/modules/mob/living/carbon/brain/life.dm @@ -1,40 +1,25 @@ +/mob/living/carbon/brain/handle_breathing() + return + /mob/living/carbon/brain/handle_mutations_and_radiation() if (radiation) if (radiation > 100) - radiation = 100 if(!container)//If it's not in an MMI src << "You feel weak." else//Fluff-wise, since the brain can't detect anything itself, the MMI handles thing like that src << "STATUS: CRITICAL AMOUNTS OF RADIATION DETECTED." - if (radiation < 0) - radiation = 0 - switch(radiation) - if(0 to 50) - radiation-- - if(prob(25)) - adjustToxLoss(1) - updatehealth() if(50 to 75) - radiation -= 2 - adjustToxLoss(1) if(prob(5)) - radiation -= 5 if(!container) src << "You feel weak." else src << "STATUS: DANGEROUS LEVELS OF RADIATION DETECTED." - updatehealth() - - if(75 to 100) - radiation -= 3 - adjustToxLoss(3) - updatehealth() - + ..() /mob/living/carbon/brain/handle_environment(datum/gas_mixture/environment) if(!environment) @@ -61,193 +46,92 @@ if(exposed_temperature > bodytemperature) var/discomfort = min( abs(exposed_temperature - bodytemperature)*(exposed_intensity)/2000000, 1.0) - //adjustFireLoss(2.5*discomfort) - //adjustFireLoss(5.0*discomfort) adjustFireLoss(20.0*discomfort) else var/discomfort = min( abs(exposed_temperature - bodytemperature)*(exposed_intensity)/2000000, 1.0) - //adjustFireLoss(2.5*discomfort) adjustFireLoss(5.0*discomfort) - -/mob/living/carbon/brain/handle_chemicals_in_body() - - if(reagents) reagents.metabolize(src) - - confused = max(0, confused - 1) - // decrement dizziness counter, clamped to 0 - if(resting) - dizziness = max(0, dizziness - 5) - else - dizziness = max(0, dizziness - 1) - - updatehealth() - - return //TODO: DEFERRED - - /mob/living/carbon/brain/handle_regular_status_updates() //TODO: comment out the unused bits >_> - updatehealth() - if(stat == DEAD) //DEAD. BROWN BREAD. SWIMMING WITH THE SPESS CARP + if(stat == DEAD) eye_blind = max(eye_blind, 1) silent = 0 - else //ALIVE. LIGHTS ARE ON + else + updatehealth() if( !container && (health < config.health_threshold_dead || ((world.time - timeofhostdeath) > config.revival_brain_life)) ) death() eye_blind = max(eye_blind, 1) silent = 0 return 1 + if(health < config.health_threshold_crit) + stat = UNCONSCIOUS + eye_blind = max(eye_blind, 1) + else + stat = CONSCIOUS - //Handling EMP effect in the Life(), it's made VERY simply, and has some additional effects handled elsewhere - if(emp_damage) //This is pretty much a damage type only used by MMIs, dished out by the emp_act - if(!(container && istype(container, /obj/item/device/mmi))) - emp_damage = 0 + //Handling EMP effect in the Life(), it's made VERY simply, and has some additional effects handled elsewhere + if(emp_damage) //This is pretty much a damage type only used by MMIs, dished out by the emp_act + if(!(container && istype(container, /obj/item/device/mmi))) + emp_damage = 0 + else + emp_damage = round(emp_damage,1)//Let's have some nice numbers to work with + switch(emp_damage) + if(31 to INFINITY) + emp_damage = 30//Let's not overdo it + if(21 to 30)//High level of EMP damage, unable to see, hear, or speak + eye_blind = max(eye_blind, 1) + setEarDamage(-1,1) + silent = 1 + if(!alert)//Sounds an alarm, but only once per 'level' + emote("alarm") + src << "Major electrical distruption detected: System rebooting." + alert = 1 + if(prob(75)) + emp_damage -= 1 + if(20) + alert = 0 + eye_blind = 0 + setEarDamage(-1,0) + silent = 0 + emp_damage -= 1 + if(11 to 19)//Moderate level of EMP damage, resulting in nearsightedness and ear damage + eye_blurry = 1 + setEarDamage(1,-1) + if(!alert) + emote("alert") + src << "Primary systems are now online." + alert = 1 + if(prob(50)) + emp_damage -= 1 + if(10) + alert = 0 + eye_blurry = 0 + setEarDamage(0,-1) + emp_damage -= 1 + if(2 to 9)//Low level of EMP damage, has few effects(handled elsewhere) + if(!alert) + emote("notice") + src << "System reboot nearly complete." + alert = 1 + if(prob(25)) + emp_damage -= 1 + if(1) + alert = 0 + src << "All systems restored." + emp_damage -= 1 else - emp_damage = round(emp_damage,1)//Let's have some nice numbers to work with - switch(emp_damage) - if(31 to INFINITY) - emp_damage = 30//Let's not overdo it - if(21 to 30)//High level of EMP damage, unable to see, hear, or speak - eye_blind = max(eye_blind, 1) - setEarDamage(-1,1) - silent = 1 - if(!alert)//Sounds an alarm, but only once per 'level' - emote("alarm") - src << "Major electrical distruption detected: System rebooting." - alert = 1 - if(prob(75)) - emp_damage -= 1 - if(20) - alert = 0 - eye_blind = 0 - setEarDamage(-1,0) - silent = 0 - emp_damage -= 1 - if(11 to 19)//Moderate level of EMP damage, resulting in nearsightedness and ear damage - eye_blurry = 1 - setEarDamage(1,-1) - if(!alert) - emote("alert") - src << "Primary systems are now online." - alert = 1 - if(prob(50)) - emp_damage -= 1 - if(10) - alert = 0 - eye_blurry = 0 - setEarDamage(0,-1) - emp_damage -= 1 - if(2 to 9)//Low level of EMP damage, has few effects(handled elsewhere) - if(!alert) - emote("notice") - src << "System reboot nearly complete." - alert = 1 - if(prob(25)) - emp_damage -= 1 - if(1) - alert = 0 - src << "All systems restored." - emp_damage -= 1 + eye_blind = 0 - //Other - /* commented out because none of these should happen - if(stunned) - AdjustStunned(-1) - - if(weakened) - weakened = max(weakened-1,0) - - if(stuttering) - stuttering = max(stuttering-1, 0) - - if(silent) - silent = max(silent-1, 0) - - if(druggy) - druggy = max(druggy-1, 0) - */ return 1 /mob/living/carbon/brain/handle_regular_hud_updates() - if (stat == 2) - 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_TURFS - sight &= ~SEE_MOBS - sight &= ~SEE_OBJS - see_in_dark = 2 - see_invisible = SEE_INVISIBLE_LIVING - if(see_override) - see_invisible = see_override + handle_vision() - if (healths) - if (stat != 2) - switch(health) - if(100 to INFINITY) - healths.icon_state = "health0" - if(80 to 100) - healths.icon_state = "health1" - if(60 to 80) - healths.icon_state = "health2" - if(40 to 60) - healths.icon_state = "health3" - if(20 to 40) - healths.icon_state = "health4" - if(0 to 20) - healths.icon_state = "health5" - else - healths.icon_state = "health6" - else - healths.icon_state = "health7" - - if(pullin) pullin.icon_state = "pull[pulling ? 1 : 0]" - - client.screen.Remove(global_hud.blurry,global_hud.druggy,global_hud.vimpaired) - - if ((blind && stat != 2)) - if (eye_blind) - blind.layer = 18 - else - blind.layer = 0 - - if (disabilities & NEARSIGHT) - 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) + handle_hud_icons_health() return 1 - -/*/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) - ..()*/ diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 2be2571ea3e..a9b1f519542 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -377,3 +377,10 @@ var/const/GALOSHES_DONT_HELP = 8 /mob/living/carbon/is_muzzled() return(istype(src.wear_mask, /obj/item/clothing/mask/muzzle)) + +/mob/living/carbon/blob_act() + if (stat == DEAD) + return + else + show_message("The blob attacks!") + adjustBruteLoss(10) diff --git a/code/modules/mob/living/carbon/carbon_defines.dm b/code/modules/mob/living/carbon/carbon_defines.dm index a1237ccd8c8..c24bf2d75b4 100644 --- a/code/modules/mob/living/carbon/carbon_defines.dm +++ b/code/modules/mob/living/carbon/carbon_defines.dm @@ -15,3 +15,8 @@ var/obj/item/weapon/tank/internal = null var/datum/dna/dna = null//Carbon + + var/failed_last_breath = 0 //This is used to determine if the mob failed a breath. If they did fail a brath, they will attempt to breathe each tick, otherwise just once per 4 ticks. + + var/co2overloadtime = null + var/temperature_resistance = T0C+75 diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 1cfca7982c3..6e546dfaabf 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -78,7 +78,6 @@ /mob/living/carbon/human/ex_act(severity, ex_target) - var/shielded = 0 var/b_loss = null var/f_loss = null switch (severity) @@ -95,8 +94,7 @@ //user.throw_at(target, 200, 4) if (2.0) - if (!shielded) - b_loss += 60 + b_loss += 60 f_loss += 60 @@ -106,7 +104,7 @@ if (!istype(ears, /obj/item/clothing/ears/earmuffs)) adjustEarDamage(30, 120) - if (prob(70) && !shielded) + if (prob(70)) Paralyse(10) if(3.0) @@ -115,7 +113,7 @@ b_loss = b_loss/2 if (!istype(ears, /obj/item/clothing/ears/earmuffs)) adjustEarDamage(15,60) - if (prob(50) && !shielded) + if (prob(50)) Paralyse(10) var/update = 0 @@ -138,17 +136,13 @@ ..() /mob/living/carbon/human/blob_act() - if(stat == 2) return + if(stat == DEAD) return show_message(" The blob attacks you!") var/dam_zone = pick("chest", "l_hand", "r_hand", "l_leg", "r_leg") var/obj/item/organ/limb/affecting = get_organ(ran_zone(dam_zone)) apply_damage(5, BRUTE, affecting, run_armor_check(affecting, "melee")) return -/mob/living/carbon/human/var/co2overloadtime = null -/mob/living/carbon/human/var/temperature_resistance = T0C+75 - - /mob/living/carbon/human/show_inv(mob/user) user.set_machine(src) var/has_breathable_mask = istype(wear_mask, /obj/item/clothing/mask) diff --git a/code/modules/mob/living/carbon/human/human_defines.dm b/code/modules/mob/living/carbon/human/human_defines.dm index 6bd44a4115d..efcec3c28ee 100644 --- a/code/modules/mob/living/carbon/human/human_defines.dm +++ b/code/modules/mob/living/carbon/human/human_defines.dm @@ -44,8 +44,6 @@ var/special_voice = "" // For changing our voice. Used by a symptom. - var/failed_last_breath = 0 //This is used to determine if the mob failed a breath. If they did fail a brath, they will attempt to breathe each tick, otherwise just once per 4 ticks. - var/xylophone = 0 //For the spoooooooky xylophone cooldown var/gender_ambiguous = 0 //if something goes wrong during gender reassignment this generates a line in examine diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index a32591f9d52..68dacd83a09 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -6,8 +6,6 @@ #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 -#define HUMAN_MAX_OXYLOSS 3 //Defines how much oxyloss humans can get per tick. A tile with no air at all (such as space) applies this value, otherwise it's a percentage of it. - #define HEAT_DAMAGE_LEVEL_1 2 //Amount of damage applied when your body temperature just passes the 360.15k safety point #define HEAT_DAMAGE_LEVEL_2 3 //Amount of damage applied when your body temperature passes the 400K point #define HEAT_DAMAGE_LEVEL_3 8 //Amount of damage applied when your body temperature passes the 460K point and you are on fire @@ -26,31 +24,21 @@ #define COLD_GAS_DAMAGE_LEVEL_3 3 //Amount of damage applied when the current breath's temperature passes the 120K point /mob/living/carbon/human - var/oxygen_alert = 0 - var/toxins_alert = 0 - var/fire_alert = 0 - var/pressure_alert = 0 - var/temperature_alert = 0 var/tinttotal = 0 // Total level of visualy impairing items /mob/living/carbon/human/Life() + set invisibility = 0 + set background = BACKGROUND_ENABLED + + if (notransform) + return fire_alert = 0 //Reset this here, because both breathe() and handle_environment() have a chance to set it. tinttotal = tintcheck() //here as both hud updates and status updates call it if(..()) - if(dna) - for(var/datum/mutation/human/HM in dna.mutations) - HM.on_life(src) - if(SSmob.times_fired%4==2 || failed_last_breath) //First, resolve location and get a breath - breathe() //Only try to take a breath every 4 ticks, unless suffocating - else //Still give containing object the chance to interact - if(istype(loc, /obj/)) - var/obj/location_as_object = loc - location_as_object.handle_internal_lifeform(src, 0) - //Stuff jammed in your limbs hurts handle_embedded_objects() @@ -79,7 +67,19 @@ /mob/living/carbon/human/handle_disabilities() - if (getBrainLoss() >= 60 && stat != 2) + ..() + //Eyes + if(!(disabilities & BLIND)) + if(tinttotal >= TINT_BLIND) //covering your eyes heals blurry eyes faster + eye_blurry = max(eye_blurry-2, 0) + + //Ears + if(!(disabilities & DEAF)) + if(istype(ears, /obj/item/clothing/ears/earmuffs)) // earmuffs rest your ears, healing ear_deaf faster and ear_damage, but keeping you deaf. + setEarDamage(max(ear_damage-0.10, 0), max(ear_deaf - 1, 1)) + + + if (getBrainLoss() >= 60 && stat != DEAD) if (prob(3)) switch(pick(1,2,3)) if(1) @@ -92,9 +92,10 @@ /mob/living/carbon/human/handle_mutations_and_radiation() if(dna) - dna.species.handle_mutations_and_radiation(src) + if(dna.species.handle_mutations_and_radiation(src)) + ..() -/mob/living/carbon/human/proc/breathe() +/mob/living/carbon/human/breathe() if(dna) dna.species.breathe(src) @@ -140,27 +141,8 @@ dna.species.ExtinguishMob(src) else ..() - //END FIRE CODE - /* -/mob/living/carbon/human/proc/adjust_body_temperature(current, loc_temp, boost) - var/temperature = current - var/difference = abs(current-loc_temp) //get difference - var/increments// = difference/10 //find how many increments apart they are - if(difference > 50) - increments = difference/5 - else - increments = difference/10 - var/change = increments*boost // Get the amount to change by (x per increment) - var/temp_change - if(current < loc_temp) - temperature = min(loc_temp, temperature+change) - else if(current > loc_temp) - temperature = max(loc_temp, temperature-change) - temp_change = (temperature - current) - return temp_change -*/ /mob/living/carbon/human/proc/stabilize_temperature_from_calories() switch(bodytemperature) @@ -297,290 +279,28 @@ return min(1,thermal_protection) -/* -/mob/living/carbon/human/proc/add_fire_protection(var/temp) - var/fire_prot = 0 - if(head) - if(head.protective_temperature > temp) - fire_prot += (head.protective_temperature/10) - if(wear_mask) - if(wear_mask.protective_temperature > temp) - fire_prot += (wear_mask.protective_temperature/10) - if(glasses) - if(glasses.protective_temperature > temp) - fire_prot += (glasses.protective_temperature/10) - if(ears) - if(ears.protective_temperature > temp) - fire_prot += (ears.protective_temperature/10) - if(wear_suit) - if(wear_suit.protective_temperature > temp) - fire_prot += (wear_suit.protective_temperature/10) - if(w_uniform) - if(w_uniform.protective_temperature > temp) - fire_prot += (w_uniform.protective_temperature/10) - if(gloves) - if(gloves.protective_temperature > temp) - fire_prot += (gloves.protective_temperature/10) - if(shoes) - if(shoes.protective_temperature > temp) - fire_prot += (shoes.protective_temperature/10) - - return fire_prot - -/mob/living/carbon/human/proc/handle_temperature_damage(body_part, exposed_temperature, exposed_intensity) - if(nodamage) - return - //world <<"body_part = [body_part], exposed_temperature = [exposed_temperature], exposed_intensity = [exposed_intensity]" - var/discomfort = min(abs(exposed_temperature - bodytemperature)*(exposed_intensity)/2000000, 1.0) - - if(exposed_temperature > bodytemperature) - discomfort *= 4 - - if(mutantrace == "plant") - discomfort *= TEMPERATURE_DAMAGE_COEFFICIENT * 2 //I don't like magic numbers. I'll make mutantraces a datum with vars sometime later. -- Urist - else - discomfort *= TEMPERATURE_DAMAGE_COEFFICIENT //Dangercon 2011 - now with less magic numbers! - //world <<"[discomfort]" - - switch(body_part) - if(HEAD) - apply_damage(2.5*discomfort, BURN, "head") - if(CHEST) - apply_damage(2.5*discomfort, BURN, "chest") - if(LEGS) - apply_damage(0.6*discomfort, BURN, "l_leg") - apply_damage(0.6*discomfort, BURN, "r_leg") - if(ARMS) - apply_damage(0.4*discomfort, BURN, "l_arm") - apply_damage(0.4*discomfort, BURN, "r_arm") -*/ /mob/living/carbon/human/handle_chemicals_in_body() + ..() if(dna) dna.species.handle_chemicals_in_body(src) return //TODO: DEFERRED -/mob/living/carbon/human/handle_regular_status_updates() - if(stat == DEAD) //DEAD. BROWN BREAD. SWIMMING WITH THE SPESS CARP - silent = 0 - else //ALIVE. LIGHTS ARE ON - updatehealth() //TODO - if(health <= config.health_threshold_dead || !getorgan(/obj/item/organ/brain)) - death() - silent = 0 - return 1 - - - //UNCONSCIOUS. NO-ONE IS HOME - if( (getOxyLoss() > 50) || (config.health_threshold_crit >= health) ) - Paralyse(3) - - if(hallucination) - spawn handle_hallucinations() - - if(hallucination<=2) - hallucination = 0 - else - hallucination -= 2 - - else - for(var/atom/a in hallucinations) - qdel(a) - - if(paralysis) - AdjustParalysis(-1) - stat = UNCONSCIOUS - else if(sleeping) - handle_dreams() - adjustStaminaLoss(-10) - sleeping = max(sleeping-1, 0) - stat = UNCONSCIOUS - if( prob(10) && health && !hal_crit ) - spawn(0) - emote("snore") - else if (status_flags & FAKEDEATH) - stat = UNCONSCIOUS - //CONSCIOUS - else - stat = CONSCIOUS - - //Eyes - if(disabilities & BLIND || stat) //disabled-blind, 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) - else if(tinttotal >= TINT_BLIND) //covering your eyes heals blurry eyes faster - eye_blurry = max(eye_blurry-3, 0) - else if(eye_blurry) //blurry eyes heal slowly - eye_blurry = max(eye_blurry-1, 0) - - //Ears - if(disabilities & DEAF) //disabled-deaf, doesn't get better on its own - setEarDamage(-1, max(ear_deaf, 1)) - else if (ear_damage < 100) // deafness heals slowly over time, unless ear_damage is over 100 - if(istype(ears, /obj/item/clothing/ears/earmuffs)) // earmuffs rest your ears, healing 3x faster, but keeping you deaf. - setEarDamage(max(ear_damage-0.15, 0), max(ear_deaf - 1, 1)) - else - adjustEarDamage(-0.05, -1) - - //Dizziness - if(dizziness) - var/client/C = client - var/pixel_x_diff = 0 - var/pixel_y_diff = 0 - var/temp - var/saved_dizz = dizziness - dizziness = max(dizziness-1, 0) - if(C) - var/oldsrc = src - var/amplitude = dizziness*(sin(dizziness * 0.044 * world.time) + 1) / 70 // This shit is annoying at high strength - src = null - spawn(0) - if(C) - temp = amplitude * sin(0.008 * saved_dizz * world.time) - pixel_x_diff += temp - C.pixel_x += temp - temp = amplitude * cos(0.008 * saved_dizz * world.time) - pixel_y_diff += temp - C.pixel_y += temp - sleep(3) - if(C) - temp = amplitude * sin(0.008 * saved_dizz * world.time) - pixel_x_diff += temp - C.pixel_x += temp - temp = amplitude * cos(0.008 * saved_dizz * world.time) - pixel_y_diff += temp - C.pixel_y += temp - sleep(3) - if(C) - C.pixel_x -= pixel_x_diff - C.pixel_y -= pixel_y_diff - src = oldsrc - - //Jitteryness - if(jitteriness) - do_jitter_animation(jitteriness) - jitteriness = max(jitteriness-1, 0) - - //Other - if(stunned) - AdjustStunned(-1) - - if(weakened) - weakened = max(weakened-1,0) - - if(stuttering) - stuttering = max(stuttering-1, 0) - - if(slurring) - slurring = max(slurring-1,0) - - if(silent) - silent = max(silent-1, 0) - - if(druggy) - druggy = max(druggy-1, 0) - - CheckStamina() +/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 + if(!client.adminobs) reset_view(null) if(dna) dna.species.handle_vision(src) - return 1 - -/mob/living/carbon/human/handle_regular_hud_updates() - if(!client) return 0 - - client.screen.Remove(global_hud.blurry, global_hud.druggy, global_hud.vimpaired, global_hud.darkMask) - - update_action_buttons() - - 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/screen_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 - else - //Oxygen damage overlay - if(oxyloss) - var/image/I = image("icon" = 'icons/mob/screen_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 - - //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/screen_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 - - if(machine) - if(!machine.check_eye(src)) reset_view(null) - else - if(!client.adminobs) reset_view(null) - +/mob/living/carbon/human/handle_hud_icons() if(dna) dna.species.handle_hud_icons(src) - return 1 - /mob/living/carbon/human/handle_random_events() // Puke if toxloss is too high if(!stat) @@ -605,10 +325,25 @@ /mob/living/carbon/human/handle_changeling() - if(mind && mind.changeling) - mind.changeling.regenerate() - + if(mind) + if(mind.changeling) + mind.changeling.regenerate() + hud_used.lingchemdisplay.invisibility = 0 + hud_used.lingchemdisplay.maptext = "