diff --git a/code/modules/mob/living/carbon/alien/humanoid/life.dm b/code/modules/mob/living/carbon/alien/humanoid/life.dm index 82ecc738dcd..a759c75c0cf 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/life.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/life.dm @@ -68,404 +68,403 @@ handle_regular_hud_updates() -/mob/living/carbon/alien/humanoid - proc/handle_disabilities() - if (disabilities & EPILEPSY) - if ((prob(1) && paralysis < 10)) - src << "\red You have a seizure!" - Paralyse(10) - if (disabilities & COUGHING) - if ((prob(5) && paralysis <= 1)) - drop_item() - spawn( 0 ) - emote("cough") - return - if (disabilities & TOURETTES) - if ((prob(10) && paralysis <= 1)) - Stun(10) - spawn( 0 ) - emote("twitch") - return - if (disabilities & NERVOUS) - if (prob(10)) - stuttering = max(10, stuttering) +/mob/living/carbon/alien/humanoid/proc/handle_disabilities() + if (disabilities & EPILEPSY) + if ((prob(1) && paralysis < 10)) + src << "\red You have a seizure!" + Paralyse(10) + if (disabilities & COUGHING) + if ((prob(5) && paralysis <= 1)) + drop_item() + spawn( 0 ) + emote("cough") + return + if (disabilities & TOURETTES) + if ((prob(10) && paralysis <= 1)) + Stun(10) + spawn( 0 ) + emote("twitch") + return + if (disabilities & NERVOUS) + if (prob(10)) + stuttering = max(10, stuttering) - proc/breathe() - if(reagents) - if(reagents.has_reagent("lexorin")) return - if(istype(loc, /obj/machinery/atmospherics/unary/cryo_cell)) return +/mob/living/carbon/alien/humanoid/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++ + 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(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 = 0 + /*if(environment.return_pressure() > ONE_ATMOSPHERE) + // Loads of air around (pressure effect will be handled elsewhere), so lets just take a enough to fill our lungs at normal atmos pressure (using n = Pv/RT) + breath_moles = (ONE_ATMOSPHERE*BREATH_VOLUME/R_IDEAL_GAS_EQUATION*environment.temperature) + else*/ + // Not enough air around, take a percentage of what's there to model this properly + 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) - 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 = 0 - /*if(environment.return_pressure() > ONE_ATMOSPHERE) - // Loads of air around (pressure effect will be handled elsewhere), so lets just take a enough to fill our lungs at normal atmos pressure (using n = Pv/RT) - breath_moles = (ONE_ATMOSPHERE*BREATH_VOLUME/R_IDEAL_GAS_EQUATION*environment.temperature) - else*/ - // Not enough air around, take a percentage of what's there to model this properly - breath_moles = environment.total_moles()*BREATH_PERCENTAGE + handle_breath(breath) - 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 + if(breath) + loc.assume_air(breath) - 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) - - - proc/get_breath_from_internal(volume_needed) +/mob/living/carbon/alien/humanoid/proc/get_breath_from_internal(volume_needed) + if(internal) + if (!contents.Find(internal)) + internal = null + if (!wear_mask || !(wear_mask.flags & MASKINTERNALS) ) + internal = null if(internal) - if (!contents.Find(internal)) - internal = null - if (!wear_mask || !(wear_mask.flags & MASKINTERNALS) ) - internal = null - if(internal) - if (internals) - internals.icon_state = "internal1" - return internal.remove_air_volume(volume_needed) - else - if (internals) - internals.icon_state = "internal0" - return null - - proc/handle_breath(datum/gas_mixture/breath) - if(status_flags & GODMODE) - return - - if(!breath || (breath.total_moles() == 0)) - //Aliens breathe in vaccuum - return 0 - - var/toxins_used = 0 - var/breath_pressure = (breath.total_moles()*R_IDEAL_GAS_EQUATION*breath.temperature)/BREATH_VOLUME - - //Partial pressure of the toxins in our breath - var/Toxins_pp = (breath.toxins/breath.total_moles())*breath_pressure - - if(Toxins_pp) // Detect toxins in air - - adjustToxLoss(breath.toxins*250) - toxins_alert = max(toxins_alert, 1) - - toxins_used = breath.toxins - + if (internals) + internals.icon_state = "internal1" + return internal.remove_air_volume(volume_needed) else - toxins_alert = 0 + if (internals) + internals.icon_state = "internal0" + return null - //Breathe in toxins and out oxygen - breath.toxins -= toxins_used - breath.oxygen += toxins_used +/mob/living/carbon/alien/humanoid/proc/handle_breath(datum/gas_mixture/breath) + if(status_flags & GODMODE) + return - if(breath.temperature > (T0C+66) && !(COLD_RESISTANCE in mutations)) // Hot air hurts :( - if(prob(20)) - src << "You feel a searing heat in your lungs!>/span>" - fire_alert = max(fire_alert, 1) - else - fire_alert = 0 + if(!breath || (breath.total_moles() == 0)) + //Aliens breathe in vaccuum + return 0 - //Temporary fixes to the alerts. + var/toxins_used = 0 + var/breath_pressure = (breath.total_moles()*R_IDEAL_GAS_EQUATION*breath.temperature)/BREATH_VOLUME - return 1 + //Partial pressure of the toxins in our breath + var/Toxins_pp = (breath.toxins/breath.total_moles())*breath_pressure + + if(Toxins_pp) // Detect toxins in air + + adjustToxLoss(breath.toxins*250) + toxins_alert = max(toxins_alert, 1) + + toxins_used = breath.toxins + + else + toxins_alert = 0 + + //Breathe in toxins and out oxygen + breath.toxins -= toxins_used + breath.oxygen += toxins_used + + if(breath.temperature > (T0C+66) && !(COLD_RESISTANCE in mutations)) // Hot air hurts :( + if(prob(20)) + src << "You feel a searing heat in your lungs!>/span>" + fire_alert = max(fire_alert, 1) + else + fire_alert = 0 + + //Temporary fixes to the alerts. + + return 1 - 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/alien/humanoid/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 /* - proc/get_thermal_protection() - var/thermal_protection = 1.0 - //Handle normal clothing - if(head && (head.body_parts_covered & HEAD)) - thermal_protection += 0.5 - if(wear_suit && (wear_suit.body_parts_covered & CHEST)) - thermal_protection += 0.5 - if(wear_suit && (wear_suit.body_parts_covered & LEGS)) - thermal_protection += 0.2 - if(wear_suit && (wear_suit.body_parts_covered & ARMS)) - thermal_protection += 0.2 - if(wear_suit && (wear_suit.body_parts_covered & HANDS)) - thermal_protection += 0.2 - if(wear_suit && (wear_suit.flags & SUITSPACE)) - thermal_protection += 3 - if(COLD_RESISTANCE in mutations) - thermal_protection += 5 +/mob/living/carbon/alien/humanoid/proc/get_thermal_protection() + var/thermal_protection = 1.0 + //Handle normal clothing + if(head && (head.body_parts_covered & HEAD)) + thermal_protection += 0.5 + if(wear_suit && (wear_suit.body_parts_covered & CHEST)) + thermal_protection += 0.5 + if(wear_suit && (wear_suit.body_parts_covered & LEGS)) + thermal_protection += 0.2 + if(wear_suit && (wear_suit.body_parts_covered & ARMS)) + thermal_protection += 0.2 + if(wear_suit && (wear_suit.body_parts_covered & HANDS)) + thermal_protection += 0.2 + if(wear_suit && (wear_suit.flags & SUITSPACE)) + thermal_protection += 3 + if(COLD_RESISTANCE in mutations) + thermal_protection += 5 - return thermal_protection + return thermal_protection - 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(wear_suit) - if(wear_suit.protective_temperature > temp) - fire_prot += (wear_suit.protective_temperature/10) +/mob/living/carbon/alien/humanoid/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(wear_suit) + if(wear_suit.protective_temperature > temp) + fire_prot += (wear_suit.protective_temperature/10) - return fire_prot - */ + return fire_prot +*/ - proc/handle_chemicals_in_body() +/mob/living/carbon/alien/humanoid/proc/handle_chemicals_in_body() - if(reagents) reagents.metabolize(src) + if(reagents) reagents.metabolize(src) - if(FAT in mutations) - if(nutrition < 100) - if(prob(round((50 - nutrition) / 100))) - src << "You feel fit again!" - mutations.Remove(FAT) - else - if(nutrition > 500) - if(prob(5 + round((nutrition - 200) / 2))) - src << "You suddenly feel blubbery!" - mutations.Add(FAT) + if(FAT in mutations) + if(nutrition < 100) + if(prob(round((50 - nutrition) / 100))) + src << "You feel fit again!" + mutations.Remove(FAT) + else + if(nutrition > 500) + if(prob(5 + round((nutrition - 200) / 2))) + src << "You suddenly feel blubbery!" + mutations.Add(FAT) - if (nutrition > 0) - nutrition -= HUNGER_FACTOR + if (nutrition > 0) + nutrition -= HUNGER_FACTOR - if (drowsyness) - drowsyness-- - eye_blurry = max(2, eye_blurry) - if (prob(5)) - sleeping += 1 - Paralyse(5) + 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) + 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() + updatehealth() - return //TODO: DEFERRED + return //TODO: DEFERRED - proc/handle_regular_status_updates() - updatehealth() +/mob/living/carbon/alien/humanoid/proc/handle_regular_status_updates() + updatehealth() - if(stat == DEAD) //DEAD. BROWN BREAD. SWIMMING WITH THE SPESS CARP + if(stat == DEAD) //DEAD. BROWN BREAD. SWIMMING WITH THE SPESS CARP + blinded = 1 + silent = 0 + else //ALIVE. LIGHTS ARE ON + if(health < config.health_threshold_dead || !getorgan(/obj/item/organ/brain)) + death() blinded = 1 + stat = DEAD silent = 0 - else //ALIVE. LIGHTS ARE ON - if(health < config.health_threshold_dead || !getorgan(/obj/item/organ/brain)) - death() - blinded = 1 - stat = DEAD - silent = 0 - return 1 + 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("inaprovaline")) - adjustOxyLoss(1) - Paralyse(3) + //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("inaprovaline")) + adjustOxyLoss(1) + Paralyse(3) - if(paralysis) - AdjustParalysis(-1) - blinded = 1 - stat = UNCONSCIOUS - else if(sleeping) - sleeping = max(sleeping-1, 0) - blinded = 1 - stat = UNCONSCIOUS - if( prob(10) && health ) - spawn(0) - emote("hiss") - //CONSCIOUS - else - stat = CONSCIOUS + if(paralysis) + AdjustParalysis(-1) + blinded = 1 + stat = UNCONSCIOUS + else if(sleeping) + sleeping = max(sleeping-1, 0) + blinded = 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)) + /* 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(sdisabilities & BLIND) //disabled-blind, doesn't get better on its own - blinded = 1 - else if(eye_blind) //blindness, heals slowly over time - eye_blind = max(eye_blind-1,0) - blinded = 1 - else if(eye_blurry) //blurry eyes heal slowly - eye_blurry = max(eye_blurry-1, 0) + //Eyes + if(sdisabilities & BLIND) //disabled-blind, doesn't get better on its own + blinded = 1 + else if(eye_blind) //blindness, heals slowly over time + eye_blind = max(eye_blind-1,0) + blinded = 1 + else if(eye_blurry) //blurry eyes heal slowly + eye_blurry = max(eye_blurry-1, 0) - //Ears - if(sdisabilities & DEAF) //disabled-deaf, doesn't get better on its own - ear_deaf = max(ear_deaf, 1) - else if(ear_deaf) //deafness, heals slowly over time - ear_deaf = max(ear_deaf-1, 0) - else if(ear_damage < 25) //ear damage heals slowly under this threshold. otherwise you'll need earmuffs - ear_damage = max(ear_damage-0.05, 0) + //Ears + if(sdisabilities & DEAF) //disabled-deaf, doesn't get better on its own + ear_deaf = max(ear_deaf, 1) + else if(ear_deaf) //deafness, heals slowly over time + ear_deaf = max(ear_deaf-1, 0) + else if(ear_damage < 25) //ear damage heals slowly under this threshold. otherwise you'll need earmuffs + ear_damage = max(ear_damage-0.05, 0) - //Other - if(stunned) - AdjustStunned(-1) - if(!stunned) - update_icons() + //Other + if(stunned) + AdjustStunned(-1) + if(!stunned) + update_icons() - if(weakened) - weakened = max(weakened-1,0) + if(weakened) + weakened = max(weakened-1,0) - if(stuttering) - stuttering = max(stuttering-1, 0) + if(stuttering) + stuttering = max(stuttering-1, 0) - if(silent) - silent = max(silent-1, 0) + if(silent) + silent = max(silent-1, 0) - if(druggy) - druggy = max(druggy-1, 0) - return 1 + if(druggy) + druggy = max(druggy-1, 0) + return 1 - proc/handle_regular_hud_updates() +/mob/living/carbon/alien/humanoid/proc/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 - see_in_dark = 4 - see_invisible = SEE_INVISIBLE_LEVEL_TWO - 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 ((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 || (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 + see_in_dark = 4 + see_invisible = SEE_INVISIBLE_LEVEL_TWO + if(see_override) + see_invisible = see_override + if (healths) if (stat != 2) - if (machine) - if (!( machine.check_eye(src) )) - reset_view(null) - else - if(!client.adminobs) - reset_view(null) + 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" - return 1 + if(pullin) + if(pulling) + pullin.icon_state = "pull" + else + pullin.icon_state = "pull0" - proc/handle_stomach() - spawn(0) - for(var/mob/living/M in stomach_contents) - if(M.loc != src) + + 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 + +/mob/living/carbon/alien/humanoid/proc/handle_stomach() + spawn(0) + for(var/mob/living/M in stomach_contents) + if(M.loc != src) + stomach_contents.Remove(M) + continue + if(istype(M, /mob/living/carbon) && stat != 2) + if(M.stat == 2) + M.death(1) stomach_contents.Remove(M) + qdel(M) continue - if(istype(M, /mob/living/carbon) && stat != 2) - if(M.stat == 2) - M.death(1) - stomach_contents.Remove(M) - qdel(M) - continue - if(air_master.current_cycle%3==1) - if(!(status_flags & GODMODE)) - M.adjustBruteLoss(5) - nutrition += 10 + if(air_master.current_cycle%3==1) + if(!(status_flags & GODMODE)) + M.adjustBruteLoss(5) + nutrition += 10 diff --git a/code/modules/mob/living/carbon/alien/larva/life.dm b/code/modules/mob/living/carbon/alien/larva/life.dm index 06d8774b50b..b7f6cb35a41 100644 --- a/code/modules/mob/living/carbon/alien/larva/life.dm +++ b/code/modules/mob/living/carbon/alien/larva/life.dm @@ -62,327 +62,325 @@ handle_regular_hud_updates() -/mob/living/carbon/alien/larva +/mob/living/carbon/alien/larva/proc/breathe() - proc/breathe() + if(reagents.has_reagent("lexorin")) return + if(istype(loc, /obj/machinery/atmospherics/unary/cryo_cell)) return - 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++ - 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) - if(losebreath>0) //Suffocating so do not take a breath - losebreath-- - if (prob(75)) //High chance of gasping for air - spawn emote("gasp") + //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 = 0 + /*if(environment.return_pressure() > ONE_ATMOSPHERE) + // Loads of air around (pressure effect will be handled elsewhere), so lets just take a enough to fill our lungs at normal atmos pressure (using n = Pv/RT) + breath_moles = (ONE_ATMOSPHERE*BREATH_VOLUME/R_IDEAL_GAS_EQUATION*environment.temperature) + else*/ + // Not enough air around, take a percentage of what's there to model this properly + 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) - 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 = 0 - /*if(environment.return_pressure() > ONE_ATMOSPHERE) - // Loads of air around (pressure effect will be handled elsewhere), so lets just take a enough to fill our lungs at normal atmos pressure (using n = Pv/RT) - breath_moles = (ONE_ATMOSPHERE*BREATH_VOLUME/R_IDEAL_GAS_EQUATION*environment.temperature) - else*/ - // Not enough air around, take a percentage of what's there to model this properly - breath_moles = environment.total_moles()*BREATH_PERCENTAGE + handle_breath(breath) - 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 + if(breath) + loc.assume_air(breath) - 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) - - - proc/get_breath_from_internal(volume_needed) +/mob/living/carbon/alien/larva/proc/get_breath_from_internal(volume_needed) + if(internal) + if (!contents.Find(internal)) + internal = null + if (!wear_mask || !(wear_mask.flags & MASKINTERNALS) ) + internal = null if(internal) - if (!contents.Find(internal)) - internal = null - if (!wear_mask || !(wear_mask.flags & MASKINTERNALS) ) - internal = null - if(internal) - if (internals) - internals.icon_state = "internal1" - return internal.remove_air_volume(volume_needed) - else - if (internals) - internals.icon_state = "internal0" - return null - - proc/handle_breath(datum/gas_mixture/breath) - if(status_flags & GODMODE) - return - - if(!breath || (breath.total_moles() == 0)) - //Aliens breathe in vaccuum - return 0 - - var/toxins_used = 0 - var/breath_pressure = (breath.total_moles()*R_IDEAL_GAS_EQUATION*breath.temperature)/BREATH_VOLUME - - //Partial pressure of the toxins in our breath - var/Toxins_pp = (breath.toxins/breath.total_moles())*breath_pressure - - if(Toxins_pp) // Detect toxins in air - - adjustToxLoss(breath.toxins*250) - toxins_alert = max(toxins_alert, 1) - - toxins_used = breath.toxins - + if (internals) + internals.icon_state = "internal1" + return internal.remove_air_volume(volume_needed) else - toxins_alert = 0 + if (internals) + internals.icon_state = "internal0" + return null - //Breathe in toxins and out oxygen - breath.toxins -= toxins_used - breath.oxygen += toxins_used - - if(breath.temperature > (T0C+66) && !(COLD_RESISTANCE in mutations)) // Hot air hurts :( - if(prob(20)) - src << "You feel a searing heat in your lungs!" - fire_alert = max(fire_alert, 1) - else - fire_alert = 0 - - //Temporary fixes to the alerts. - - return 1 - - - proc/handle_chemicals_in_body() - if(reagents) reagents.metabolize(src) - - if(FAT in mutations) - if(nutrition < 100) - if(prob(round((50 - nutrition) / 100))) - src << "You feel fit again!" - mutations.Add(FAT) - else - if(nutrition > 500) - if(prob(5 + round((nutrition - max_grown) / 2))) - src << "You suddenly feel blubbery!" - mutations.Add(FAT) - - if (nutrition > 0) - nutrition-= HUNGER_FACTOR - - 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 - - proc/handle_regular_status_updates() - updatehealth() - - if(stat == DEAD) //DEAD. BROWN BREAD. SWIMMING WITH THE SPESS CARP - blinded = 1 - silent = 0 - else //ALIVE. LIGHTS ARE ON - if(health < -25 || !getorgan(/obj/item/organ/brain)) - death() - blinded = 1 - 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("inaprovaline")) - adjustOxyLoss(1) - Paralyse(3) - - if(paralysis) - AdjustParalysis(-2) - blinded = 1 - stat = UNCONSCIOUS - else if(sleeping) - sleeping = max(sleeping-1, 0) - blinded = 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(sdisabilities & BLIND) //disabled-blind, doesn't get better on its own - blinded = 1 - else if(eye_blind) //blindness, heals slowly over time - eye_blind = max(eye_blind-1,0) - blinded = 1 - else if(eye_blurry) //blurry eyes heal slowly - eye_blurry = max(eye_blurry-1, 0) - - //Ears - if(sdisabilities & DEAF) //disabled-deaf, doesn't get better on its own - ear_deaf = max(ear_deaf, 1) - else if(ear_deaf) //deafness, heals slowly over time - ear_deaf = max(ear_deaf-1, 0) - else if(ear_damage < 25) //ear damage heals slowly under this threshold. - ear_damage = max(ear_damage-0.05, 0) - - //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 - - - proc/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 - see_in_dark = 4 - see_invisible = SEE_INVISIBLE_LEVEL_TWO - 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 - - proc/handle_random_events() +/mob/living/carbon/alien/larva/proc/handle_breath(datum/gas_mixture/breath) + if(status_flags & GODMODE) return + if(!breath || (breath.total_moles() == 0)) + //Aliens breathe in vaccuum + return 0 - proc/handle_stomach() - spawn(0) - for(var/mob/living/M in stomach_contents) - if(M.loc != src) + var/toxins_used = 0 + var/breath_pressure = (breath.total_moles()*R_IDEAL_GAS_EQUATION*breath.temperature)/BREATH_VOLUME + + //Partial pressure of the toxins in our breath + var/Toxins_pp = (breath.toxins/breath.total_moles())*breath_pressure + + if(Toxins_pp) // Detect toxins in air + + adjustToxLoss(breath.toxins*250) + toxins_alert = max(toxins_alert, 1) + + toxins_used = breath.toxins + + else + toxins_alert = 0 + + //Breathe in toxins and out oxygen + breath.toxins -= toxins_used + breath.oxygen += toxins_used + + if(breath.temperature > (T0C+66) && !(COLD_RESISTANCE in mutations)) // Hot air hurts :( + if(prob(20)) + src << "You feel a searing heat in your lungs!" + fire_alert = max(fire_alert, 1) + else + fire_alert = 0 + + //Temporary fixes to the alerts. + + return 1 + + +/mob/living/carbon/alien/larva/proc/handle_chemicals_in_body() + if(reagents) reagents.metabolize(src) + + if(FAT in mutations) + if(nutrition < 100) + if(prob(round((50 - nutrition) / 100))) + src << "You feel fit again!" + mutations.Add(FAT) + else + if(nutrition > 500) + if(prob(5 + round((nutrition - max_grown) / 2))) + src << "You suddenly feel blubbery!" + mutations.Add(FAT) + + if (nutrition > 0) + nutrition-= HUNGER_FACTOR + + 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/larva/proc/handle_regular_status_updates() + updatehealth() + + if(stat == DEAD) //DEAD. BROWN BREAD. SWIMMING WITH THE SPESS CARP + blinded = 1 + silent = 0 + else //ALIVE. LIGHTS ARE ON + if(health < -25 || !getorgan(/obj/item/organ/brain)) + death() + blinded = 1 + 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("inaprovaline")) + adjustOxyLoss(1) + Paralyse(3) + + if(paralysis) + AdjustParalysis(-2) + blinded = 1 + stat = UNCONSCIOUS + else if(sleeping) + sleeping = max(sleeping-1, 0) + blinded = 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(sdisabilities & BLIND) //disabled-blind, doesn't get better on its own + blinded = 1 + else if(eye_blind) //blindness, heals slowly over time + eye_blind = max(eye_blind-1,0) + blinded = 1 + else if(eye_blurry) //blurry eyes heal slowly + eye_blurry = max(eye_blurry-1, 0) + + //Ears + if(sdisabilities & DEAF) //disabled-deaf, doesn't get better on its own + ear_deaf = max(ear_deaf, 1) + else if(ear_deaf) //deafness, heals slowly over time + ear_deaf = max(ear_deaf-1, 0) + else if(ear_damage < 25) //ear damage heals slowly under this threshold. + ear_damage = max(ear_damage-0.05, 0) + + //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/proc/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 + see_in_dark = 4 + see_invisible = SEE_INVISIBLE_LEVEL_TWO + 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 + +/mob/living/carbon/alien/larva/proc/handle_random_events() + return + + +/mob/living/carbon/alien/larva/proc/handle_stomach() + spawn(0) + for(var/mob/living/M in stomach_contents) + if(M.loc != src) + stomach_contents.Remove(M) + continue + if(istype(M, /mob/living/carbon) && stat != 2) + if(M.stat == 2) + M.death(1) stomach_contents.Remove(M) + qdel(M) continue - if(istype(M, /mob/living/carbon) && stat != 2) - if(M.stat == 2) - M.death(1) - stomach_contents.Remove(M) - qdel(M) - continue - if(air_master.current_cycle%3==1) - if(!(M.status_flags & GODMODE)) - M.adjustBruteLoss(5) - nutrition += 10 \ No newline at end of file + if(air_master.current_cycle%3==1) + if(!(M.status_flags & GODMODE)) + M.adjustBruteLoss(5) + nutrition += 10 diff --git a/code/modules/mob/living/carbon/brain/brain.dm b/code/modules/mob/living/carbon/brain/brain.dm index 82498bd1afd..6b5196a25c9 100644 --- a/code/modules/mob/living/carbon/brain/brain.dm +++ b/code/modules/mob/living/carbon/brain/brain.dm @@ -6,43 +6,43 @@ var/emp_damage = 0//Handles a type of MMI damage var/alert = null - New() - create_reagents(1000) - ..() +/mob/living/carbon/brain/New() + create_reagents(1000) + ..() - Destroy() - if(key) //If there is a mob connected to this thing. Have to check key twice to avoid false death reporting. - if(stat!=DEAD) //If not dead. - death(1) //Brains can die again. AND THEY SHOULD AHA HA HA HA HA HA - ghostize() //Ghostize checks for key so nothing else is necessary. - ..() +/mob/living/carbon/brain/Destroy() + if(key) //If there is a mob connected to this thing. Have to check key twice to avoid false death reporting. + if(stat!=DEAD) //If not dead. + death(1) //Brains can die again. AND THEY SHOULD AHA HA HA HA HA HA + ghostize() //Ghostize checks for key so nothing else is necessary. + ..() - say_understands(var/other)//Goddamn is this hackish, but this say code is so odd - if (istype(other, /mob/living/silicon/ai)) - if(!(container && istype(container, /obj/item/device/mmi))) - return 0 - else - return 1 - if (istype(other, /mob/living/silicon/decoy)) - if(!(container && istype(container, /obj/item/device/mmi))) - return 0 - else - return 1 - if (istype(other, /mob/living/silicon/pai)) - if(!(container && istype(container, /obj/item/device/mmi))) - return 0 - else - return 1 - if (istype(other, /mob/living/silicon/robot)) - if(!(container && istype(container, /obj/item/device/mmi))) - return 0 - else - return 1 - if (istype(other, /mob/living/carbon/human)) +/mob/living/carbon/brain/say_understands(var/other)//Goddamn is this hackish, but this say code is so odd + if (istype(other, /mob/living/silicon/ai)) + if(!(container && istype(container, /obj/item/device/mmi))) + return 0 + else return 1 - if (istype(other, /mob/living/carbon/slime)) + if (istype(other, /mob/living/silicon/decoy)) + if(!(container && istype(container, /obj/item/device/mmi))) + return 0 + else return 1 - return ..() + if (istype(other, /mob/living/silicon/pai)) + if(!(container && istype(container, /obj/item/device/mmi))) + return 0 + else + return 1 + if (istype(other, /mob/living/silicon/robot)) + if(!(container && istype(container, /obj/item/device/mmi))) + return 0 + else + return 1 + if (istype(other, /mob/living/carbon/human)) + return 1 + if (istype(other, /mob/living/carbon/slime)) + return 1 + return ..() /mob/living/carbon/brain/update_canmove() diff --git a/code/modules/mob/living/carbon/brain/life.dm b/code/modules/mob/living/carbon/brain/life.dm index a0d54685034..bf96cac0e2a 100644 --- a/code/modules/mob/living/carbon/brain/life.dm +++ b/code/modules/mob/living/carbon/brain/life.dm @@ -32,244 +32,243 @@ handle_regular_hud_updates() -/mob/living/carbon/brain/ - proc/handle_mutations_and_radiation() +/mob/living/carbon/brain/proc/handle_mutations_and_radiation() - if (radiation) - if (radiation > 100) - radiation = 100 - if(!container)//If it's not in an MMI - src << "\red You feel weak." - else//Fluff-wise, since the brain can't detect anything itself, the MMI handles thing like that - src << "\red STATUS: CRITICAL AMOUNTS OF RADIATION DETECTED." + if (radiation) + if (radiation > 100) + radiation = 100 + if(!container)//If it's not in an MMI + src << "\red You feel weak." + else//Fluff-wise, since the brain can't detect anything itself, the MMI handles thing like that + src << "\red STATUS: CRITICAL AMOUNTS OF RADIATION DETECTED." - switch(radiation) - if(1 to 49) - radiation-- - if(prob(25)) - adjustToxLoss(1) - updatehealth() - - if(50 to 74) - radiation -= 2 + switch(radiation) + if(1 to 49) + radiation-- + if(prob(25)) adjustToxLoss(1) - if(prob(5)) - radiation -= 5 - if(!container) - src << "\red You feel weak." - else - src << "\red STATUS: DANGEROUS LEVELS OF RADIATION DETECTED." updatehealth() - if(75 to 100) - radiation -= 3 - adjustToxLoss(3) - updatehealth() + if(50 to 74) + radiation -= 2 + adjustToxLoss(1) + if(prob(5)) + radiation -= 5 + if(!container) + src << "\red You feel weak." + else + src << "\red STATUS: DANGEROUS LEVELS OF RADIATION DETECTED." + updatehealth() + + if(75 to 100) + radiation -= 3 + adjustToxLoss(3) + updatehealth() - proc/handle_environment(datum/gas_mixture/environment) - if(!environment) - return - var/environment_heat_capacity = environment.heat_capacity() - if(istype(get_turf(src), /turf/space)) - var/turf/heat_turf = get_turf(src) - environment_heat_capacity = heat_turf.heat_capacity +/mob/living/carbon/brain/proc/handle_environment(datum/gas_mixture/environment) + if(!environment) + return + var/environment_heat_capacity = environment.heat_capacity() + if(istype(get_turf(src), /turf/space)) + var/turf/heat_turf = get_turf(src) + environment_heat_capacity = heat_turf.heat_capacity - if((environment.temperature > (T0C + 50)) || (environment.temperature < (T0C + 10))) - var/transfer_coefficient = 1 + if((environment.temperature > (T0C + 50)) || (environment.temperature < (T0C + 10))) + var/transfer_coefficient = 1 - handle_temperature_damage(HEAD, environment.temperature, environment_heat_capacity*transfer_coefficient) + handle_temperature_damage(HEAD, environment.temperature, environment_heat_capacity*transfer_coefficient) - if(stat==2) - bodytemperature += 0.1*(environment.temperature - bodytemperature)*environment_heat_capacity/(environment_heat_capacity + 270000) + if(stat==2) + bodytemperature += 0.1*(environment.temperature - bodytemperature)*environment_heat_capacity/(environment_heat_capacity + 270000) - //Account for massive pressure differences + //Account for massive pressure differences - return //TODO: DEFERRED + return //TODO: DEFERRED - proc/handle_temperature_damage(body_part, exposed_temperature, exposed_intensity) - if(status_flags & GODMODE) return +/mob/living/carbon/brain/proc/handle_temperature_damage(body_part, exposed_temperature, exposed_intensity) + if(status_flags & GODMODE) return - 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) + 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) + else + var/discomfort = min( abs(exposed_temperature - bodytemperature)*(exposed_intensity)/2000000, 1.0) + //adjustFireLoss(2.5*discomfort) + adjustFireLoss(5.0*discomfort) - proc/handle_chemicals_in_body() +/mob/living/carbon/brain/proc/handle_chemicals_in_body() - if(reagents) reagents.metabolize(src) + 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) + 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() + updatehealth() - return //TODO: DEFERRED + return //TODO: DEFERRED - proc/handle_regular_status_updates() //TODO: comment out the unused bits >_> - updatehealth() +/mob/living/carbon/brain/proc/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) //DEAD. BROWN BREAD. SWIMMING WITH THE SPESS CARP + blinded = 1 + silent = 0 + else //ALIVE. LIGHTS ARE ON + if( !container && (health < config.health_threshold_dead || ((world.time - timeofhostdeath) > config.revival_brain_life)) ) + death() blinded = 1 silent = 0 - else //ALIVE. LIGHTS ARE ON - if( !container && (health < config.health_threshold_dead || ((world.time - timeofhostdeath) > config.revival_brain_life)) ) - death() - blinded = 1 - silent = 0 - return 1 + return 1 - //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 = 1 - blinded = 1 - ear_deaf = 1 - silent = 1 - if(!alert)//Sounds an alarm, but only once per 'level' - emote("alarm") - src << "\red Major electrical distruption detected: System rebooting." - alert = 1 - if(prob(75)) - emp_damage -= 1 - if(20) - alert = 0 - blinded = 0 - eye_blind = 0 - ear_deaf = 0 - silent = 0 - emp_damage -= 1 - if(11 to 19)//Moderate level of EMP damage, resulting in nearsightedness and ear damage - eye_blurry = 1 - ear_damage = 1 - if(!alert) - emote("alert") - src << "\red Primary systems are now online." - alert = 1 - if(prob(50)) - emp_damage -= 1 - if(10) - alert = 0 - eye_blurry = 0 - ear_damage = 0 - emp_damage -= 1 - if(2 to 9)//Low level of EMP damage, has few effects(handled elsewhere) - if(!alert) - emote("notice") - src << "\red System reboot nearly complete." - alert = 1 - if(prob(25)) - emp_damage -= 1 - if(1) - alert = 0 - src << "\red All systems restored." - emp_damage -= 1 - - //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 - - - proc/handle_regular_hud_updates() - - if (stat == 2 || (XRAY in src.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_TURFS - sight &= ~SEE_MOBS - sight &= ~SEE_OBJS - see_in_dark = 2 - see_invisible = SEE_INVISIBLE_LIVING - if(see_override) - see_invisible = see_override - - 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" + //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 - healths.icon_state = "health7" + 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 = 1 + blinded = 1 + ear_deaf = 1 + silent = 1 + if(!alert)//Sounds an alarm, but only once per 'level' + emote("alarm") + src << "\red Major electrical distruption detected: System rebooting." + alert = 1 + if(prob(75)) + emp_damage -= 1 + if(20) + alert = 0 + blinded = 0 + eye_blind = 0 + ear_deaf = 0 + silent = 0 + emp_damage -= 1 + if(11 to 19)//Moderate level of EMP damage, resulting in nearsightedness and ear damage + eye_blurry = 1 + ear_damage = 1 + if(!alert) + emote("alert") + src << "\red Primary systems are now online." + alert = 1 + if(prob(50)) + emp_damage -= 1 + if(10) + alert = 0 + eye_blurry = 0 + ear_damage = 0 + emp_damage -= 1 + if(2 to 9)//Low level of EMP damage, has few effects(handled elsewhere) + if(!alert) + emote("notice") + src << "\red System reboot nearly complete." + alert = 1 + if(prob(25)) + emp_damage -= 1 + if(1) + alert = 0 + src << "\red All systems restored." + emp_damage -= 1 - if(pullin) pullin.icon_state = "pull[pulling ? 1 : 0]" + //Other + /* commented out because none of these should happen + if(stunned) + AdjustStunned(-1) - client.screen.Remove(global_hud.blurry,global_hud.druggy,global_hud.vimpaired) + if(weakened) + weakened = max(weakened-1,0) - if ((blind && stat != 2)) - if ((blinded)) - blind.layer = 18 - else - blind.layer = 0 + if(stuttering) + stuttering = max(stuttering-1, 0) - if (disabilities & NEARSIGHTED) - client.screen += global_hud.vimpaired + if(silent) + silent = max(silent-1, 0) - if (eye_blurry) - client.screen += global_hud.blurry + if(druggy) + druggy = max(druggy-1, 0) + */ + return 1 - if (druggy) - client.screen += global_hud.druggy +/mob/living/carbon/brain/proc/handle_regular_hud_updates() + + if (stat == 2 || (XRAY in src.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_TURFS + sight &= ~SEE_MOBS + sight &= ~SEE_OBJS + see_in_dark = 2 + see_invisible = SEE_INVISIBLE_LIVING + if(see_override) + see_invisible = see_override + + if (healths) if (stat != 2) - if (machine) - if (!( machine.check_eye(src) )) - reset_view(null) - else - if(!client.adminobs) - reset_view(null) + 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" - return 1 + 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 ((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 /*/mob/living/carbon/brain/emp_act(severity) @@ -283,4 +282,4 @@ emp_damage += rand(10,20) if(3) emp_damage += rand(0,10) - ..()*/ \ No newline at end of file + ..()*/ diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 5af4af3c12c..58d70c745ec 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -124,70 +124,68 @@ return ONE_ATMOSPHERE - pressure_difference -/mob/living/carbon/human - - proc/handle_disabilities() - if (disabilities & EPILEPSY) - if ((prob(1) && paralysis < 1)) - src << "\red You have a seizure!" - for(var/mob/O in viewers(src, null)) - if(O == src) - continue - O.show_message(text("\red [src] starts having a seizure!"), 1) - Paralyse(10) - Jitter(1000) - if (disabilities & COUGHING) - if ((prob(5) && paralysis <= 1)) - drop_item() - emote("cough") - if (disabilities & TOURETTES) - if ((prob(10) && paralysis <= 1)) - Stun(10) - switch(rand(1, 3)) - if(1) - emote("twitch") - if(2 to 3) - say("[prob(50) ? ";" : ""][pick("SHIT", "PISS", "FUCK", "CUNT", "COCKSUCKER", "MOTHERFUCKER", "TITS")]") - var/x_offset = pixel_x + rand(-2,2) //Should probably be moved into the twitch emote at some point. - var/y_offset = pixel_y + rand(-1,1) - animate(src, pixel_x = pixel_x + x_offset, pixel_y = pixel_y + y_offset, time = 1) - animate(pixel_x = pixel_x - x_offset, pixel_y = pixel_y - y_offset, time = 1) - if (disabilities & NERVOUS) - if (prob(10)) - stuttering = max(10, stuttering) - if (getBrainLoss() >= 60 && stat != 2) - if (prob(3)) - switch(pick(1,2,3)) - if(1) - say(pick("IM A PONY NEEEEEEIIIIIIIIIGH", "without oxigen blob don't evoluate?", "CAPTAINS A COMDOM", "[pick("", "that faggot traitor")] [pick("joerge", "george", "gorge", "gdoruge")] [pick("mellens", "melons", "mwrlins")] is grifing me HAL;P!!!", "can u give me [pick("telikesis","halk","eppilapse")]?", "THe saiyans screwed", "Bi is THE BEST OF BOTH WORLDS>", "I WANNA PET TEH monkeyS", "stop grifing me!!!!", "SOTP IT#")) - if(2) - say(pick("FUS RO DAH","fucking 4rries!", "stat me", ">my face", "roll it easy!", "waaaaaagh!!!", "red wonz go fasta", "FOR TEH EMPRAH", "lol2cat", "dem dwarfs man, dem dwarfs", "SPESS MAHREENS", "hwee did eet fhor khayosss", "lifelike texture ;_;", "luv can bloooom", "PACKETS!!!")) - if(3) - emote("drool") +/mob/living/carbon/human/proc/handle_disabilities() + if (disabilities & EPILEPSY) + if ((prob(1) && paralysis < 1)) + src << "\red You have a seizure!" + for(var/mob/O in viewers(src, null)) + if(O == src) + continue + O.show_message(text("\red [src] starts having a seizure!"), 1) + Paralyse(10) + Jitter(1000) + if (disabilities & COUGHING) + if ((prob(5) && paralysis <= 1)) + drop_item() + emote("cough") + if (disabilities & TOURETTES) + if ((prob(10) && paralysis <= 1)) + Stun(10) + switch(rand(1, 3)) + if(1) + emote("twitch") + if(2 to 3) + say("[prob(50) ? ";" : ""][pick("SHIT", "PISS", "FUCK", "CUNT", "COCKSUCKER", "MOTHERFUCKER", "TITS")]") + var/x_offset = pixel_x + rand(-2,2) //Should probably be moved into the twitch emote at some point. + var/y_offset = pixel_y + rand(-1,1) + animate(src, pixel_x = pixel_x + x_offset, pixel_y = pixel_y + y_offset, time = 1) + animate(pixel_x = pixel_x - x_offset, pixel_y = pixel_y - y_offset, time = 1) + if (disabilities & NERVOUS) + if (prob(10)) + stuttering = max(10, stuttering) + if (getBrainLoss() >= 60 && stat != 2) + if (prob(3)) + switch(pick(1,2,3)) + if(1) + say(pick("IM A PONY NEEEEEEIIIIIIIIIGH", "without oxigen blob don't evoluate?", "CAPTAINS A COMDOM", "[pick("", "that faggot traitor")] [pick("joerge", "george", "gorge", "gdoruge")] [pick("mellens", "melons", "mwrlins")] is grifing me HAL;P!!!", "can u give me [pick("telikesis","halk","eppilapse")]?", "THe saiyans screwed", "Bi is THE BEST OF BOTH WORLDS>", "I WANNA PET TEH monkeyS", "stop grifing me!!!!", "SOTP IT#")) + if(2) + say(pick("FUS RO DAH","fucking 4rries!", "stat me", ">my face", "roll it easy!", "waaaaaagh!!!", "red wonz go fasta", "FOR TEH EMPRAH", "lol2cat", "dem dwarfs man, dem dwarfs", "SPESS MAHREENS", "hwee did eet fhor khayosss", "lifelike texture ;_;", "luv can bloooom", "PACKETS!!!")) + if(3) + emote("drool") - proc/handle_mutations_and_radiation() - if(dna) - dna.species.handle_mutations_and_radiation(src) +/mob/living/carbon/human/proc/handle_mutations_and_radiation() + if(dna) + dna.species.handle_mutations_and_radiation(src) - proc/breathe() - if(dna) - dna.species.breathe(src) +/mob/living/carbon/human/proc/breathe() + if(dna) + dna.species.breathe(src) - return + return - proc/get_breath_from_internal(volume_needed) +/mob/living/carbon/human/proc/get_breath_from_internal(volume_needed) + if(internal) + if (!contents.Find(internal)) + internal = null + if (!wear_mask || !(wear_mask.flags & MASKINTERNALS) ) + internal = null if(internal) - if (!contents.Find(internal)) - internal = null - if (!wear_mask || !(wear_mask.flags & MASKINTERNALS) ) - internal = null - if(internal) - return internal.remove_air_volume(volume_needed) - else if(internals) - internals.icon_state = "internal0" - return null + return internal.remove_air_volume(volume_needed) + else if(internals) + internals.icon_state = "internal0" + return null /*proc/handle_breath(datum/gas_mixture/breath) @@ -199,349 +197,357 @@ return 1*/ - proc/handle_environment(datum/gas_mixture/environment) - if(dna) - dna.species.handle_environment(environment, src) +/mob/living/carbon/human/proc/handle_environment(datum/gas_mixture/environment) + if(dna) + dna.species.handle_environment(environment, src) - return + return ///FIRE CODE - handle_fire() - if(dna) - dna.species.handle_fire(src) +/mob/living/carbon/human/handle_fire() + if(dna) + dna.species.handle_fire(src) - if(..()) - return - var/thermal_protection = get_heat_protection(30000) //If you don't have fire suit level protection, you get a temperature increase - if((1 - thermal_protection) > 0.0001) - bodytemperature += BODYTEMP_HEATING_MAX + if(..()) return + var/thermal_protection = get_heat_protection(30000) //If you don't have fire suit level protection, you get a temperature increase + if((1 - thermal_protection) > 0.0001) + bodytemperature += BODYTEMP_HEATING_MAX + return - IgniteMob() - if(dna) - dna.species.IgniteMob(src) - else - ..() +/mob/living/carbon/human/IgniteMob() + if(dna) + dna.species.IgniteMob(src) + else + ..() - ExtinguishMob() - if(dna) - dna.species.ExtinguishMob(src) - else - ..() +/mob/living/carbon/human/ExtinguishMob() + if(dna) + dna.species.ExtinguishMob(src) + else + ..() //END FIRE CODE /* - 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/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 +*/ - proc/stabilize_temperature_from_calories() - switch(bodytemperature) - if(-INFINITY to 260.15) //260.15 is 310.15 - 50, the temperature where you start to feel effects. - if(nutrition >= 2) //If we are very, very cold we'll use up quite a bit of nutriment to heat us up. - nutrition -= 2 - var/body_temperature_difference = 310.15 - bodytemperature - bodytemperature += max((body_temperature_difference / BODYTEMP_AUTORECOVERY_DIVISOR), BODYTEMP_AUTORECOVERY_MINIMUM) - if(260.15 to 360.15) - var/body_temperature_difference = 310.15 - bodytemperature - bodytemperature += body_temperature_difference / BODYTEMP_AUTORECOVERY_DIVISOR - if(360.15 to INFINITY) //360.15 is 310.15 + 50, the temperature where you start to feel effects. - //We totally need a sweat system cause it totally makes sense...~ - var/body_temperature_difference = 310.15 - bodytemperature - bodytemperature += min((body_temperature_difference / BODYTEMP_AUTORECOVERY_DIVISOR), -BODYTEMP_AUTORECOVERY_MINIMUM) //We're dealing with negative numbers +/mob/living/carbon/human/proc/stabilize_temperature_from_calories() + switch(bodytemperature) + if(-INFINITY to 260.15) //260.15 is 310.15 - 50, the temperature where you start to feel effects. + if(nutrition >= 2) //If we are very, very cold we'll use up quite a bit of nutriment to heat us up. + nutrition -= 2 + var/body_temperature_difference = 310.15 - bodytemperature + bodytemperature += max((body_temperature_difference / BODYTEMP_AUTORECOVERY_DIVISOR), BODYTEMP_AUTORECOVERY_MINIMUM) + if(260.15 to 360.15) + var/body_temperature_difference = 310.15 - bodytemperature + bodytemperature += body_temperature_difference / BODYTEMP_AUTORECOVERY_DIVISOR + if(360.15 to INFINITY) //360.15 is 310.15 + 50, the temperature where you start to feel effects. + //We totally need a sweat system cause it totally makes sense...~ + var/body_temperature_difference = 310.15 - bodytemperature + bodytemperature += min((body_temperature_difference / BODYTEMP_AUTORECOVERY_DIVISOR), -BODYTEMP_AUTORECOVERY_MINIMUM) //We're dealing with negative numbers - //This proc returns a number made up of the flags for body parts which you are protected on. (such as HEAD, CHEST, GROIN, etc. See setup.dm for the full list) - proc/get_heat_protection_flags(temperature) //Temperature is the temperature you're being exposed to. - var/thermal_protection_flags = 0 - //Handle normal clothing - if(head) - if(head.max_heat_protection_temperature && head.max_heat_protection_temperature >= temperature) - thermal_protection_flags |= head.heat_protection - if(wear_suit) - if(wear_suit.max_heat_protection_temperature && wear_suit.max_heat_protection_temperature >= temperature) - thermal_protection_flags |= wear_suit.heat_protection - if(w_uniform) - if(w_uniform.max_heat_protection_temperature && w_uniform.max_heat_protection_temperature >= temperature) - thermal_protection_flags |= w_uniform.heat_protection - if(shoes) - if(shoes.max_heat_protection_temperature && shoes.max_heat_protection_temperature >= temperature) - thermal_protection_flags |= shoes.heat_protection - if(gloves) - if(gloves.max_heat_protection_temperature && gloves.max_heat_protection_temperature >= temperature) - thermal_protection_flags |= gloves.heat_protection - if(wear_mask) - if(wear_mask.max_heat_protection_temperature && wear_mask.max_heat_protection_temperature >= temperature) - thermal_protection_flags |= wear_mask.heat_protection +//This proc returns a number made up of the flags for body parts which you are protected on. (such as HEAD, CHEST, GROIN, etc. See setup.dm for the full list) +/mob/living/carbon/human/proc/get_heat_protection_flags(temperature) //Temperature is the temperature you're being exposed to. + var/thermal_protection_flags = 0 + //Handle normal clothing + if(head) + if(head.max_heat_protection_temperature && head.max_heat_protection_temperature >= temperature) + thermal_protection_flags |= head.heat_protection + if(wear_suit) + if(wear_suit.max_heat_protection_temperature && wear_suit.max_heat_protection_temperature >= temperature) + thermal_protection_flags |= wear_suit.heat_protection + if(w_uniform) + if(w_uniform.max_heat_protection_temperature && w_uniform.max_heat_protection_temperature >= temperature) + thermal_protection_flags |= w_uniform.heat_protection + if(shoes) + if(shoes.max_heat_protection_temperature && shoes.max_heat_protection_temperature >= temperature) + thermal_protection_flags |= shoes.heat_protection + if(gloves) + if(gloves.max_heat_protection_temperature && gloves.max_heat_protection_temperature >= temperature) + thermal_protection_flags |= gloves.heat_protection + if(wear_mask) + if(wear_mask.max_heat_protection_temperature && wear_mask.max_heat_protection_temperature >= temperature) + thermal_protection_flags |= wear_mask.heat_protection - return thermal_protection_flags + return thermal_protection_flags - proc/get_heat_protection(temperature) //Temperature is the temperature you're being exposed to. - var/thermal_protection_flags = get_heat_protection_flags(temperature) +/mob/living/carbon/human/proc/get_heat_protection(temperature) //Temperature is the temperature you're being exposed to. + var/thermal_protection_flags = get_heat_protection_flags(temperature) - var/thermal_protection = 0.0 - if(thermal_protection_flags) - if(thermal_protection_flags & HEAD) - thermal_protection += THERMAL_PROTECTION_HEAD - if(thermal_protection_flags & CHEST) - thermal_protection += THERMAL_PROTECTION_CHEST - if(thermal_protection_flags & GROIN) - thermal_protection += THERMAL_PROTECTION_GROIN - if(thermal_protection_flags & LEG_LEFT) - thermal_protection += THERMAL_PROTECTION_LEG_LEFT - if(thermal_protection_flags & LEG_RIGHT) - thermal_protection += THERMAL_PROTECTION_LEG_RIGHT - if(thermal_protection_flags & FOOT_LEFT) - thermal_protection += THERMAL_PROTECTION_FOOT_LEFT - if(thermal_protection_flags & FOOT_RIGHT) - thermal_protection += THERMAL_PROTECTION_FOOT_RIGHT - if(thermal_protection_flags & ARM_LEFT) - thermal_protection += THERMAL_PROTECTION_ARM_LEFT - if(thermal_protection_flags & ARM_RIGHT) - thermal_protection += THERMAL_PROTECTION_ARM_RIGHT - if(thermal_protection_flags & HAND_LEFT) - thermal_protection += THERMAL_PROTECTION_HAND_LEFT - if(thermal_protection_flags & HAND_RIGHT) - thermal_protection += THERMAL_PROTECTION_HAND_RIGHT + var/thermal_protection = 0.0 + if(thermal_protection_flags) + if(thermal_protection_flags & HEAD) + thermal_protection += THERMAL_PROTECTION_HEAD + if(thermal_protection_flags & CHEST) + thermal_protection += THERMAL_PROTECTION_CHEST + if(thermal_protection_flags & GROIN) + thermal_protection += THERMAL_PROTECTION_GROIN + if(thermal_protection_flags & LEG_LEFT) + thermal_protection += THERMAL_PROTECTION_LEG_LEFT + if(thermal_protection_flags & LEG_RIGHT) + thermal_protection += THERMAL_PROTECTION_LEG_RIGHT + if(thermal_protection_flags & FOOT_LEFT) + thermal_protection += THERMAL_PROTECTION_FOOT_LEFT + if(thermal_protection_flags & FOOT_RIGHT) + thermal_protection += THERMAL_PROTECTION_FOOT_RIGHT + if(thermal_protection_flags & ARM_LEFT) + thermal_protection += THERMAL_PROTECTION_ARM_LEFT + if(thermal_protection_flags & ARM_RIGHT) + thermal_protection += THERMAL_PROTECTION_ARM_RIGHT + if(thermal_protection_flags & HAND_LEFT) + thermal_protection += THERMAL_PROTECTION_HAND_LEFT + if(thermal_protection_flags & HAND_RIGHT) + thermal_protection += THERMAL_PROTECTION_HAND_RIGHT - return min(1,thermal_protection) + return min(1,thermal_protection) - //See proc/get_heat_protection_flags(temperature) for the description of this proc. - proc/get_cold_protection_flags(temperature) - var/thermal_protection_flags = 0 - //Handle normal clothing +//See proc/get_heat_protection_flags(temperature) for the description of this proc. +/mob/living/carbon/human/proc/get_cold_protection_flags(temperature) + var/thermal_protection_flags = 0 + //Handle normal clothing - if(head) - if(head.min_cold_protection_temperature && head.min_cold_protection_temperature <= temperature) - thermal_protection_flags |= head.cold_protection - if(wear_suit) - if(wear_suit.min_cold_protection_temperature && wear_suit.min_cold_protection_temperature <= temperature) - thermal_protection_flags |= wear_suit.cold_protection - if(w_uniform) - if(w_uniform.min_cold_protection_temperature && w_uniform.min_cold_protection_temperature <= temperature) - thermal_protection_flags |= w_uniform.cold_protection - if(shoes) - if(shoes.min_cold_protection_temperature && shoes.min_cold_protection_temperature <= temperature) - thermal_protection_flags |= shoes.cold_protection - if(gloves) - if(gloves.min_cold_protection_temperature && gloves.min_cold_protection_temperature <= temperature) - thermal_protection_flags |= gloves.cold_protection - if(wear_mask) - if(wear_mask.min_cold_protection_temperature && wear_mask.min_cold_protection_temperature <= temperature) - thermal_protection_flags |= wear_mask.cold_protection + if(head) + if(head.min_cold_protection_temperature && head.min_cold_protection_temperature <= temperature) + thermal_protection_flags |= head.cold_protection + if(wear_suit) + if(wear_suit.min_cold_protection_temperature && wear_suit.min_cold_protection_temperature <= temperature) + thermal_protection_flags |= wear_suit.cold_protection + if(w_uniform) + if(w_uniform.min_cold_protection_temperature && w_uniform.min_cold_protection_temperature <= temperature) + thermal_protection_flags |= w_uniform.cold_protection + if(shoes) + if(shoes.min_cold_protection_temperature && shoes.min_cold_protection_temperature <= temperature) + thermal_protection_flags |= shoes.cold_protection + if(gloves) + if(gloves.min_cold_protection_temperature && gloves.min_cold_protection_temperature <= temperature) + thermal_protection_flags |= gloves.cold_protection + if(wear_mask) + if(wear_mask.min_cold_protection_temperature && wear_mask.min_cold_protection_temperature <= temperature) + thermal_protection_flags |= wear_mask.cold_protection - return thermal_protection_flags + return thermal_protection_flags - proc/get_cold_protection(temperature) +/mob/living/carbon/human/proc/get_cold_protection(temperature) - if(COLD_RESISTANCE in mutations) - return 1 //Fully protected from the cold. + if(COLD_RESISTANCE in mutations) + return 1 //Fully protected from the cold. - if(dna && COLDRES in dna.species.specflags) - return 1 + if(dna && COLDRES in dna.species.specflags) + return 1 - temperature = max(temperature, 2.7) //There is an occasional bug where the temperature is miscalculated in ares with a small amount of gas on them, so this is necessary to ensure that that bug does not affect this calculation. Space's temperature is 2.7K and most suits that are intended to protect against any cold, protect down to 2.0K. - var/thermal_protection_flags = get_cold_protection_flags(temperature) + temperature = max(temperature, 2.7) //There is an occasional bug where the temperature is miscalculated in ares with a small amount of gas on them, so this is necessary to ensure that that bug does not affect this calculation. Space's temperature is 2.7K and most suits that are intended to protect against any cold, protect down to 2.0K. + var/thermal_protection_flags = get_cold_protection_flags(temperature) - var/thermal_protection = 0.0 - if(thermal_protection_flags) - if(thermal_protection_flags & HEAD) - thermal_protection += THERMAL_PROTECTION_HEAD - if(thermal_protection_flags & CHEST) - thermal_protection += THERMAL_PROTECTION_CHEST - if(thermal_protection_flags & GROIN) - thermal_protection += THERMAL_PROTECTION_GROIN - if(thermal_protection_flags & LEG_LEFT) - thermal_protection += THERMAL_PROTECTION_LEG_LEFT - if(thermal_protection_flags & LEG_RIGHT) - thermal_protection += THERMAL_PROTECTION_LEG_RIGHT - if(thermal_protection_flags & FOOT_LEFT) - thermal_protection += THERMAL_PROTECTION_FOOT_LEFT - if(thermal_protection_flags & FOOT_RIGHT) - thermal_protection += THERMAL_PROTECTION_FOOT_RIGHT - if(thermal_protection_flags & ARM_LEFT) - thermal_protection += THERMAL_PROTECTION_ARM_LEFT - if(thermal_protection_flags & ARM_RIGHT) - thermal_protection += THERMAL_PROTECTION_ARM_RIGHT - if(thermal_protection_flags & HAND_LEFT) - thermal_protection += THERMAL_PROTECTION_HAND_LEFT - if(thermal_protection_flags & HAND_RIGHT) - thermal_protection += THERMAL_PROTECTION_HAND_RIGHT + var/thermal_protection = 0.0 + if(thermal_protection_flags) + if(thermal_protection_flags & HEAD) + thermal_protection += THERMAL_PROTECTION_HEAD + if(thermal_protection_flags & CHEST) + thermal_protection += THERMAL_PROTECTION_CHEST + if(thermal_protection_flags & GROIN) + thermal_protection += THERMAL_PROTECTION_GROIN + if(thermal_protection_flags & LEG_LEFT) + thermal_protection += THERMAL_PROTECTION_LEG_LEFT + if(thermal_protection_flags & LEG_RIGHT) + thermal_protection += THERMAL_PROTECTION_LEG_RIGHT + if(thermal_protection_flags & FOOT_LEFT) + thermal_protection += THERMAL_PROTECTION_FOOT_LEFT + if(thermal_protection_flags & FOOT_RIGHT) + thermal_protection += THERMAL_PROTECTION_FOOT_RIGHT + if(thermal_protection_flags & ARM_LEFT) + thermal_protection += THERMAL_PROTECTION_ARM_LEFT + if(thermal_protection_flags & ARM_RIGHT) + thermal_protection += THERMAL_PROTECTION_ARM_RIGHT + if(thermal_protection_flags & HAND_LEFT) + thermal_protection += THERMAL_PROTECTION_HAND_LEFT + if(thermal_protection_flags & HAND_RIGHT) + thermal_protection += THERMAL_PROTECTION_HAND_RIGHT - return min(1,thermal_protection) + return min(1,thermal_protection) - /* - 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) +/* +/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 + return fire_prot - 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) +/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(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]" + 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") - */ + 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") +*/ - proc/handle_chemicals_in_body() - if(dna) - dna.species.handle_chemicals_in_body(src) +/mob/living/carbon/human/proc/handle_chemicals_in_body() + if(dna) + dna.species.handle_chemicals_in_body(src) - return //TODO: DEFERRED + return //TODO: DEFERRED - proc/handle_regular_status_updates() - if(stat == DEAD) //DEAD. BROWN BREAD. SWIMMING WITH THE SPESS CARP +/mob/living/carbon/human/proc/handle_regular_status_updates() + if(stat == DEAD) //DEAD. BROWN BREAD. SWIMMING WITH THE SPESS CARP + blinded = 1 + silent = 0 + else //ALIVE. LIGHTS ARE ON + updatehealth() //TODO + if(health <= config.health_threshold_dead || !getorgan(/obj/item/organ/brain)) + death() blinded = 1 silent = 0 - else //ALIVE. LIGHTS ARE ON - updatehealth() //TODO - if(health <= config.health_threshold_dead || !getorgan(/obj/item/organ/brain)) - death() - blinded = 1 - silent = 0 - return 1 + return 1 - //UNCONSCIOUS. NO-ONE IS HOME - if( (getOxyLoss() > 50) || (config.health_threshold_crit >= health) ) - Paralyse(3) + //UNCONSCIOUS. NO-ONE IS HOME + if( (getOxyLoss() > 50) || (config.health_threshold_crit >= health) ) + Paralyse(3) - /* Done by handle_breath() - if( health <= 20 && prob(1) ) - spawn(0) - emote("gasp") - if(!reagents.has_reagent("inaprovaline")) - adjustOxyLoss(1)*/ + /* Done by handle_breath() + if( health <= 20 && prob(1) ) + spawn(0) + emote("gasp") + if(!reagents.has_reagent("inaprovaline")) + adjustOxyLoss(1)*/ - if(hallucination) - if(hallucination >= 20) - if(prob(3)) - fake_attack(src) - if(!handling_hal) - spawn handle_hallucinations() //The not boring kind! - - if(hallucination<=2) - hallucination = 0 - else - hallucination -= 2 + if(hallucination) + if(hallucination >= 20) + if(prob(3)) + fake_attack(src) + if(!handling_hal) + spawn handle_hallucinations() //The not boring kind! + if(hallucination<=2) + hallucination = 0 else - for(var/atom/a in hallucinations) - qdel(a) + hallucination -= 2 - if(paralysis) - AdjustParalysis(-1) - blinded = 1 - stat = UNCONSCIOUS - else if(sleeping) - handle_dreams() - adjustStaminaLoss(-10) - sleeping = max(sleeping-1, 0) - blinded = 1 - stat = UNCONSCIOUS - if( prob(10) && health && !hal_crit ) - spawn(0) - emote("snore") - //CONSCIOUS - else - stat = CONSCIOUS + else + for(var/atom/a in hallucinations) + qdel(a) - //Eyes - if(sdisabilities & BLIND) //disabled-blind, doesn't get better on its own - blinded = 1 - else if(eye_blind) //blindness, heals slowly over time - eye_blind = max(eye_blind-1,0) - blinded = 1 - else if(tinttotal >= TINT_BLIND) //covering your eyes heals blurry eyes faster - eye_blurry = max(eye_blurry-3, 0) - // blinded = 1 //now handled under /handle_regular_hud_updates() - else if(eye_blurry) //blurry eyes heal slowly - eye_blurry = max(eye_blurry-1, 0) + if(paralysis) + AdjustParalysis(-1) + blinded = 1 + stat = UNCONSCIOUS + else if(sleeping) + handle_dreams() + adjustStaminaLoss(-10) + sleeping = max(sleeping-1, 0) + blinded = 1 + stat = UNCONSCIOUS + if( prob(10) && health && !hal_crit ) + spawn(0) + emote("snore") + //CONSCIOUS + else + stat = CONSCIOUS - //Ears - if(sdisabilities & DEAF) //disabled-deaf, doesn't get better on its own - ear_deaf = max(ear_deaf, 1) - else if(istype(ears, /obj/item/clothing/ears/earmuffs)) //resting your ears with earmuffs heals ear damage faster, and slowly heals deafness - ear_damage = max(ear_damage-0.15, 0) - ear_deaf = max(ear_deaf-1, 1) - else if(ear_deaf) //deafness, heals slowly over time - ear_deaf = max(ear_deaf-1, 0) - else if(ear_damage < 25) //ear damage heals slowly under this threshold. otherwise you'll need earmuffs - ear_damage = max(ear_damage-0.05, 0) + //Eyes + if(sdisabilities & BLIND) //disabled-blind, doesn't get better on its own + blinded = 1 + else if(eye_blind) //blindness, heals slowly over time + eye_blind = max(eye_blind-1,0) + blinded = 1 + else if(tinttotal >= TINT_BLIND) //covering your eyes heals blurry eyes faster + eye_blurry = max(eye_blurry-3, 0) + // blinded = 1 //now handled under /handle_regular_hud_updates() + else if(eye_blurry) //blurry eyes heal slowly + eye_blurry = max(eye_blurry-1, 0) - //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) + //Ears + if(sdisabilities & DEAF) //disabled-deaf, doesn't get better on its own + ear_deaf = max(ear_deaf, 1) + else if(istype(ears, /obj/item/clothing/ears/earmuffs)) //resting your ears with earmuffs heals ear damage faster, and slowly heals deafness + ear_damage = max(ear_damage-0.15, 0) + ear_deaf = max(ear_deaf-1, 1) + else if(ear_deaf) //deafness, heals slowly over time + ear_deaf = max(ear_deaf-1, 0) + else if(ear_damage < 25) //ear damage heals slowly under this threshold. otherwise you'll need earmuffs + ear_damage = max(ear_damage-0.05, 0) + + //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 @@ -549,189 +555,181 @@ 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 + sleep(3) + if(C) + C.pixel_x -= pixel_x_diff + C.pixel_y -= pixel_y_diff + src = oldsrc - //Jitteryness - if(jitteriness) - var/amplitude = min(4, (jitteriness/100) + 1) - var/pixel_x_diff = rand(-amplitude, amplitude) - var/pixel_y_diff = rand(-amplitude/3, amplitude/3) + //Jitteryness + if(jitteriness) + var/amplitude = min(4, (jitteriness/100) + 1) + var/pixel_x_diff = rand(-amplitude, amplitude) + var/pixel_y_diff = rand(-amplitude/3, amplitude/3) - animate(src, pixel_x = pixel_x + pixel_x_diff, pixel_y = pixel_y + pixel_y_diff , time = 2, loop = 6) - animate(pixel_x = pixel_x - pixel_x_diff, pixel_y = pixel_y - pixel_y_diff, time = 2) - jitteriness = max(jitteriness-1, 0) + animate(src, pixel_x = pixel_x + pixel_x_diff, pixel_y = pixel_y + pixel_y_diff , time = 2, loop = 6) + animate(pixel_x = pixel_x - pixel_x_diff, pixel_y = pixel_y - pixel_y_diff, time = 2) + jitteriness = max(jitteriness-1, 0) - //Other - if(stunned) - AdjustStunned(-1) + //Other + if(stunned) + AdjustStunned(-1) - if(weakened) - weakened = max(weakened-1,0) + if(weakened) + weakened = max(weakened-1,0) - if(stuttering) - stuttering = max(stuttering-1, 0) + if(stuttering) + stuttering = max(stuttering-1, 0) - if(silent) - silent = max(silent-1, 0) + if(silent) + silent = max(silent-1, 0) - if(druggy) - druggy = max(druggy-1, 0) + if(druggy) + druggy = max(druggy-1, 0) - CheckStamina() + CheckStamina() - return 1 + return 1 - proc/handle_regular_hud_updates() - if(!client) return 0 +/mob/living/carbon/human/proc/handle_regular_hud_updates() + if(!client) return 0 - for(var/image/hud in client.images) - if(copytext(hud.icon_state,1,4) == "hud") //ugly, but icon comparison is worse, I believe - client.images.Remove(hud) + for(var/image/hud in client.images) + if(copytext(hud.icon_state,1,4) == "hud") //ugly, but icon comparison is worse, I believe + client.images.Remove(hud) - client.screen.Remove(global_hud.blurry, global_hud.druggy, global_hud.vimpaired, global_hud.darkMask) + client.screen.Remove(global_hud.blurry, global_hud.druggy, global_hud.vimpaired, global_hud.darkMask) - update_action_buttons() + update_action_buttons() - if(damageoverlay.overlays) - damageoverlay.overlays = list() + 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 + 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 - //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 + if(!client.adminobs) reset_view(null) - //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(dna) + dna.species.handle_vision(src) + dna.species.handle_hud_icons(src) - if(machine) - if(!machine.check_eye(src)) reset_view(null) - else - if(!client.adminobs) reset_view(null) + return 1 - if(dna) - dna.species.handle_vision(src) - dna.species.handle_hud_icons(src) +/mob/living/carbon/human/proc/handle_random_events() + // Puke if toxloss is too high + if(!stat) + if (getToxLoss() >= 45 && nutrition > 20) + lastpuke ++ + if(lastpuke >= 25) // about 25 second delay I guess + Stun(5) - return 1 + for(var/mob/O in viewers(world.view, src)) + O.show_message(text("\red [] throws up!", src), 1) + playsound(loc, 'sound/effects/splat.ogg', 50, 1) - proc/handle_random_events() - // Puke if toxloss is too high - if(!stat) - if (getToxLoss() >= 45 && nutrition > 20) - lastpuke ++ - if(lastpuke >= 25) // about 25 second delay I guess - Stun(5) + var/turf/location = loc + if (istype(location, /turf/simulated)) + location.add_vomit_floor(src, 1) - for(var/mob/O in viewers(world.view, src)) - O.show_message(text("\red [] throws up!", src), 1) - playsound(loc, 'sound/effects/splat.ogg', 50, 1) + nutrition -= 20 + adjustToxLoss(-3) - var/turf/location = loc - if (istype(location, /turf/simulated)) - location.add_vomit_floor(src, 1) + // make it so you can only puke so fast + lastpuke = 0 - nutrition -= 20 - adjustToxLoss(-3) - - // make it so you can only puke so fast - lastpuke = 0 - - proc/handle_stomach() - spawn(0) - for(var/mob/living/M in stomach_contents) - if(M.loc != src) +/mob/living/carbon/human/proc/handle_stomach() + spawn(0) + for(var/mob/living/M in stomach_contents) + if(M.loc != src) + stomach_contents.Remove(M) + continue + if(istype(M, /mob/living/carbon) && stat != 2) + if(M.stat == 2) + M.death(1) stomach_contents.Remove(M) + qdel(M) continue - if(istype(M, /mob/living/carbon) && stat != 2) - if(M.stat == 2) - M.death(1) - stomach_contents.Remove(M) - qdel(M) - continue - if(air_master.current_cycle%3==1) - if(!(M.status_flags & GODMODE)) - M.adjustBruteLoss(5) - nutrition += 10 + if(air_master.current_cycle%3==1) + if(!(M.status_flags & GODMODE)) + M.adjustBruteLoss(5) + nutrition += 10 - proc/handle_changeling() - if(mind && mind.changeling) - mind.changeling.regenerate() +/mob/living/carbon/human/proc/handle_changeling() + if(mind && mind.changeling) + mind.changeling.regenerate() #undef HUMAN_MAX_OXYLOSS #undef HUMAN_CRIT_MAX_OXYLOSS diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index ee4865b6ca4..40ef5dc682e 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -67,1241 +67,1241 @@ // PROCS // /////////// - proc/update_base_icon_state(var/mob/living/carbon/human/H) - if(HUSK in H.mutations) - H.remove_overlay(SPECIES_LAYER) // races lose their color - return "husk" - else if(sexes) - if(use_skintones) - return "[H.skin_tone]_[(H.gender == FEMALE) ? "f" : "m"]" - else - return "[id]_[(H.gender == FEMALE) ? "f" : "m"]" +/datum/species/proc/update_base_icon_state(var/mob/living/carbon/human/H) + if(HUSK in H.mutations) + H.remove_overlay(SPECIES_LAYER) // races lose their color + return "husk" + else if(sexes) + if(use_skintones) + return "[H.skin_tone]_[(H.gender == FEMALE) ? "f" : "m"]" else - return "[id]" + return "[id]_[(H.gender == FEMALE) ? "f" : "m"]" + else + return "[id]" - proc/update_color(var/mob/living/carbon/human/H) - H.remove_overlay(SPECIES_LAYER) +/datum/species/proc/update_color(var/mob/living/carbon/human/H) + H.remove_overlay(SPECIES_LAYER) - var/image/standing + var/image/standing - var/g = (H.gender == FEMALE) ? "f" : "m" + var/g = (H.gender == FEMALE) ? "f" : "m" - if(MUTCOLORS in specflags) - var/image/spec_base - if(sexes) - spec_base = image("icon" = 'icons/mob/human.dmi', "icon_state" = "[id]_[g]_s", "layer" = -SPECIES_LAYER) + if(MUTCOLORS in specflags) + var/image/spec_base + if(sexes) + spec_base = image("icon" = 'icons/mob/human.dmi', "icon_state" = "[id]_[g]_s", "layer" = -SPECIES_LAYER) + else + spec_base = image("icon" = 'icons/mob/human.dmi', "icon_state" = "[id]_s", "layer" = -SPECIES_LAYER) + if(!config.mutant_colors) + H.dna.mutant_color = default_color + spec_base.color = "#[H.dna.mutant_color]" + standing = spec_base + + if(standing) + H.overlays_standing[SPECIES_LAYER] = standing + + H.apply_overlay(SPECIES_LAYER) + +/datum/species/proc/handle_hair(var/mob/living/carbon/human/H) + H.remove_overlay(HAIR_LAYER) + + var/datum/sprite_accessory/S + var/list/standing = list() + + if(H.facial_hair_style && FACEHAIR in specflags) + S = facial_hair_styles_list[H.facial_hair_style] + if(S) + var/image/img_facial_s + + img_facial_s = image("icon" = S.icon, "icon_state" = "[S.icon_state]_s", "layer" = -HAIR_LAYER) + + if(hair_color) + if(hair_color == "mutcolor") + if(!config.mutant_colors) + img_facial_s.color = "#" + default_color + else + img_facial_s.color = "#" + H.dna.mutant_color + else + img_facial_s.color = "#" + hair_color else - spec_base = image("icon" = 'icons/mob/human.dmi', "icon_state" = "[id]_s", "layer" = -SPECIES_LAYER) - if(!config.mutant_colors) - H.dna.mutant_color = default_color - spec_base.color = "#[H.dna.mutant_color]" - standing = spec_base + img_facial_s.color = "#" + H.facial_hair_color + img_facial_s.alpha = hair_alpha - if(standing) - H.overlays_standing[SPECIES_LAYER] = standing + standing += img_facial_s - H.apply_overlay(SPECIES_LAYER) + //Applies the debrained overlay if there is no brain + if(!H.getorgan(/obj/item/organ/brain)) + standing += image("icon"='icons/mob/human_face.dmi', "icon_state" = "debrained_s", "layer" = -HAIR_LAYER) - proc/handle_hair(var/mob/living/carbon/human/H) - H.remove_overlay(HAIR_LAYER) + else if(H.hair_style && HAIR in specflags) + S = hair_styles_list[H.hair_style] + if(S) + var/image/img_hair_s = image("icon" = S.icon, "icon_state" = "[S.icon_state]_s", "layer" = -HAIR_LAYER) - var/datum/sprite_accessory/S - var/list/standing = list() + img_hair_s = image("icon" = S.icon, "icon_state" = "[S.icon_state]_s", "layer" = -HAIR_LAYER) - if(H.facial_hair_style && FACEHAIR in specflags) - S = facial_hair_styles_list[H.facial_hair_style] - if(S) - var/image/img_facial_s - - img_facial_s = image("icon" = S.icon, "icon_state" = "[S.icon_state]_s", "layer" = -HAIR_LAYER) - - if(hair_color) - if(hair_color == "mutcolor") - if(!config.mutant_colors) - img_facial_s.color = "#" + default_color - else - img_facial_s.color = "#" + H.dna.mutant_color + if(hair_color) + if(hair_color == "mutcolor") + if(!config.mutant_colors) + img_hair_s.color = "#" + default_color else - img_facial_s.color = "#" + hair_color + img_hair_s.color = "#" + H.dna.mutant_color else - img_facial_s.color = "#" + H.facial_hair_color - img_facial_s.alpha = hair_alpha + img_hair_s.color = "#" + hair_color + else + img_hair_s.color = "#" + H.hair_color + img_hair_s.alpha = hair_alpha - standing += img_facial_s + standing += img_hair_s - //Applies the debrained overlay if there is no brain - if(!H.getorgan(/obj/item/organ/brain)) - standing += image("icon"='icons/mob/human_face.dmi', "icon_state" = "debrained_s", "layer" = -HAIR_LAYER) + if(standing.len) + H.overlays_standing[HAIR_LAYER] = standing - else if(H.hair_style && HAIR in specflags) - S = hair_styles_list[H.hair_style] - if(S) - var/image/img_hair_s = image("icon" = S.icon, "icon_state" = "[S.icon_state]_s", "layer" = -HAIR_LAYER) + H.apply_overlay(HAIR_LAYER) - img_hair_s = image("icon" = S.icon, "icon_state" = "[S.icon_state]_s", "layer" = -HAIR_LAYER) + return - if(hair_color) - if(hair_color == "mutcolor") - if(!config.mutant_colors) - img_hair_s.color = "#" + default_color - else - img_hair_s.color = "#" + H.dna.mutant_color - else - img_hair_s.color = "#" + hair_color - else - img_hair_s.color = "#" + H.hair_color - img_hair_s.alpha = hair_alpha +/datum/species/proc/handle_body(var/mob/living/carbon/human/H) + H.remove_overlay(BODY_LAYER) - standing += img_hair_s + var/list/standing = list() - if(standing.len) - H.overlays_standing[HAIR_LAYER] = standing + // lipstick + if(H.lip_style && LIPS in specflags) + standing += image("icon"='icons/mob/human_face.dmi', "icon_state"="lips_[H.lip_style]_s", "layer" = -BODY_LAYER) - H.apply_overlay(HAIR_LAYER) + // eyes + if(EYECOLOR in specflags) + var/image/img_eyes_s = image("icon" = 'icons/mob/human_face.dmi', "icon_state" = "[eyes]_s", "layer" = -BODY_LAYER) + img_eyes_s.color = "#" + H.eye_color + standing += img_eyes_s - return + //Underwear + if(H.underwear) + var/datum/sprite_accessory/underwear/U = underwear_all[H.underwear] + if(U) + standing += image("icon"=U.icon, "icon_state"="[U.icon_state]_s", "layer"=-BODY_LAYER) - proc/handle_body(var/mob/living/carbon/human/H) - H.remove_overlay(BODY_LAYER) + if(standing.len) + H.overlays_standing[BODY_LAYER] = standing - var/list/standing = list() + H.apply_overlay(BODY_LAYER) - // lipstick - if(H.lip_style && LIPS in specflags) - standing += image("icon"='icons/mob/human_face.dmi', "icon_state"="lips_[H.lip_style]_s", "layer" = -BODY_LAYER) + return - // eyes - if(EYECOLOR in specflags) - var/image/img_eyes_s = image("icon" = 'icons/mob/human_face.dmi', "icon_state" = "[eyes]_s", "layer" = -BODY_LAYER) - img_eyes_s.color = "#" + H.eye_color - standing += img_eyes_s +/datum/species/proc/spec_life(var/mob/living/carbon/human/H) + return - //Underwear - if(H.underwear) - var/datum/sprite_accessory/underwear/U = underwear_all[H.underwear] - if(U) - standing += image("icon"=U.icon, "icon_state"="[U.icon_state]_s", "layer"=-BODY_LAYER) +/datum/species/proc/spec_death(var/gibbed, var/mob/living/carbon/human/H) + return - if(standing.len) - H.overlays_standing[BODY_LAYER] = standing +/datum/species/proc/auto_equip(var/mob/living/carbon/human/H) + // handles the equipping of species-specific gear + return - H.apply_overlay(BODY_LAYER) +/datum/species/proc/can_equip(var/obj/item/I, var/slot, var/disable_warning, var/mob/living/carbon/human/H) + if(slot in no_equip) + if(!(type in I.species_exception)) + return 0 - return - - proc/spec_life(var/mob/living/carbon/human/H) - return - - proc/spec_death(var/gibbed, var/mob/living/carbon/human/H) - return - - proc/auto_equip(var/mob/living/carbon/human/H) - // handles the equipping of species-specific gear - return - - proc/can_equip(var/obj/item/I, var/slot, var/disable_warning, var/mob/living/carbon/human/H) - if(slot in no_equip) - if(!(type in I.species_exception)) + switch(slot) + if(slot_l_hand) + if(H.l_hand) return 0 - - switch(slot) - if(slot_l_hand) - if(H.l_hand) - return 0 + return 1 + if(slot_r_hand) + if(H.r_hand) + return 0 + return 1 + if(slot_wear_mask) + if(H.wear_mask) + return 0 + if( !(I.slot_flags & SLOT_MASK) ) + return 0 + return 1 + if(slot_back) + if(H.back) + return 0 + if( !(I.slot_flags & SLOT_BACK) ) + return 0 + return 1 + if(slot_wear_suit) + if(H.wear_suit) + return 0 + if( !(I.slot_flags & SLOT_OCLOTHING) ) + return 0 + return 1 + if(slot_gloves) + if(H.gloves) + return 0 + if( !(I.slot_flags & SLOT_GLOVES) ) + return 0 + return 1 + if(slot_shoes) + if(H.shoes) + return 0 + if( !(I.slot_flags & SLOT_FEET) ) + return 0 + return 1 + if(slot_belt) + if(H.belt) + return 0 + if(!H.w_uniform && !nojumpsuit) + if(!disable_warning) + H << "You need a jumpsuit before you can attach this [I.name]." + return 0 + if( !(I.slot_flags & SLOT_BELT) ) + return + return 1 + if(slot_glasses) + if(H.glasses) + return 0 + if( !(I.slot_flags & SLOT_EYES) ) + return 0 + return 1 + if(slot_head) + if(H.head) + return 0 + if( !(I.slot_flags & SLOT_HEAD) ) + return 0 + return 1 + if(slot_ears) + if(H.ears) + return 0 + if( !(I.slot_flags & SLOT_EARS) ) + return 0 + return 1 + if(slot_w_uniform) + if(H.w_uniform) + return 0 + if( !(I.slot_flags & SLOT_ICLOTHING) ) + return 0 + return 1 + if(slot_wear_id) + if(H.wear_id) + return 0 + if(!H.w_uniform && !nojumpsuit) + if(!disable_warning) + H << "You need a jumpsuit before you can attach this [I.name]." + return 0 + if( !(I.slot_flags & SLOT_ID) ) + return 0 + return 1 + if(slot_l_store) + if(I.flags & NODROP) //Pockets aren't visible, so you can't move NODROP items into them. + return 0 + if(H.l_store) + return 0 + if(!H.w_uniform && !nojumpsuit) + if(!disable_warning) + H << "You need a jumpsuit before you can attach this [I.name]." + return 0 + if(I.slot_flags & SLOT_DENYPOCKET) + return + if( I.w_class <= 2 || (I.slot_flags & SLOT_POCKET) ) return 1 - if(slot_r_hand) - if(H.r_hand) - return 0 + if(slot_r_store) + if(I.flags & NODROP) + return 0 + if(H.r_store) + return 0 + if(!H.w_uniform && !nojumpsuit) + if(!disable_warning) + H << "You need a jumpsuit before you can attach this [I.name]." + return 0 + if(I.slot_flags & SLOT_DENYPOCKET) + return 0 + if( I.w_class <= 2 || (I.slot_flags & SLOT_POCKET) ) return 1 - if(slot_wear_mask) - if(H.wear_mask) - return 0 - if( !(I.slot_flags & SLOT_MASK) ) - return 0 + return 0 + if(slot_s_store) + if(I.flags & NODROP) + return 0 + if(H.s_store) + return 0 + if(!H.wear_suit) + if(!disable_warning) + H << "You need a suit before you can attach this [I.name]." + return 0 + if(!H.wear_suit.allowed) + if(!disable_warning) + H << "You somehow have a suit with no defined allowed items for suit storage, stop that." + return 0 + if(I.w_class > 4) + if(!disable_warning) + H << "The [I.name] is too big to attach." //should be src? + return 0 + if( istype(I, /obj/item/device/pda) || istype(I, /obj/item/weapon/pen) || is_type_in_list(I, H.wear_suit.allowed) ) return 1 - if(slot_back) - if(H.back) - return 0 - if( !(I.slot_flags & SLOT_BACK) ) - return 0 - return 1 - if(slot_wear_suit) - if(H.wear_suit) - return 0 - if( !(I.slot_flags & SLOT_OCLOTHING) ) - return 0 - return 1 - if(slot_gloves) - if(H.gloves) - return 0 - if( !(I.slot_flags & SLOT_GLOVES) ) - return 0 - return 1 - if(slot_shoes) - if(H.shoes) - return 0 - if( !(I.slot_flags & SLOT_FEET) ) - return 0 - return 1 - if(slot_belt) - if(H.belt) - return 0 - if(!H.w_uniform && !nojumpsuit) - if(!disable_warning) - H << "You need a jumpsuit before you can attach this [I.name]." - return 0 - if( !(I.slot_flags & SLOT_BELT) ) - return - return 1 - if(slot_glasses) - if(H.glasses) - return 0 - if( !(I.slot_flags & SLOT_EYES) ) - return 0 - return 1 - if(slot_head) - if(H.head) - return 0 - if( !(I.slot_flags & SLOT_HEAD) ) - return 0 - return 1 - if(slot_ears) - if(H.ears) - return 0 - if( !(I.slot_flags & SLOT_EARS) ) - return 0 - return 1 - if(slot_w_uniform) - if(H.w_uniform) - return 0 - if( !(I.slot_flags & SLOT_ICLOTHING) ) - return 0 - return 1 - if(slot_wear_id) - if(H.wear_id) - return 0 - if(!H.w_uniform && !nojumpsuit) - if(!disable_warning) - H << "You need a jumpsuit before you can attach this [I.name]." - return 0 - if( !(I.slot_flags & SLOT_ID) ) - return 0 - return 1 - if(slot_l_store) - if(I.flags & NODROP) //Pockets aren't visible, so you can't move NODROP items into them. - return 0 - if(H.l_store) - return 0 - if(!H.w_uniform && !nojumpsuit) - if(!disable_warning) - H << "You need a jumpsuit before you can attach this [I.name]." - return 0 - if(I.slot_flags & SLOT_DENYPOCKET) - return - if( I.w_class <= 2 || (I.slot_flags & SLOT_POCKET) ) + return 0 + if(slot_handcuffed) + if(H.handcuffed) + return 0 + if(!istype(I, /obj/item/weapon/handcuffs)) + return 0 + return 1 + if(slot_legcuffed) + if(H.legcuffed) + return 0 + if(!istype(I, /obj/item/weapon/legcuffs)) + return 0 + return 1 + if(slot_in_backpack) + if (H.back && istype(H.back, /obj/item/weapon/storage/backpack)) + var/obj/item/weapon/storage/backpack/B = H.back + if(B.contents.len < B.storage_slots && I.w_class <= B.max_w_class) return 1 - if(slot_r_store) - if(I.flags & NODROP) - return 0 - if(H.r_store) - return 0 - if(!H.w_uniform && !nojumpsuit) - if(!disable_warning) - H << "You need a jumpsuit before you can attach this [I.name]." - return 0 - if(I.slot_flags & SLOT_DENYPOCKET) - return 0 - if( I.w_class <= 2 || (I.slot_flags & SLOT_POCKET) ) - return 1 - return 0 - if(slot_s_store) - if(I.flags & NODROP) - return 0 - if(H.s_store) - return 0 - if(!H.wear_suit) - if(!disable_warning) - H << "You need a suit before you can attach this [I.name]." - return 0 - if(!H.wear_suit.allowed) - if(!disable_warning) - H << "You somehow have a suit with no defined allowed items for suit storage, stop that." - return 0 - if(I.w_class > 4) - if(!disable_warning) - H << "The [I.name] is too big to attach." //should be src? - return 0 - if( istype(I, /obj/item/device/pda) || istype(I, /obj/item/weapon/pen) || is_type_in_list(I, H.wear_suit.allowed) ) - return 1 - return 0 - if(slot_handcuffed) - if(H.handcuffed) - return 0 - if(!istype(I, /obj/item/weapon/handcuffs)) - return 0 - return 1 - if(slot_legcuffed) - if(H.legcuffed) - return 0 - if(!istype(I, /obj/item/weapon/legcuffs)) - return 0 - return 1 - if(slot_in_backpack) - if (H.back && istype(H.back, /obj/item/weapon/storage/backpack)) - var/obj/item/weapon/storage/backpack/B = H.back - if(B.contents.len < B.storage_slots && I.w_class <= B.max_w_class) - return 1 - return 0 - return 0 //Unsupported slot + return 0 + return 0 //Unsupported slot - proc/before_equip_job(var/datum/job/J, var/mob/living/carbon/human/H) - return +/datum/species/proc/before_equip_job(var/datum/job/J, var/mob/living/carbon/human/H) + return - proc/after_equip_job(var/datum/job/J, var/mob/living/carbon/human/H) - return +/datum/species/proc/after_equip_job(var/datum/job/J, var/mob/living/carbon/human/H) + return - proc/handle_chemicals(var/datum/reagent/chem, var/mob/living/carbon/human/H) - return 0 +/datum/species/proc/handle_chemicals(var/datum/reagent/chem, var/mob/living/carbon/human/H) + return 0 - proc/handle_speech(var/message, var/mob/living/carbon/human/H) - return message +/datum/species/proc/handle_speech(var/message, var/mob/living/carbon/human/H) + return message - //////// +//////// //LIFE// //////// - proc/handle_chemicals_in_body(var/mob/living/carbon/human/H) - if(H.reagents) H.reagents.metabolize(H) +/datum/species/proc/handle_chemicals_in_body(var/mob/living/carbon/human/H) + if(H.reagents) H.reagents.metabolize(H) - //The fucking FAT mutation is the dumbest shit ever. It makes the code so difficult to work with - if(FAT in H.mutations) - if(H.overeatduration < 100) - H << "You feel fit again!" - H.mutations -= FAT - H.update_inv_w_uniform(0) - H.update_inv_wear_suit() - else - if(H.overeatduration > 500) - H << "You suddenly feel blubbery!" - H.mutations |= FAT - H.update_inv_w_uniform(0) - H.update_inv_wear_suit() + //The fucking FAT mutation is the dumbest shit ever. It makes the code so difficult to work with + if(FAT in H.mutations) + if(H.overeatduration < 100) + H << "You feel fit again!" + H.mutations -= FAT + H.update_inv_w_uniform(0) + H.update_inv_wear_suit() + else + if(H.overeatduration > 500) + H << "You suddenly feel blubbery!" + H.mutations |= FAT + H.update_inv_w_uniform(0) + H.update_inv_wear_suit() - // nutrition decrease - if (H.nutrition > 0 && H.stat != 2) - H.nutrition = max (0, H.nutrition - HUNGER_FACTOR) + // nutrition decrease + if (H.nutrition > 0 && H.stat != 2) + H.nutrition = max (0, H.nutrition - HUNGER_FACTOR) - if (H.nutrition > 450) - if(H.overeatduration < 600) //capped so people don't take forever to unfat - H.overeatduration++ - else - if(H.overeatduration > 1) - H.overeatduration -= 2 //doubled the unfat rate + if (H.nutrition > 450) + if(H.overeatduration < 600) //capped so people don't take forever to unfat + H.overeatduration++ + else + if(H.overeatduration > 1) + H.overeatduration -= 2 //doubled the unfat rate - if (H.drowsyness) - H.drowsyness-- - H.eye_blurry = max(2, H.eye_blurry) - if (prob(5)) - H.sleeping += 1 - H.Paralyse(5) + if (H.drowsyness) + H.drowsyness-- + H.eye_blurry = max(2, H.eye_blurry) + if (prob(5)) + H.sleeping += 1 + H.Paralyse(5) - H.confused = max(0, H.confused - 1) - // decrement dizziness counter, clamped to 0 - if(H.resting) - H.dizziness = max(0, H.dizziness - 15) - H.jitteriness = max(0, H.jitteriness - 15) - else - H.dizziness = max(0, H.dizziness - 3) - H.jitteriness = max(0, H.jitteriness - 3) + H.confused = max(0, H.confused - 1) + // decrement dizziness counter, clamped to 0 + if(H.resting) + H.dizziness = max(0, H.dizziness - 15) + H.jitteriness = max(0, H.jitteriness - 15) + else + H.dizziness = max(0, H.dizziness - 3) + H.jitteriness = max(0, H.jitteriness - 3) - H.updatehealth() + H.updatehealth() - return + return - proc/handle_vision(var/mob/living/carbon/human/H) - if( H.stat == DEAD ) - H.sight |= (SEE_TURFS|SEE_MOBS|SEE_OBJS) +/datum/species/proc/handle_vision(var/mob/living/carbon/human/H) + 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) + var/see_temp = H.see_invisible + H.see_invisible = invis_sight + H.see_in_dark = darksight + + if(XRAY in H.mutations) + H.sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS H.see_in_dark = 8 - if(!H.druggy) H.see_invisible = SEE_INVISIBLE_LEVEL_TWO + H.see_invisible = SEE_INVISIBLE_LEVEL_TWO + + if(H.seer) + H.see_invisible = SEE_INVISIBLE_OBSERVER + + if(H.mind && H.mind.changeling) + H.hud_used.lingchemdisplay.invisibility = 0 + H.hud_used.lingchemdisplay.maptext = "
[H.mind.changeling.chem_charges]
" else - H.sight &= ~(SEE_TURFS|SEE_MOBS|SEE_OBJS) - var/see_temp = H.see_invisible - H.see_invisible = invis_sight - H.see_in_dark = darksight + H.hud_used.lingchemdisplay.invisibility = 101 - if(XRAY in H.mutations) - H.sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS - H.see_in_dark = 8 - H.see_invisible = SEE_INVISIBLE_LEVEL_TWO + if(istype(H.wear_mask, /obj/item/clothing/mask/gas/voice/space_ninja)) + var/obj/item/clothing/mask/gas/voice/space_ninja/O = H.wear_mask + switch(O.mode) + if(0) + var/target_list[] = list() + for(var/mob/living/target in oview(H)) + if( target.mind&&(target.mind.special_role||issilicon(target)) )//They need to have a mind. + target_list += target + if(target_list.len)//Everything else is handled by the ninja mask proc. + O.assess_targets(target_list, H) + H.see_invisible = SEE_INVISIBLE_LIVING + if(1) + H.see_in_dark = 5 + H.see_invisible = SEE_INVISIBLE_LIVING + if(2) + H.sight |= SEE_MOBS + H.see_invisible = SEE_INVISIBLE_LEVEL_TWO + if(3) + H.sight |= SEE_TURFS + H.see_invisible = SEE_INVISIBLE_LIVING - if(H.seer) - H.see_invisible = SEE_INVISIBLE_OBSERVER + if(H.glasses) + if(istype(H.glasses, /obj/item/clothing/glasses)) + var/obj/item/clothing/glasses/G = H.glasses + H.sight |= G.vision_flags + H.see_in_dark = G.darkness_view + H.see_invisible = G.invis_view + if(G.hud) + G.process_hud(H) - if(H.mind && H.mind.changeling) - H.hud_used.lingchemdisplay.invisibility = 0 - H.hud_used.lingchemdisplay.maptext = "
[H.mind.changeling.chem_charges]
" - else - H.hud_used.lingchemdisplay.invisibility = 101 + if(H.druggy) //Override for druggy + H.see_invisible = see_temp - if(istype(H.wear_mask, /obj/item/clothing/mask/gas/voice/space_ninja)) - var/obj/item/clothing/mask/gas/voice/space_ninja/O = H.wear_mask - switch(O.mode) - if(0) - var/target_list[] = list() - for(var/mob/living/target in oview(H)) - if( target.mind&&(target.mind.special_role||issilicon(target)) )//They need to have a mind. - target_list += target - if(target_list.len)//Everything else is handled by the ninja mask proc. - O.assess_targets(target_list, H) - H.see_invisible = SEE_INVISIBLE_LIVING - if(1) - H.see_in_dark = 5 - H.see_invisible = SEE_INVISIBLE_LIVING - if(2) - H.sight |= SEE_MOBS - H.see_invisible = SEE_INVISIBLE_LEVEL_TWO - if(3) - H.sight |= SEE_TURFS - H.see_invisible = SEE_INVISIBLE_LIVING + if(H.see_override) //Override all + H.see_invisible = H.see_override - if(H.glasses) - if(istype(H.glasses, /obj/item/clothing/glasses)) - var/obj/item/clothing/glasses/G = H.glasses - H.sight |= G.vision_flags - H.see_in_dark = G.darkness_view - H.see_invisible = G.invis_view - if(G.hud) - G.process_hud(H) + // 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.blinded = 1 // You get the sudden urge to learn to play keyboard + H.client.screen += global_hud.darkMask + else + H.client.screen += global_hud.darkMask - if(H.druggy) //Override for druggy - H.see_invisible = see_temp + if(H.blind) + if(H.blinded) H.blind.layer = 18 + else H.blind.layer = 0 - if(H.see_override) //Override all - H.see_invisible = H.see_override - - // 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.blinded = 1 // You get the sudden urge to learn to play keyboard - H.client.screen += global_hud.darkMask - else - H.client.screen += global_hud.darkMask - - if(H.blind) - if(H.blinded) H.blind.layer = 18 - else H.blind.layer = 0 - - if( H.disabilities & NEARSIGHTED && !istype(H.glasses, /obj/item/clothing/glasses/regular) ) - H.client.screen += global_hud.vimpaired - if(H.eye_blurry) H.client.screen += global_hud.blurry - if(H.druggy) H.client.screen += global_hud.druggy + if( H.disabilities & NEARSIGHTED && !istype(H.glasses, /obj/item/clothing/glasses/regular) ) + H.client.screen += global_hud.vimpaired + if(H.eye_blurry) H.client.screen += global_hud.blurry + if(H.druggy) H.client.screen += global_hud.druggy - if(H.eye_stat > 20) - if(H.eye_stat > 30) H.client.screen += global_hud.darkMask - else H.client.screen += global_hud.vimpaired + if(H.eye_stat > 20) + if(H.eye_stat > 30) H.client.screen += global_hud.darkMask + else H.client.screen += global_hud.vimpaired - return 1 + return 1 - proc/handle_hud_icons(var/mob/living/carbon/human/H) - if(H.healths) - if(H.stat == DEAD) - H.healths.icon_state = "health7" - else - switch(H.hal_screwyhud) - if(1) H.healths.icon_state = "health6" - if(2) H.healths.icon_state = "health7" - else - switch(H.health - H.staminaloss) - if(100 to INFINITY) H.healths.icon_state = "health0" - if(80 to 100) H.healths.icon_state = "health1" - if(60 to 80) H.healths.icon_state = "health2" - if(40 to 60) H.healths.icon_state = "health3" - if(20 to 40) H.healths.icon_state = "health4" - if(0 to 20) H.healths.icon_state = "health5" - else H.healths.icon_state = "health6" +/datum/species/proc/handle_hud_icons(var/mob/living/carbon/human/H) + if(H.healths) + if(H.stat == DEAD) + H.healths.icon_state = "health7" + else + switch(H.hal_screwyhud) + if(1) H.healths.icon_state = "health6" + if(2) H.healths.icon_state = "health7" + else + switch(H.health - H.staminaloss) + if(100 to INFINITY) H.healths.icon_state = "health0" + if(80 to 100) H.healths.icon_state = "health1" + if(60 to 80) H.healths.icon_state = "health2" + if(40 to 60) H.healths.icon_state = "health3" + if(20 to 40) H.healths.icon_state = "health4" + if(0 to 20) H.healths.icon_state = "health5" + else H.healths.icon_state = "health6" - if(H.nutrition_icon) - switch(H.nutrition) - if(450 to INFINITY) H.nutrition_icon.icon_state = "nutrition0" - if(350 to 450) H.nutrition_icon.icon_state = "nutrition1" - if(250 to 350) H.nutrition_icon.icon_state = "nutrition2" - if(150 to 250) H.nutrition_icon.icon_state = "nutrition3" - else H.nutrition_icon.icon_state = "nutrition4" + if(H.nutrition_icon) + switch(H.nutrition) + if(450 to INFINITY) H.nutrition_icon.icon_state = "nutrition0" + if(350 to 450) H.nutrition_icon.icon_state = "nutrition1" + if(250 to 350) H.nutrition_icon.icon_state = "nutrition2" + if(150 to 250) H.nutrition_icon.icon_state = "nutrition3" + else H.nutrition_icon.icon_state = "nutrition4" - if(H.pressure) - H.pressure.icon_state = "pressure[H.pressure_alert]" + if(H.pressure) + H.pressure.icon_state = "pressure[H.pressure_alert]" - if(H.pullin) - if(H.pulling) H.pullin.icon_state = "pull" - else H.pullin.icon_state = "pull0" + if(H.pullin) + if(H.pulling) H.pullin.icon_state = "pull" + else H.pullin.icon_state = "pull0" // if(rest) //Not used with new UI // if(resting || lying || sleeping) rest.icon_state = "rest1" // else rest.icon_state = "rest0" - if(H.toxin) - if(H.hal_screwyhud == 4 || H.toxins_alert) H.toxin.icon_state = "tox1" - else H.toxin.icon_state = "tox0" - if(H.oxygen) - if(H.hal_screwyhud == 3 || H.oxygen_alert) H.oxygen.icon_state = "oxy1" - else H.oxygen.icon_state = "oxy0" - if(H.fire) - if(H.fire_alert) H.fire.icon_state = "fire[H.fire_alert]" //fire_alert is either 0 if no alert, 1 for cold and 2 for heat. - else H.fire.icon_state = "fire0" + if(H.toxin) + if(H.hal_screwyhud == 4 || H.toxins_alert) H.toxin.icon_state = "tox1" + else H.toxin.icon_state = "tox0" + if(H.oxygen) + if(H.hal_screwyhud == 3 || H.oxygen_alert) H.oxygen.icon_state = "oxy1" + else H.oxygen.icon_state = "oxy0" + if(H.fire) + if(H.fire_alert) H.fire.icon_state = "fire[H.fire_alert]" //fire_alert is either 0 if no alert, 1 for cold and 2 for heat. + else H.fire.icon_state = "fire0" - if(H.bodytemp) - if(!(HEATRES in specflags)) - switch(H.bodytemperature) //310.055 optimal body temp - if(370 to INFINITY) H.bodytemp.icon_state = "temp4" - if(350 to 370) H.bodytemp.icon_state = "temp3" - if(335 to 350) H.bodytemp.icon_state = "temp2" + if(H.bodytemp) + if(!(HEATRES in specflags)) + switch(H.bodytemperature) //310.055 optimal body temp + if(370 to INFINITY) H.bodytemp.icon_state = "temp4" + if(350 to 370) H.bodytemp.icon_state = "temp3" + if(335 to 350) H.bodytemp.icon_state = "temp2" + switch(H.bodytemperature) + if(320 to 335) H.bodytemp.icon_state = "temp1" + if(300 to 320) H.bodytemp.icon_state = "temp0" + if(295 to 300) H.bodytemp.icon_state = "temp-1" + if(!(COLDRES in specflags)) switch(H.bodytemperature) - if(320 to 335) H.bodytemp.icon_state = "temp1" - if(300 to 320) H.bodytemp.icon_state = "temp0" - if(295 to 300) H.bodytemp.icon_state = "temp-1" - if(!(COLDRES in specflags)) - switch(H.bodytemperature) - if(280 to 295) H.bodytemp.icon_state = "temp-2" - if(260 to 280) H.bodytemp.icon_state = "temp-3" - if(-INFINITY to 260) H.bodytemp.icon_state = "temp-4" + if(280 to 295) H.bodytemp.icon_state = "temp-2" + if(260 to 280) H.bodytemp.icon_state = "temp-3" + if(-INFINITY to 260) H.bodytemp.icon_state = "temp-4" - return 1 + return 1 - proc/handle_mutations_and_radiation(var/mob/living/carbon/human/H) - if(H.getFireLoss()) - if((COLD_RESISTANCE in H.mutations) || (prob(1))) - H.heal_organ_damage(0,1) +/datum/species/proc/handle_mutations_and_radiation(var/mob/living/carbon/human/H) + if(H.getFireLoss()) + if((COLD_RESISTANCE in H.mutations) || (prob(1))) + H.heal_organ_damage(0,1) - if ((HULK in H.mutations) && H.health <= 25) - H.mutations.Remove(HULK) - H.update_mutations() //update our mutation overlays - H << "You suddenly feel very weak." - H.Weaken(3) + if ((HULK in H.mutations) && H.health <= 25) + H.mutations.Remove(HULK) + H.update_mutations() //update our mutation overlays + H << "You suddenly feel very weak." + H.Weaken(3) + H.emote("collapse") + + if (H.radiation && !(RADIMMUNE in specflags)) + if (H.radiation > 100) + H.radiation = 100 + H.Weaken(10) + H << "You feel weak." H.emote("collapse") - if (H.radiation && !(RADIMMUNE in specflags)) - if (H.radiation > 100) - H.radiation = 100 - H.Weaken(10) - H << "You feel weak." - H.emote("collapse") + if (H.radiation < 0) + H.radiation = 0 - if (H.radiation < 0) - H.radiation = 0 - - else - switch(H.radiation) - if(1 to 49) - H.radiation-- - if(prob(25)) - H.adjustToxLoss(1) - H.updatehealth() - - if(50 to 74) - H.radiation -= 2 + else + switch(H.radiation) + if(1 to 49) + H.radiation-- + if(prob(25)) H.adjustToxLoss(1) - if(prob(5)) - H.radiation -= 5 - H.Weaken(3) - H << "You feel weak." - H.emote("collapse") - if(prob(15)) - if(!( H.hair_style == "Shaved") || !(H.hair_style == "Bald") || HAIR in specflags) - H << "Your hair starts to fall out in clumps..." - spawn(50) - H.facial_hair_style = "Shaved" - H.hair_style = "Bald" - H.update_hair() H.updatehealth() - if(75 to 100) - H.radiation -= 3 - H.adjustToxLoss(3) - if(prob(1)) - H << "You mutate!" - randmutb(H) - domutcheck(H,null) - H.emote("gasp") - H.updatehealth() + if(50 to 74) + H.radiation -= 2 + H.adjustToxLoss(1) + if(prob(5)) + H.radiation -= 5 + H.Weaken(3) + H << "You feel weak." + H.emote("collapse") + if(prob(15)) + if(!( H.hair_style == "Shaved") || !(H.hair_style == "Bald") || HAIR in specflags) + H << "Your hair starts to fall out in clumps..." + spawn(50) + H.facial_hair_style = "Shaved" + H.hair_style = "Bald" + H.update_hair() + H.updatehealth() - //////////////// - // MOVE SPEED // - //////////////// + if(75 to 100) + H.radiation -= 3 + H.adjustToxLoss(3) + if(prob(1)) + H << "You mutate!" + randmutb(H) + domutcheck(H,null) + H.emote("gasp") + H.updatehealth() - proc/movement_delay(var/mob/living/carbon/human/H) - var/mspeed = 0 +//////////////// +// MOVE SPEED // +//////////////// - if(!has_gravity(H)) - return -1 //It's hard to be slowed down in space by... anything - else if(H.status_flags & GOTTAGOFAST) - return -1 +/datum/species/proc/movement_delay(var/mob/living/carbon/human/H) + var/mspeed = 0 - mspeed = 0 - var/health_deficiency = (100 - H.health + H.staminaloss) - if(health_deficiency >= 40) - mspeed += (health_deficiency / 25) + if(!has_gravity(H)) + return -1 //It's hard to be slowed down in space by... anything + else if(H.status_flags & GOTTAGOFAST) + return -1 - var/hungry = (500 - H.nutrition) / 5 //So overeat would be 100 and default level would be 80 - if(hungry >= 70) - mspeed += hungry / 50 + mspeed = 0 + var/health_deficiency = (100 - H.health + H.staminaloss) + if(health_deficiency >= 40) + mspeed += (health_deficiency / 25) - if(H.wear_suit) - mspeed += H.wear_suit.slowdown - if(H.shoes) - mspeed += H.shoes.slowdown - if(H.back) - mspeed += H.back.slowdown + var/hungry = (500 - H.nutrition) / 5 //So overeat would be 100 and default level would be 80 + if(hungry >= 70) + mspeed += hungry / 50 - if(FAT in H.mutations) - mspeed += 1.5 - if(H.bodytemperature < 283.222) - mspeed += (283.222 - H.bodytemperature) / 10 * 1.75 + if(H.wear_suit) + mspeed += H.wear_suit.slowdown + if(H.shoes) + mspeed += H.shoes.slowdown + if(H.back) + mspeed += H.back.slowdown - mspeed += speedmod + if(FAT in H.mutations) + mspeed += 1.5 + if(H.bodytemperature < 283.222) + mspeed += (283.222 - H.bodytemperature) / 10 * 1.75 - return mspeed + mspeed += speedmod - ////////////////// - // ATTACK PROCS // - ////////////////// + return mspeed - proc/spec_attack_hand(var/mob/living/carbon/human/M, var/mob/living/carbon/human/H) - if((M != H) && H.check_shields(0, M.name)) - add_logs(M, H, "attempted to touch") - H.visible_message("[M] attempted to touch [H]!") - return 0 +////////////////// +// ATTACK PROCS // +////////////////// - switch(M.a_intent) - if("help") - if(H.health >= 0) - H.help_shake_act(M) - if(H != M) - add_logs(M, H, "shaked") - return 1 +/datum/species/proc/spec_attack_hand(var/mob/living/carbon/human/M, var/mob/living/carbon/human/H) + if((M != H) && H.check_shields(0, M.name)) + add_logs(M, H, "attempted to touch") + H.visible_message("[M] attempted to touch [H]!") + return 0 - //CPR - if((M.head && (M.head.flags & HEADCOVERSMOUTH)) || (M.wear_mask && (M.wear_mask.flags & MASKCOVERSMOUTH))) - M << "Remove your mask!" - return 0 - if((H.head && (H.head.flags & HEADCOVERSMOUTH)) || (H.wear_mask && (H.wear_mask.flags & MASKCOVERSMOUTH))) - M << "Remove their mask!" - return 0 - - if(H.cpr_time < world.time + 30) - add_logs(H, M, "CPRed") - H.visible_message("[M] is trying to perform CPR on [H]!") - if(!do_mob(M, H)) - return 0 - if((H.health >= -99 && H.health <= 0)) - H.cpr_time = world.time - var/suff = min(H.getOxyLoss(), 7) - H.adjustOxyLoss(-suff) - H.updatehealth() - M.visible_message("[M] performs CPR on [H]!") - H << "You feel a breath of fresh air enter your lungs. It feels good." - - if("grab") - if(M == H || H.anchored) - return 0 - - add_logs(M, H, "grabbed", addition="passively") - - if(H.w_uniform) - H.w_uniform.add_fingerprint(M) - - var/obj/item/weapon/grab/G = new /obj/item/weapon/grab(M, H) - if(H.buckled) - M << "You cannot grab [H], \he is buckled in!" - if(!G) //the grab will delete itself in New if affecting is anchored - return - M.put_in_active_hand(G) - G.synch() - H.LAssailant = M - - playsound(H.loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) - H.visible_message("[M] has grabbed [H] passively!") + switch(M.a_intent) + if("help") + if(H.health >= 0) + H.help_shake_act(M) + if(H != M) + add_logs(M, H, "shaked") return 1 - if("harm") - add_logs(M, H, "punched") + //CPR + if((M.head && (M.head.flags & HEADCOVERSMOUTH)) || (M.wear_mask && (M.wear_mask.flags & MASKCOVERSMOUTH))) + M << "Remove your mask!" + return 0 + if((H.head && (H.head.flags & HEADCOVERSMOUTH)) || (H.wear_mask && (H.wear_mask.flags & MASKCOVERSMOUTH))) + M << "Remove their mask!" + return 0 - var/atk_verb = "punch" - if(H.lying) - atk_verb = "kick" - else if(M.dna) - atk_verb = M.dna.species.attack_verb - - var/damage = rand(0, 9) - damage += punchmod - - if(!damage) - if(M.dna) - playsound(H.loc, M.dna.species.miss_sound, 25, 1, -1) - else - playsound(H.loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1) - - H.visible_message("[M] has attempted to [atk_verb] [H]!") + if(H.cpr_time < world.time + 30) + add_logs(H, M, "CPRed") + H.visible_message("[M] is trying to perform CPR on [H]!") + if(!do_mob(M, H)) return 0 + if((H.health >= -99 && H.health <= 0)) + H.cpr_time = world.time + var/suff = min(H.getOxyLoss(), 7) + H.adjustOxyLoss(-suff) + H.updatehealth() + M.visible_message("[M] performs CPR on [H]!") + H << "You feel a breath of fresh air enter your lungs. It feels good." + if("grab") + if(M == H || H.anchored) + return 0 - var/obj/item/organ/limb/affecting = H.get_organ(ran_zone(M.zone_sel.selecting)) - var/armor_block = H.run_armor_check(affecting, "melee") + add_logs(M, H, "grabbed", addition="passively") - if(HULK in M.mutations) - damage += 5 + if(H.w_uniform) + H.w_uniform.add_fingerprint(M) + var/obj/item/weapon/grab/G = new /obj/item/weapon/grab(M, H) + if(H.buckled) + M << "You cannot grab [H], \he is buckled in!" + if(!G) //the grab will delete itself in New if affecting is anchored + return + M.put_in_active_hand(G) + G.synch() + H.LAssailant = M + + playsound(H.loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) + H.visible_message("[M] has grabbed [H] passively!") + return 1 + + if("harm") + add_logs(M, H, "punched") + + var/atk_verb = "punch" + if(H.lying) + atk_verb = "kick" + else if(M.dna) + atk_verb = M.dna.species.attack_verb + + var/damage = rand(0, 9) + damage += punchmod + + if(!damage) if(M.dna) - playsound(H.loc, M.dna.species.attack_sound, 25, 1, -1) + playsound(H.loc, M.dna.species.miss_sound, 25, 1, -1) else - playsound(H.loc, 'sound/weapons/punch1.ogg', 25, 1, -1) + playsound(H.loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1) + + H.visible_message("[M] has attempted to [atk_verb] [H]!") + return 0 - H.visible_message("[M] has [atk_verb]ed [H]!", \ - "[M] has [atk_verb]ed [H]!") + var/obj/item/organ/limb/affecting = H.get_organ(ran_zone(M.zone_sel.selecting)) + var/armor_block = H.run_armor_check(affecting, "melee") - H.apply_damage(damage, BRUTE, affecting, armor_block) - if((H.stat != DEAD) && damage >= 9) - H.visible_message("[M] has weakened [H]!", \ - "[M] has weakened [H]!") - H.apply_effect(4, WEAKEN, armor_block) - H.forcesay(hit_appends) - else if(H.lying) - H.forcesay(hit_appends) + if(HULK in M.mutations) + damage += 5 - if("disarm") - add_logs(M, H, "disarmed") + if(M.dna) + playsound(H.loc, M.dna.species.attack_sound, 25, 1, -1) + else + playsound(H.loc, 'sound/weapons/punch1.ogg', 25, 1, -1) - if(H.w_uniform) - H.w_uniform.add_fingerprint(M) - var/obj/item/organ/limb/affecting = H.get_organ(ran_zone(M.zone_sel.selecting)) - var/randn = rand(1, 100) - if(randn <= 25) - H.apply_effect(2, WEAKEN, H.run_armor_check(affecting, "melee")) - playsound(H, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) - H.visible_message("[M] has pushed [H]!", - "[M] has pushed [H]!") - H.forcesay(hit_appends) - return - var/talked = 0 // BubbleWrap + H.visible_message("[M] has [atk_verb]ed [H]!", \ + "[M] has [atk_verb]ed [H]!") - if(randn <= 60) - //BubbleWrap: Disarming breaks a pull - if(H.pulling) - H.visible_message("[M] has broken [H]'s grip on [H.pulling]!") + H.apply_damage(damage, BRUTE, affecting, armor_block) + if((H.stat != DEAD) && damage >= 9) + H.visible_message("[M] has weakened [H]!", \ + "[M] has weakened [H]!") + H.apply_effect(4, WEAKEN, armor_block) + H.forcesay(hit_appends) + else if(H.lying) + H.forcesay(hit_appends) + + if("disarm") + add_logs(M, H, "disarmed") + + if(H.w_uniform) + H.w_uniform.add_fingerprint(M) + var/obj/item/organ/limb/affecting = H.get_organ(ran_zone(M.zone_sel.selecting)) + var/randn = rand(1, 100) + if(randn <= 25) + H.apply_effect(2, WEAKEN, H.run_armor_check(affecting, "melee")) + playsound(H, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) + H.visible_message("[M] has pushed [H]!", + "[M] has pushed [H]!") + H.forcesay(hit_appends) + return + + var/talked = 0 // BubbleWrap + + if(randn <= 60) + //BubbleWrap: Disarming breaks a pull + if(H.pulling) + H.visible_message("[M] has broken [H]'s grip on [H.pulling]!") + talked = 1 + H.stop_pulling() + + //BubbleWrap: Disarming also breaks a grab - this will also stop someone being choked, won't it? + if(istype(H.l_hand, /obj/item/weapon/grab)) + var/obj/item/weapon/grab/lgrab = H.l_hand + if(lgrab.affecting) + H.visible_message("[M] has broken [H]'s grip on [lgrab.affecting]!") talked = 1 - H.stop_pulling() + spawn(1) + qdel(lgrab) + if(istype(H.r_hand, /obj/item/weapon/grab)) + var/obj/item/weapon/grab/rgrab = H.r_hand + if(rgrab.affecting) + H.visible_message("[M] has broken [H]'s grip on [rgrab.affecting]!") + talked = 1 + spawn(1) + qdel(rgrab) + //End BubbleWrap - //BubbleWrap: Disarming also breaks a grab - this will also stop someone being choked, won't it? - if(istype(H.l_hand, /obj/item/weapon/grab)) - var/obj/item/weapon/grab/lgrab = H.l_hand - if(lgrab.affecting) - H.visible_message("[M] has broken [H]'s grip on [lgrab.affecting]!") - talked = 1 - spawn(1) - qdel(lgrab) - if(istype(H.r_hand, /obj/item/weapon/grab)) - var/obj/item/weapon/grab/rgrab = H.r_hand - if(rgrab.affecting) - H.visible_message("[M] has broken [H]'s grip on [rgrab.affecting]!") - talked = 1 - spawn(1) - qdel(rgrab) - //End BubbleWrap - - if(!talked) //BubbleWrap - if(H.drop_item()) - H.visible_message("[M] has disarmed [H]!", \ - "[M] has disarmed [H]!") - playsound(H, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) - return + if(!talked) //BubbleWrap + if(H.drop_item()) + H.visible_message("[M] has disarmed [H]!", \ + "[M] has disarmed [H]!") + playsound(H, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) + return - playsound(H, 'sound/weapons/punchmiss.ogg', 25, 1, -1) - H.visible_message("[M] attempted to disarm [H]!", \ - "[M] attemped to disarm [H]!") - return + playsound(H, 'sound/weapons/punchmiss.ogg', 25, 1, -1) + H.visible_message("[M] attempted to disarm [H]!", \ + "[M] attemped to disarm [H]!") + return - proc/spec_attacked_by(var/obj/item/I, var/mob/living/user, var/def_zone, var/obj/item/organ/limb/affecting, var/hit_area, var/intent, var/obj/item/organ/limb/target_limb, target_area, var/mob/living/carbon/human/H) - // Allows you to put in item-specific reactions based on species - if((user != H) && H.check_shields(I.force, "the [I.name]")) - return 0 +/datum/species/proc/spec_attacked_by(var/obj/item/I, var/mob/living/user, var/def_zone, var/obj/item/organ/limb/affecting, var/hit_area, var/intent, var/obj/item/organ/limb/target_limb, target_area, var/mob/living/carbon/human/H) + // Allows you to put in item-specific reactions based on species + if((user != H) && H.check_shields(I.force, "the [I.name]")) + return 0 - if(I.attack_verb && I.attack_verb.len) - H.visible_message("[H] has been [pick(I.attack_verb)] in the [hit_area] with [I] by [user]!", \ - "[H] has been [pick(I.attack_verb)] in the [hit_area] with [I] by [user]!") - else if(I.force) - H.visible_message("[H] has been attacked in the [hit_area] with [I] by [user]!", \ - "[H] has been attacked in the [hit_area] with [I] by [user]!") - else - return 0 + if(I.attack_verb && I.attack_verb.len) + H.visible_message("[H] has been [pick(I.attack_verb)] in the [hit_area] with [I] by [user]!", \ + "[H] has been [pick(I.attack_verb)] in the [hit_area] with [I] by [user]!") + else if(I.force) + H.visible_message("[H] has been attacked in the [hit_area] with [I] by [user]!", \ + "[H] has been attacked in the [hit_area] with [I] by [user]!") + else + return 0 - var/armor = H.run_armor_check(affecting, "melee", "Your armor has protected your [hit_area].", "Your armor has softened a hit to your [hit_area].") - if(armor >= 100) return 0 - var/Iforce = I.force //to avoid runtimes on the forcesay checks at the bottom. Some items might delete themselves if you drop them. (stunning yourself, ninja swords) + var/armor = H.run_armor_check(affecting, "melee", "Your armor has protected your [hit_area].", "Your armor has softened a hit to your [hit_area].") + if(armor >= 100) return 0 + var/Iforce = I.force //to avoid runtimes on the forcesay checks at the bottom. Some items might delete themselves if you drop them. (stunning yourself, ninja swords) - apply_damage(I.force, I.damtype, affecting, armor, H) + apply_damage(I.force, I.damtype, affecting, armor, H) - var/bloody = 0 - if(((I.damtype == BRUTE) && prob(25 + (I.force * 2)))) - if(affecting.status == ORGAN_ORGANIC) - I.add_blood(H) //Make the weapon bloody, not the person. - if(prob(I.force * 2)) //blood spatter! - bloody = 1 - var/turf/location = H.loc - if(istype(location, /turf/simulated)) - location.add_blood(H) - if(get_dist(H, H) <= 1) //people with TK won't get smeared with blood - if(H.wear_suit) - H.wear_suit.add_blood(H) - H.update_inv_wear_suit(0) //updates mob overlays to show the new blood (no refresh) - else if(H.w_uniform) - H.w_uniform.add_blood(H) - H.update_inv_w_uniform(0) //updates mob overlays to show the new blood (no refresh) - if (H.gloves) - var/obj/item/clothing/gloves/G = H.gloves - G.add_blood(H) - else - H.add_blood(H) - H.update_inv_gloves() //updates on-mob overlays for bloody hands and/or bloody gloves - - - switch(hit_area) - if("head") //Harder to score a stun but if you do it lasts a bit longer - if(H.stat == CONSCIOUS && prob(I.force) && armor < 50) - H.visible_message("[H] has been knocked unconscious!", \ - "[H] has been knocked unconscious!") - H.apply_effect(20, PARALYZE, armor) - if(H != user && I.damtype == BRUTE) - ticker.mode.remove_revolutionary(H.mind) - - if(bloody) //Apply blood - if(H.wear_mask) - H.wear_mask.add_blood(H) - H.update_inv_wear_mask(0) - if(H.head) - H.head.add_blood(H) - H.update_inv_head(0) - if(H.glasses && prob(33)) - H.glasses.add_blood(H) - H.update_inv_glasses(0) - - if("chest") //Easier to score a stun but lasts less time - if(H.stat == CONSCIOUS && prob(I.force + 10)) - H.visible_message("[H] has been knocked down!", \ - "[H] has been knocked down!") - H.apply_effect(5, WEAKEN, armor) - - if(bloody) - if(H.wear_suit) - H.wear_suit.add_blood(H) - H.update_inv_wear_suit(0) - if(H.w_uniform) - H.w_uniform.add_blood(H) - H.update_inv_w_uniform(0) - - if(Iforce > 10 || Iforce >= 5 && prob(33)) - H.forcesay(hit_appends) //forcesay checks stat already. - return - - proc/attacked_by(var/obj/item/I, var/mob/living/user, var/def_zone, var/mob/living/carbon/human/H) - H.apply_damage(I.force, I.damtype) - if(I.damtype == "brute") - if(prob(33) && I.force && !(NOBLOOD in specflags)) + var/bloody = 0 + if(((I.damtype == BRUTE) && prob(25 + (I.force * 2)))) + if(affecting.status == ORGAN_ORGANIC) + I.add_blood(H) //Make the weapon bloody, not the person. + if(prob(I.force * 2)) //blood spatter! + bloody = 1 var/turf/location = H.loc if(istype(location, /turf/simulated)) - location.add_blood_floor(H) + location.add_blood(H) + if(get_dist(H, H) <= 1) //people with TK won't get smeared with blood + if(H.wear_suit) + H.wear_suit.add_blood(H) + H.update_inv_wear_suit(0) //updates mob overlays to show the new blood (no refresh) + else if(H.w_uniform) + H.w_uniform.add_blood(H) + H.update_inv_w_uniform(0) //updates mob overlays to show the new blood (no refresh) + if (H.gloves) + var/obj/item/clothing/gloves/G = H.gloves + G.add_blood(H) + else + H.add_blood(H) + H.update_inv_gloves() //updates on-mob overlays for bloody hands and/or bloody gloves - var/showname = "." - if(user) - showname = " by [user]!" - if(!(user in viewers(I, null))) - showname = "." - if(I.attack_verb && I.attack_verb.len) - H.visible_message("[H] has been [pick(I.attack_verb)] with [I][showname]", - "[H] has been [pick(I.attack_verb)] with [I][showname]") - else if(I.force) - H.visible_message("[H] has been attacked with [I][showname]", - "[H] has been attacked with [I][showname]") - if(!showname && user) - if(user.client) - user << "You attack [H] with [I]. " + switch(hit_area) + if("head") //Harder to score a stun but if you do it lasts a bit longer + if(H.stat == CONSCIOUS && prob(I.force) && armor < 50) + H.visible_message("[H] has been knocked unconscious!", \ + "[H] has been knocked unconscious!") + H.apply_effect(20, PARALYZE, armor) + if(H != user && I.damtype == BRUTE) + ticker.mode.remove_revolutionary(H.mind) + if(bloody) //Apply blood + if(H.wear_mask) + H.wear_mask.add_blood(H) + H.update_inv_wear_mask(0) + if(H.head) + H.head.add_blood(H) + H.update_inv_head(0) + if(H.glasses && prob(33)) + H.glasses.add_blood(H) + H.update_inv_glasses(0) + + if("chest") //Easier to score a stun but lasts less time + if(H.stat == CONSCIOUS && prob(I.force + 10)) + H.visible_message("[H] has been knocked down!", \ + "[H] has been knocked down!") + H.apply_effect(5, WEAKEN, armor) + + if(bloody) + if(H.wear_suit) + H.wear_suit.add_blood(H) + H.update_inv_wear_suit(0) + if(H.w_uniform) + H.w_uniform.add_blood(H) + H.update_inv_w_uniform(0) + + if(Iforce > 10 || Iforce >= 5 && prob(33)) + H.forcesay(hit_appends) //forcesay checks stat already. return - proc/apply_damage(var/damage, var/damagetype = BRUTE, var/def_zone = null, var/blocked, var/mob/living/carbon/human/H) - blocked = (100-(blocked+armor))/100 - if(blocked <= 0) return 0 +/datum/species/proc/attacked_by(var/obj/item/I, var/mob/living/user, var/def_zone, var/mob/living/carbon/human/H) + H.apply_damage(I.force, I.damtype) + if(I.damtype == "brute") + if(prob(33) && I.force && !(NOBLOOD in specflags)) + var/turf/location = H.loc + if(istype(location, /turf/simulated)) + location.add_blood_floor(H) - var/obj/item/organ/limb/organ = null - if(isorgan(def_zone)) - organ = def_zone - else - if(!def_zone) def_zone = ran_zone(def_zone) - organ = H.get_organ(check_zone(def_zone)) - if(!organ) return 0 + var/showname = "." + if(user) + showname = " by [user]!" + if(!(user in viewers(I, null))) + showname = "." - damage = (damage * blocked) + if(I.attack_verb && I.attack_verb.len) + H.visible_message("[H] has been [pick(I.attack_verb)] with [I][showname]", + "[H] has been [pick(I.attack_verb)] with [I][showname]") + else if(I.force) + H.visible_message("[H] has been attacked with [I][showname]", + "[H] has been attacked with [I][showname]") + if(!showname && user) + if(user.client) + user << "You attack [H] with [I]. " - switch(damagetype) - if(BRUTE) - H.damageoverlaytemp = 20 - if(organ.take_damage(damage*brutemod, 0)) - H.update_damage_overlays(0) - if(BURN) - H.damageoverlaytemp = 20 - if(organ.take_damage(0, damage*burnmod)) - H.update_damage_overlays(0) - if(TOX) - H.adjustToxLoss(damage * blocked) - if(OXY) - H.adjustOxyLoss(damage * blocked) - if(CLONE) - H.adjustCloneLoss(damage * blocked) - if(STAMINA) - H.adjustStaminaLoss(damage * blocked) + return - proc/on_hit(var/obj/item/projectile/proj_type, var/mob/living/carbon/human/H) - // called when hit by a projectile - switch(proj_type) - if(/obj/item/projectile/energy/floramut) // overwritten by plants/pods - H.show_message("The radiation beam dissipates harmlessly through your body.") - if(/obj/item/projectile/energy/florayield) - H.show_message("The radiation beam dissipates harmlessly through your body.") - return +/datum/species/proc/apply_damage(var/damage, var/damagetype = BRUTE, var/def_zone = null, var/blocked, var/mob/living/carbon/human/H) + blocked = (100-(blocked+armor))/100 + if(blocked <= 0) return 0 - ///////////// - //BREATHING// - ///////////// + var/obj/item/organ/limb/organ = null + if(isorgan(def_zone)) + organ = def_zone + else + if(!def_zone) def_zone = ran_zone(def_zone) + organ = H.get_organ(check_zone(def_zone)) + if(!organ) return 0 - proc/breathe(var/mob/living/carbon/human/H) - if(H.reagents.has_reagent("lexorin")) return - if(istype(H.loc, /obj/machinery/atmospherics/unary/cryo_cell)) return + damage = (damage * blocked) - var/datum/gas_mixture/environment = H.loc.return_air() - var/datum/gas_mixture/breath - // HACK NEED CHANGING LATER - if(H.health <= config.health_threshold_crit) - H.losebreath++ + switch(damagetype) + if(BRUTE) + H.damageoverlaytemp = 20 + if(organ.take_damage(damage*brutemod, 0)) + H.update_damage_overlays(0) + if(BURN) + H.damageoverlaytemp = 20 + if(organ.take_damage(0, damage*burnmod)) + H.update_damage_overlays(0) + if(TOX) + H.adjustToxLoss(damage * blocked) + if(OXY) + H.adjustOxyLoss(damage * blocked) + if(CLONE) + H.adjustCloneLoss(damage * blocked) + if(STAMINA) + H.adjustStaminaLoss(damage * blocked) - if(H.losebreath>0) //Suffocating so do not take a breath - H.losebreath-- - if (prob(10)) //Gasp per 10 ticks? Sounds about right. - spawn H.emote("gasp") +/datum/species/proc/on_hit(var/obj/item/projectile/proj_type, var/mob/living/carbon/human/H) + // called when hit by a projectile + switch(proj_type) + if(/obj/item/projectile/energy/floramut) // overwritten by plants/pods + H.show_message("The radiation beam dissipates harmlessly through your body.") + if(/obj/item/projectile/energy/florayield) + H.show_message("The radiation beam dissipates harmlessly through your body.") + return + +///////////// +//BREATHING// +///////////// + +/datum/species/proc/breathe(var/mob/living/carbon/human/H) + if(H.reagents.has_reagent("lexorin")) return + if(istype(H.loc, /obj/machinery/atmospherics/unary/cryo_cell)) return + + var/datum/gas_mixture/environment = H.loc.return_air() + var/datum/gas_mixture/breath + // HACK NEED CHANGING LATER + if(H.health <= config.health_threshold_crit) + H.losebreath++ + + if(H.losebreath>0) //Suffocating so do not take a breath + H.losebreath-- + if (prob(10)) //Gasp per 10 ticks? Sounds about right. + spawn H.emote("gasp") + if(istype(H.loc, /obj/)) + var/obj/location_as_object = H.loc + location_as_object.handle_internal_lifeform(H, 0) + else + //First, check for air from internal atmosphere (using an air tank and mask generally) + breath = H.get_breath_from_internal(BREATH_VOLUME) // Super hacky -- TLE + //breath = get_breath_from_internal(0.5) // Manually setting to old BREATH_VOLUME amount -- TLE + + //No breath from internal atmosphere so get breath from location + if(!breath) + if(isobj(H.loc)) + var/obj/location_as_object = H.loc + breath = location_as_object.handle_internal_lifeform(H, BREATH_VOLUME) + else if(isturf(H.loc)) + var/breath_moles = 0 + /*if(environment.return_pressure() > ONE_ATMOSPHERE) + // Loads of air around (pressure effect will be handled elsewhere), so lets just take a enough to fill our lungs at normal atmos pressure (using n = Pv/RT) + breath_moles = (ONE_ATMOSPHERE*BREATH_VOLUME/R_IDEAL_GAS_EQUATION*environment.temperature) + else*/ + // Not enough air around, take a percentage of what's there to model this properly + breath_moles = environment.total_moles()*BREATH_PERCENTAGE + + breath = H.loc.remove_air(breath_moles) + // Handle chem smoke effect -- Doohl + var/block = 0 + if(H.wear_mask) + if(H.wear_mask.flags & BLOCK_GAS_SMOKE_EFFECT) + block = 1 + if(H.glasses) + if(H.glasses.flags & BLOCK_GAS_SMOKE_EFFECT) + block = 1 + if(H.head) + if(H.head.flags & BLOCK_GAS_SMOKE_EFFECT) + block = 1 + + if(!block) + + for(var/obj/effect/effect/chem_smoke/smoke in view(1, H)) + if(smoke.reagents.total_volume) + smoke.reagents.reaction(H, INGEST) + spawn(5) + if(smoke) + smoke.reagents.copy_to(H, 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(H.loc, /obj/)) var/obj/location_as_object = H.loc location_as_object.handle_internal_lifeform(H, 0) - else - //First, check for air from internal atmosphere (using an air tank and mask generally) - breath = H.get_breath_from_internal(BREATH_VOLUME) // Super hacky -- TLE - //breath = get_breath_from_internal(0.5) // Manually setting to old BREATH_VOLUME amount -- TLE - //No breath from internal atmosphere so get breath from location - if(!breath) - if(isobj(H.loc)) - var/obj/location_as_object = H.loc - breath = location_as_object.handle_internal_lifeform(H, BREATH_VOLUME) - else if(isturf(H.loc)) - var/breath_moles = 0 - /*if(environment.return_pressure() > ONE_ATMOSPHERE) - // Loads of air around (pressure effect will be handled elsewhere), so lets just take a enough to fill our lungs at normal atmos pressure (using n = Pv/RT) - breath_moles = (ONE_ATMOSPHERE*BREATH_VOLUME/R_IDEAL_GAS_EQUATION*environment.temperature) - else*/ - // Not enough air around, take a percentage of what's there to model this properly - breath_moles = environment.total_moles()*BREATH_PERCENTAGE + handle_breath(breath, H) - breath = H.loc.remove_air(breath_moles) - // Handle chem smoke effect -- Doohl - var/block = 0 - if(H.wear_mask) - if(H.wear_mask.flags & BLOCK_GAS_SMOKE_EFFECT) - block = 1 - if(H.glasses) - if(H.glasses.flags & BLOCK_GAS_SMOKE_EFFECT) - block = 1 - if(H.head) - if(H.head.flags & BLOCK_GAS_SMOKE_EFFECT) - block = 1 + if(breath) + H.loc.assume_air(breath) - if(!block) +/datum/species/proc/handle_breath(datum/gas_mixture/breath, var/mob/living/carbon/human/H) + if((H.status_flags & GODMODE)) + return - for(var/obj/effect/effect/chem_smoke/smoke in view(1, H)) - if(smoke.reagents.total_volume) - smoke.reagents.reaction(H, INGEST) - spawn(5) - if(smoke) - smoke.reagents.copy_to(H, 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(H.loc, /obj/)) - var/obj/location_as_object = H.loc - location_as_object.handle_internal_lifeform(H, 0) - - handle_breath(breath, H) - - if(breath) - H.loc.assume_air(breath) - - proc/handle_breath(datum/gas_mixture/breath, var/mob/living/carbon/human/H) - if((H.status_flags & GODMODE)) + if(!breath || (breath.total_moles() == 0) || H.suiciding) + if(H.reagents.has_reagent("inaprovaline")) return + if(H.suiciding) + H.adjustOxyLoss(2)//If you are suiciding, you should die a little bit faster + H.failed_last_breath = 1 + H.oxygen_alert = max(H.oxygen_alert, 1) + return 0 + if(H.health >= config.health_threshold_crit) + if(NOBREATH in specflags) return 1 + H.adjustOxyLoss(HUMAN_MAX_OXYLOSS) + H.failed_last_breath = 1 + else + H.adjustOxyLoss(HUMAN_CRIT_MAX_OXYLOSS) + H.failed_last_breath = 1 - if(!breath || (breath.total_moles() == 0) || H.suiciding) - if(H.reagents.has_reagent("inaprovaline")) - return - if(H.suiciding) - H.adjustOxyLoss(2)//If you are suiciding, you should die a little bit faster + H.oxygen_alert = max(H.oxygen_alert, 1) + + return 0 + + var/safe_oxygen_min = 16 // Minimum safe partial pressure of O2, in kPa + //var/safe_oxygen_max = 140 // Maximum safe partial pressure of O2, in kPa (Not used for now) + var/safe_co2_max = 10 // Yes it's an arbitrary value who cares? + var/safe_toxins_max = 0.005 + var/SA_para_min = 1 + var/SA_sleep_min = 5 + var/oxygen_used = 0 + var/breath_pressure = (breath.total_moles()*R_IDEAL_GAS_EQUATION*breath.temperature)/BREATH_VOLUME + + //Partial pressure of the O2 in our breath + var/O2_pp = (breath.oxygen/breath.total_moles())*breath_pressure + // Same, but for the toxins + var/Toxins_pp = (breath.toxins/breath.total_moles())*breath_pressure + // And CO2, lets say a PP of more than 10 will be bad (It's a little less really, but eh, being passed out all round aint no fun) + var/CO2_pp = (breath.carbon_dioxide/breath.total_moles())*breath_pressure // Tweaking to fit the hacky bullshit I've done with atmo -- TLE + //var/CO2_pp = (breath.carbon_dioxide/breath.total_moles())*0.5 // The default pressure value + + if(O2_pp < safe_oxygen_min) // Too little oxygen + if(!(NOBREATH in specflags) || (H.health <= config.health_threshold_crit)) + if(prob(20)) + spawn(0) H.emote("gasp") + if(O2_pp > 0) + var/ratio = safe_oxygen_min/O2_pp + H.adjustOxyLoss(min(5*ratio, HUMAN_MAX_OXYLOSS)) // Don't fuck them up too fast (space only does HUMAN_MAX_OXYLOSS after all!) H.failed_last_breath = 1 - H.oxygen_alert = max(H.oxygen_alert, 1) - return 0 - if(H.health >= config.health_threshold_crit) - if(NOBREATH in specflags) return 1 + oxygen_used = breath.oxygen*ratio/6 + else H.adjustOxyLoss(HUMAN_MAX_OXYLOSS) H.failed_last_breath = 1 - else - H.adjustOxyLoss(HUMAN_CRIT_MAX_OXYLOSS) - H.failed_last_breath = 1 - H.oxygen_alert = max(H.oxygen_alert, 1) + /*else if (O2_pp > safe_oxygen_max) // Too much oxygen (commented this out for now, I'll deal with pressure damage elsewhere I suppose) + spawn(0) emote("cough") + var/ratio = O2_pp/safe_oxygen_max + oxyloss += 5*ratio + oxygen_used = breath.oxygen*ratio/6 + oxygen_alert = max(oxygen_alert, 1)*/ + else // We're in safe limits + H.failed_last_breath = 0 + H.adjustOxyLoss(-5) + oxygen_used = breath.oxygen/6 + H.oxygen_alert = 0 - return 0 + breath.oxygen -= oxygen_used + breath.carbon_dioxide += oxygen_used - var/safe_oxygen_min = 16 // Minimum safe partial pressure of O2, in kPa - //var/safe_oxygen_max = 140 // Maximum safe partial pressure of O2, in kPa (Not used for now) - var/safe_co2_max = 10 // Yes it's an arbitrary value who cares? - var/safe_toxins_max = 0.005 - var/SA_para_min = 1 - var/SA_sleep_min = 5 - var/oxygen_used = 0 - var/breath_pressure = (breath.total_moles()*R_IDEAL_GAS_EQUATION*breath.temperature)/BREATH_VOLUME + //CO2 does not affect failed_last_breath. So if there was enough oxygen in the air but too much co2, this will hurt you, but only once per 4 ticks, instead of once per tick. + if(CO2_pp > safe_co2_max && !(NOBREATH in specflags)) + if(!H.co2overloadtime) // If it's the first breath with too much CO2 in it, lets start a counter, then have them pass out after 12s or so. + H.co2overloadtime = world.time + else if(world.time - H.co2overloadtime > 120) + H.Paralyse(3) + H.adjustOxyLoss(3) // Lets hurt em a little, let them know we mean business + if(world.time - H.co2overloadtime > 300) // They've been in here 30s now, lets start to kill them for their own good! + H.adjustOxyLoss(8) + if(prob(20)) // Lets give them some chance to know somethings not right though I guess. + spawn(0) H.emote("cough") - //Partial pressure of the O2 in our breath - var/O2_pp = (breath.oxygen/breath.total_moles())*breath_pressure - // Same, but for the toxins - var/Toxins_pp = (breath.toxins/breath.total_moles())*breath_pressure - // And CO2, lets say a PP of more than 10 will be bad (It's a little less really, but eh, being passed out all round aint no fun) - var/CO2_pp = (breath.carbon_dioxide/breath.total_moles())*breath_pressure // Tweaking to fit the hacky bullshit I've done with atmo -- TLE - //var/CO2_pp = (breath.carbon_dioxide/breath.total_moles())*0.5 // The default pressure value + else + H.co2overloadtime = 0 - if(O2_pp < safe_oxygen_min) // Too little oxygen - if(!(NOBREATH in specflags) || (H.health <= config.health_threshold_crit)) + if(Toxins_pp > safe_toxins_max && !(NOBREATH in specflags)) // Too much toxins + var/ratio = (breath.toxins/safe_toxins_max) * 10 + //adjustToxLoss(Clamp(ratio, MIN_PLASMA_DAMAGE, MAX_PLASMA_DAMAGE)) //Limit amount of damage toxin exposure can do per second + if(H.reagents) + H.reagents.add_reagent("plasma", Clamp(ratio, MIN_PLASMA_DAMAGE, MAX_PLASMA_DAMAGE)) + H.toxins_alert = max(H.toxins_alert, 1) + else + H.toxins_alert = 0 + + if(breath.trace_gases.len && !(NOBREATH in specflags)) // If there's some other shit in the air lets deal with it here. + for(var/datum/gas/sleeping_agent/SA in breath.trace_gases) + var/SA_pp = (SA.moles/breath.total_moles())*breath_pressure + if(SA_pp > SA_para_min) // Enough to make us paralysed for a bit + H.Paralyse(3) // 3 gives them one second to wake up and run away a bit! + if(SA_pp > SA_sleep_min) // Enough to make us sleep as well + H.sleeping = max(H.sleeping+2, 10) + else if(SA_pp > 0.01) // There is sleeping gas in their lungs, but only a little, so give them a bit of a warning if(prob(20)) - spawn(0) H.emote("gasp") - if(O2_pp > 0) - var/ratio = safe_oxygen_min/O2_pp - H.adjustOxyLoss(min(5*ratio, HUMAN_MAX_OXYLOSS)) // Don't fuck them up too fast (space only does HUMAN_MAX_OXYLOSS after all!) - H.failed_last_breath = 1 - oxygen_used = breath.oxygen*ratio/6 - else - H.adjustOxyLoss(HUMAN_MAX_OXYLOSS) - H.failed_last_breath = 1 - H.oxygen_alert = max(H.oxygen_alert, 1) - /*else if (O2_pp > safe_oxygen_max) // Too much oxygen (commented this out for now, I'll deal with pressure damage elsewhere I suppose) - spawn(0) emote("cough") - var/ratio = O2_pp/safe_oxygen_max - oxyloss += 5*ratio - oxygen_used = breath.oxygen*ratio/6 - oxygen_alert = max(oxygen_alert, 1)*/ - else // We're in safe limits - H.failed_last_breath = 0 - H.adjustOxyLoss(-5) - oxygen_used = breath.oxygen/6 - H.oxygen_alert = 0 + spawn(0) H.emote(pick("giggle", "laugh")) - breath.oxygen -= oxygen_used - breath.carbon_dioxide += oxygen_used + handle_temperature(breath, H) - //CO2 does not affect failed_last_breath. So if there was enough oxygen in the air but too much co2, this will hurt you, but only once per 4 ticks, instead of once per tick. - if(CO2_pp > safe_co2_max && !(NOBREATH in specflags)) - if(!H.co2overloadtime) // If it's the first breath with too much CO2 in it, lets start a counter, then have them pass out after 12s or so. - H.co2overloadtime = world.time - else if(world.time - H.co2overloadtime > 120) - H.Paralyse(3) - H.adjustOxyLoss(3) // Lets hurt em a little, let them know we mean business - if(world.time - H.co2overloadtime > 300) // They've been in here 30s now, lets start to kill them for their own good! - H.adjustOxyLoss(8) - if(prob(20)) // Lets give them some chance to know somethings not right though I guess. - spawn(0) H.emote("cough") + return 1 - else - H.co2overloadtime = 0 +/datum/species/proc/handle_temperature(datum/gas_mixture/breath, var/mob/living/carbon/human/H) // called by human/life, handles temperatures + if( (abs(310.15 - breath.temperature) > 50) && !(COLD_RESISTANCE in H.mutations) && !(COLDRES in specflags)) // Hot air hurts :( + if(breath.temperature < 260.15) + if(prob(20)) + H << "You feel your face freezing and an icicle forming in your lungs!" + else if(breath.temperature > 360.15 && !(HEATRES in specflags)) + if(prob(20)) + H << "You feel your face burning and a searing heat in your lungs!" - if(Toxins_pp > safe_toxins_max && !(NOBREATH in specflags)) // Too much toxins - var/ratio = (breath.toxins/safe_toxins_max) * 10 - //adjustToxLoss(Clamp(ratio, MIN_PLASMA_DAMAGE, MAX_PLASMA_DAMAGE)) //Limit amount of damage toxin exposure can do per second - if(H.reagents) - H.reagents.add_reagent("plasma", Clamp(ratio, MIN_PLASMA_DAMAGE, MAX_PLASMA_DAMAGE)) - H.toxins_alert = max(H.toxins_alert, 1) - else - H.toxins_alert = 0 + if(!(COLDRES in specflags)) // COLD DAMAGE + switch(breath.temperature) + if(-INFINITY to 120) + H.apply_damage(COLD_GAS_DAMAGE_LEVEL_3, BURN, "head") + H.fire_alert = max(H.fire_alert, 1) + if(120 to 200) + H.apply_damage(COLD_GAS_DAMAGE_LEVEL_2, BURN, "head") + H.fire_alert = max(H.fire_alert, 1) + if(200 to 260) + H.apply_damage(COLD_GAS_DAMAGE_LEVEL_1, BURN, "head") + H.fire_alert = max(H.fire_alert, 1) - if(breath.trace_gases.len && !(NOBREATH in specflags)) // If there's some other shit in the air lets deal with it here. - for(var/datum/gas/sleeping_agent/SA in breath.trace_gases) - var/SA_pp = (SA.moles/breath.total_moles())*breath_pressure - if(SA_pp > SA_para_min) // Enough to make us paralysed for a bit - H.Paralyse(3) // 3 gives them one second to wake up and run away a bit! - if(SA_pp > SA_sleep_min) // Enough to make us sleep as well - H.sleeping = max(H.sleeping+2, 10) - else if(SA_pp > 0.01) // There is sleeping gas in their lungs, but only a little, so give them a bit of a warning - if(prob(20)) - spawn(0) H.emote(pick("giggle", "laugh")) + if(!(HEATRES in specflags)) // HEAT DAMAGE + switch(breath.temperature) + if(360 to 400) + H.apply_damage(HEAT_GAS_DAMAGE_LEVEL_1, BURN, "head") + H.fire_alert = max(H.fire_alert, 2) + if(400 to 1000) + H.apply_damage(HEAT_GAS_DAMAGE_LEVEL_2, BURN, "head") + H.fire_alert = max(H.fire_alert, 2) + if(1000 to INFINITY) + H.apply_damage(HEAT_GAS_DAMAGE_LEVEL_3, BURN, "head") + H.fire_alert = max(H.fire_alert, 2) - handle_temperature(breath, H) - - return 1 - - proc/handle_temperature(datum/gas_mixture/breath, var/mob/living/carbon/human/H) // called by human/life, handles temperatures - if( (abs(310.15 - breath.temperature) > 50) && !(COLD_RESISTANCE in H.mutations) && !(COLDRES in specflags)) // Hot air hurts :( - if(breath.temperature < 260.15) - if(prob(20)) - H << "You feel your face freezing and an icicle forming in your lungs!" - else if(breath.temperature > 360.15 && !(HEATRES in specflags)) - if(prob(20)) - H << "You feel your face burning and a searing heat in your lungs!" - - if(!(COLDRES in specflags)) // COLD DAMAGE - switch(breath.temperature) - if(-INFINITY to 120) - H.apply_damage(COLD_GAS_DAMAGE_LEVEL_3, BURN, "head") - H.fire_alert = max(H.fire_alert, 1) - if(120 to 200) - H.apply_damage(COLD_GAS_DAMAGE_LEVEL_2, BURN, "head") - H.fire_alert = max(H.fire_alert, 1) - if(200 to 260) - H.apply_damage(COLD_GAS_DAMAGE_LEVEL_1, BURN, "head") - H.fire_alert = max(H.fire_alert, 1) - - if(!(HEATRES in specflags)) // HEAT DAMAGE - switch(breath.temperature) - if(360 to 400) - H.apply_damage(HEAT_GAS_DAMAGE_LEVEL_1, BURN, "head") - H.fire_alert = max(H.fire_alert, 2) - if(400 to 1000) - H.apply_damage(HEAT_GAS_DAMAGE_LEVEL_2, BURN, "head") - H.fire_alert = max(H.fire_alert, 2) - if(1000 to INFINITY) - H.apply_damage(HEAT_GAS_DAMAGE_LEVEL_3, BURN, "head") - H.fire_alert = max(H.fire_alert, 2) + return +/datum/species/proc/handle_environment(datum/gas_mixture/environment, var/mob/living/carbon/human/H) + if(!environment) return - proc/handle_environment(datum/gas_mixture/environment, var/mob/living/carbon/human/H) - if(!environment) - return + var/loc_temp = H.get_temperature(environment) + //world << "Loc temp: [loc_temp] - Body temp: [bodytemperature] - Fireloss: [getFireLoss()] - Thermal protection: [get_thermal_protection()] - Fire protection: [thermal_protection + add_fire_protection(loc_temp)] - Heat capacity: [environment_heat_capacity] - Location: [loc] - src: [src]" - var/loc_temp = H.get_temperature(environment) - //world << "Loc temp: [loc_temp] - Body temp: [bodytemperature] - Fireloss: [getFireLoss()] - Thermal protection: [get_thermal_protection()] - Fire protection: [thermal_protection + add_fire_protection(loc_temp)] - Heat capacity: [environment_heat_capacity] - Location: [loc] - src: [src]" + //Body temperature is adjusted in two steps. Firstly your body tries to stabilize itself a bit. + if(H.stat != 2) + H.stabilize_temperature_from_calories() - //Body temperature is adjusted in two steps. Firstly your body tries to stabilize itself a bit. - if(H.stat != 2) - H.stabilize_temperature_from_calories() + //After then, it reacts to the surrounding atmosphere based on your thermal protection + if(!H.on_fire) //If you're on fire, you do not heat up or cool down based on surrounding gases + if(loc_temp < H.bodytemperature) + //Place is colder than we are + var/thermal_protection = H.get_cold_protection(loc_temp) //This returns a 0 - 1 value, which corresponds to the percentage of protection based on what you're wearing and what you're exposed to. + if(thermal_protection < 1) + H.bodytemperature += min((1-thermal_protection) * ((loc_temp - H.bodytemperature) / BODYTEMP_COLD_DIVISOR), BODYTEMP_COOLING_MAX) + else + //Place is hotter than we are + var/thermal_protection = H.get_heat_protection(loc_temp) //This returns a 0 - 1 value, which corresponds to the percentage of protection based on what you're wearing and what you're exposed to. + if(thermal_protection < 1) + H.bodytemperature += min((1-thermal_protection) * ((loc_temp - H.bodytemperature) / BODYTEMP_HEAT_DIVISOR), BODYTEMP_HEATING_MAX) - //After then, it reacts to the surrounding atmosphere based on your thermal protection - if(!H.on_fire) //If you're on fire, you do not heat up or cool down based on surrounding gases - if(loc_temp < H.bodytemperature) - //Place is colder than we are - var/thermal_protection = H.get_cold_protection(loc_temp) //This returns a 0 - 1 value, which corresponds to the percentage of protection based on what you're wearing and what you're exposed to. - if(thermal_protection < 1) - H.bodytemperature += min((1-thermal_protection) * ((loc_temp - H.bodytemperature) / BODYTEMP_COLD_DIVISOR), BODYTEMP_COOLING_MAX) - else - //Place is hotter than we are - var/thermal_protection = H.get_heat_protection(loc_temp) //This returns a 0 - 1 value, which corresponds to the percentage of protection based on what you're wearing and what you're exposed to. - if(thermal_protection < 1) - H.bodytemperature += min((1-thermal_protection) * ((loc_temp - H.bodytemperature) / BODYTEMP_HEAT_DIVISOR), BODYTEMP_HEATING_MAX) - - // +/- 50 degrees from 310.15K is the 'safe' zone, where no damage is dealt. - if(H.bodytemperature > BODYTEMP_HEAT_DAMAGE_LIMIT && !(HEATRES in specflags)) - //Body temperature is too hot. - H.fire_alert = max(H.fire_alert, 1) - switch(H.bodytemperature) - if(360 to 400) - H.apply_damage(HEAT_DAMAGE_LEVEL_1*heatmod, BURN) + // +/- 50 degrees from 310.15K is the 'safe' zone, where no damage is dealt. + if(H.bodytemperature > BODYTEMP_HEAT_DAMAGE_LIMIT && !(HEATRES in specflags)) + //Body temperature is too hot. + H.fire_alert = max(H.fire_alert, 1) + switch(H.bodytemperature) + if(360 to 400) + H.apply_damage(HEAT_DAMAGE_LEVEL_1*heatmod, BURN) + H.fire_alert = max(H.fire_alert, 2) + if(400 to 460) + H.apply_damage(HEAT_DAMAGE_LEVEL_2*heatmod, BURN) + H.fire_alert = max(H.fire_alert, 2) + if(460 to INFINITY) + if(H.on_fire) + H.apply_damage(HEAT_DAMAGE_LEVEL_3*heatmod, BURN) H.fire_alert = max(H.fire_alert, 2) - if(400 to 460) + else H.apply_damage(HEAT_DAMAGE_LEVEL_2*heatmod, BURN) H.fire_alert = max(H.fire_alert, 2) - if(460 to INFINITY) - if(H.on_fire) - H.apply_damage(HEAT_DAMAGE_LEVEL_3*heatmod, BURN) - H.fire_alert = max(H.fire_alert, 2) - else - H.apply_damage(HEAT_DAMAGE_LEVEL_2*heatmod, BURN) - H.fire_alert = max(H.fire_alert, 2) - else if(H.bodytemperature < BODYTEMP_COLD_DAMAGE_LIMIT && !(COLDRES in specflags)) - H.fire_alert = max(H.fire_alert, 1) - if(!istype(H.loc, /obj/machinery/atmospherics/unary/cryo_cell)) - switch(H.bodytemperature) - if(200 to 260) - H.apply_damage(COLD_DAMAGE_LEVEL_1*coldmod, BURN) - H.fire_alert = max(H.fire_alert, 1) - if(120 to 200) - H.apply_damage(COLD_DAMAGE_LEVEL_2*coldmod, BURN) - H.fire_alert = max(H.fire_alert, 1) - if(-INFINITY to 120) - H.apply_damage(COLD_DAMAGE_LEVEL_3*coldmod, BURN) - H.fire_alert = max(H.fire_alert, 1) + else if(H.bodytemperature < BODYTEMP_COLD_DAMAGE_LIMIT && !(COLDRES in specflags)) + H.fire_alert = max(H.fire_alert, 1) + if(!istype(H.loc, /obj/machinery/atmospherics/unary/cryo_cell)) + switch(H.bodytemperature) + if(200 to 260) + H.apply_damage(COLD_DAMAGE_LEVEL_1*coldmod, BURN) + H.fire_alert = max(H.fire_alert, 1) + if(120 to 200) + H.apply_damage(COLD_DAMAGE_LEVEL_2*coldmod, BURN) + H.fire_alert = max(H.fire_alert, 1) + if(-INFINITY to 120) + H.apply_damage(COLD_DAMAGE_LEVEL_3*coldmod, BURN) + H.fire_alert = max(H.fire_alert, 1) - // Account for massive pressure differences. Done by Polymorph - // Made it possible to actually have something that can protect against high pressure... Done by Errorage. Polymorph now has an axe sticking from his head for his previous hardcoded nonsense! + // Account for massive pressure differences. Done by Polymorph + // Made it possible to actually have something that can protect against high pressure... Done by Errorage. Polymorph now has an axe sticking from his head for his previous hardcoded nonsense! - var/pressure = environment.return_pressure() - var/adjusted_pressure = H.calculate_affecting_pressure(pressure) //Returns how much pressure actually affects the mob. - switch(adjusted_pressure) - if(HAZARD_HIGH_PRESSURE to INFINITY) - if(!(HEATRES in specflags)) - H.adjustBruteLoss( min( ( (adjusted_pressure / HAZARD_HIGH_PRESSURE) -1 )*PRESSURE_DAMAGE_COEFFICIENT , MAX_HIGH_PRESSURE_DAMAGE) ) - H.pressure_alert = 2 - else - H.pressure_alert = 1 - if(WARNING_HIGH_PRESSURE to HAZARD_HIGH_PRESSURE) + var/pressure = environment.return_pressure() + var/adjusted_pressure = H.calculate_affecting_pressure(pressure) //Returns how much pressure actually affects the mob. + switch(adjusted_pressure) + if(HAZARD_HIGH_PRESSURE to INFINITY) + if(!(HEATRES in specflags)) + H.adjustBruteLoss( min( ( (adjusted_pressure / HAZARD_HIGH_PRESSURE) -1 )*PRESSURE_DAMAGE_COEFFICIENT , MAX_HIGH_PRESSURE_DAMAGE) ) + H.pressure_alert = 2 + else H.pressure_alert = 1 - if(WARNING_LOW_PRESSURE to WARNING_HIGH_PRESSURE) - H.pressure_alert = 0 - if(HAZARD_LOW_PRESSURE to WARNING_LOW_PRESSURE) + if(WARNING_HIGH_PRESSURE to HAZARD_HIGH_PRESSURE) + H.pressure_alert = 1 + if(WARNING_LOW_PRESSURE to WARNING_HIGH_PRESSURE) + H.pressure_alert = 0 + if(HAZARD_LOW_PRESSURE to WARNING_LOW_PRESSURE) + H.pressure_alert = -1 + else + if((COLD_RESISTANCE in H.mutations) || (COLDRES in specflags)) H.pressure_alert = -1 else - if((COLD_RESISTANCE in H.mutations) || (COLDRES in specflags)) - H.pressure_alert = -1 - else - H.adjustBruteLoss( LOW_PRESSURE_DAMAGE ) - H.pressure_alert = -2 + H.adjustBruteLoss( LOW_PRESSURE_DAMAGE ) + H.pressure_alert = -2 + return + +////////// +// FIRE // +////////// + +/datum/species/proc/handle_fire(var/mob/living/carbon/human/H) + if((HEATRES in specflags) || (NOFIRE in specflags)) return + if(H.fire_stacks < 0) + H.fire_stacks++ //If we've doused ourselves in water to avoid fire, dry off slowly + H.fire_stacks = min(0, H.fire_stacks)//So we dry ourselves back to default, nonflammable. + if(!H.on_fire) + return + var/datum/gas_mixture/G = H.loc.return_air() // Check if we're standing in an oxygenless environment + if(G.oxygen < 1) + ExtinguishMob() //If there's no oxygen in the tile we're on, put out the fire + return + var/turf/location = get_turf(H) + location.hotspot_expose(700, 50, 1) - ////////// - // FIRE // - ////////// +/datum/species/proc/IgniteMob(var/mob/living/carbon/human/H) + if(H.fire_stacks > 0 && !H.on_fire && !(HEATRES in specflags) && !(NOFIRE in specflags)) + H.on_fire = 1 + H.AddLuminosity(3) + H.update_fire() - proc/handle_fire(var/mob/living/carbon/human/H) - if((HEATRES in specflags) || (NOFIRE in specflags)) - return - if(H.fire_stacks < 0) - H.fire_stacks++ //If we've doused ourselves in water to avoid fire, dry off slowly - H.fire_stacks = min(0, H.fire_stacks)//So we dry ourselves back to default, nonflammable. - if(!H.on_fire) - return - var/datum/gas_mixture/G = H.loc.return_air() // Check if we're standing in an oxygenless environment - if(G.oxygen < 1) - ExtinguishMob() //If there's no oxygen in the tile we're on, put out the fire - return - var/turf/location = get_turf(H) - location.hotspot_expose(700, 50, 1) - - proc/IgniteMob(var/mob/living/carbon/human/H) - if(H.fire_stacks > 0 && !H.on_fire && !(HEATRES in specflags) && !(NOFIRE in specflags)) - H.on_fire = 1 - H.AddLuminosity(3) - H.update_fire() - - proc/ExtinguishMob(var/mob/living/carbon/human/H) - if(H.on_fire) - H.on_fire = 0 - H.fire_stacks = 0 - H.AddLuminosity(-3) - H.update_fire() +/datum/species/proc/ExtinguishMob(var/mob/living/carbon/human/H) + if(H.on_fire) + H.on_fire = 0 + H.fire_stacks = 0 + H.AddLuminosity(-3) + H.update_fire() #undef SPECIES_LAYER #undef BODY_LAYER @@ -1327,4 +1327,4 @@ #undef COLD_GAS_DAMAGE_LEVEL_3 #undef TINT_IMPAIR -#undef TINT_BLIND \ No newline at end of file +#undef TINT_BLIND diff --git a/code/modules/mob/living/carbon/monkey/life.dm b/code/modules/mob/living/carbon/monkey/life.dm index 220b99380f6..b66aed96736 100644 --- a/code/modules/mob/living/carbon/monkey/life.dm +++ b/code/modules/mob/living/carbon/monkey/life.dm @@ -76,519 +76,517 @@ ..() return pressure -/mob/living/carbon/monkey +/mob/living/carbon/monkey/proc/handle_disabilities() - proc/handle_disabilities() + if (disabilities & EPILEPSY) + if ((prob(1) && paralysis < 10)) + src << "\red You have a seizure!" + Paralyse(10) + if (disabilities & COUGHING) + if ((prob(5) && paralysis <= 1)) + drop_item() + spawn( 0 ) + emote("cough") + return + if (disabilities & TOURETTES) + if ((prob(10) && paralysis <= 1)) + Stun(10) + spawn( 0 ) + emote("twitch") + return + if (disabilities & NERVOUS) + if (prob(10)) + stuttering = max(10, stuttering) - if (disabilities & EPILEPSY) - if ((prob(1) && paralysis < 10)) - src << "\red You have a seizure!" - Paralyse(10) - if (disabilities & COUGHING) - if ((prob(5) && paralysis <= 1)) - drop_item() - spawn( 0 ) - emote("cough") - return - if (disabilities & TOURETTES) - if ((prob(10) && paralysis <= 1)) - Stun(10) - spawn( 0 ) - emote("twitch") - return - if (disabilities & NERVOUS) - if (prob(10)) - stuttering = max(10, stuttering) +/mob/living/carbon/monkey/proc/handle_mutations_and_radiation() - proc/handle_mutations_and_radiation() + if(getFireLoss()) + if((COLD_RESISTANCE in mutations) && prob(50)) + switch(getFireLoss()) + if(1 to 50) + adjustFireLoss(-1) + if(51 to 100) + adjustFireLoss(-5) - if(getFireLoss()) - if((COLD_RESISTANCE in mutations) && prob(50)) - switch(getFireLoss()) - if(1 to 50) - adjustFireLoss(-1) - if(51 to 100) - adjustFireLoss(-5) + if ((HULK in mutations) && health <= 25) + mutations.Remove(HULK) + src << "\red You suddenly feel very weak." + Weaken(3) + emote("collapse") - if ((HULK in mutations) && health <= 25) - mutations.Remove(HULK) - src << "\red You suddenly feel very weak." - Weaken(3) + if (radiation) + if (radiation > 100) + radiation = 100 + Weaken(10) + src << "\red You feel weak." emote("collapse") - if (radiation) - if (radiation > 100) - radiation = 100 - Weaken(10) - src << "\red You feel weak." - emote("collapse") - - switch(radiation) - if(1 to 49) - radiation-- - if(prob(25)) - adjustToxLoss(1) - updatehealth() - - if(50 to 74) - radiation -= 2 + switch(radiation) + if(1 to 49) + radiation-- + if(prob(25)) adjustToxLoss(1) - if(prob(5)) - radiation -= 5 - Weaken(3) - src << "\red You feel weak." - emote("collapse") updatehealth() - if(75 to 100) - radiation -= 3 - adjustToxLoss(3) - if(prob(1)) - src << "\red You mutate!" - randmutb(src) - domutcheck(src,null) - emote("gasp") - updatehealth() + if(50 to 74) + radiation -= 2 + adjustToxLoss(1) + if(prob(5)) + radiation -= 5 + Weaken(3) + src << "\red You feel weak." + emote("collapse") + updatehealth() + + if(75 to 100) + radiation -= 3 + adjustToxLoss(3) + if(prob(1)) + src << "\red You mutate!" + randmutb(src) + domutcheck(src,null) + emote("gasp") + updatehealth() - proc/breathe() - if(reagents) +/mob/living/carbon/monkey/proc/breathe() + if(reagents) - if(reagents.has_reagent("lexorin")) return + if(reagents.has_reagent("lexorin")) return - if(!loc) return //probably ought to make a proper fix for this, but :effort: --NeoFite + if(!loc) return //probably ought to make a proper fix for this, but :effort: --NeoFite - var/datum/gas_mixture/environment = loc.return_air() - var/datum/gas_mixture/breath - 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") + var/datum/gas_mixture/environment = loc.return_air() + var/datum/gas_mixture/breath + 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 + var/block = 0 + if(wear_mask) + if(istype(wear_mask, /obj/item/clothing/mask/gas)) + block = 1 + + if(!block) + + 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) - 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_breath(breath) - // Handle chem smoke effect -- Doohl - var/block = 0 - if(wear_mask) - if(istype(wear_mask, /obj/item/clothing/mask/gas)) - block = 1 - - if(!block) - - 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 + if(breath) + loc.assume_air(breath) - 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) - - - proc/get_breath_from_internal(volume_needed) +/mob/living/carbon/monkey/proc/get_breath_from_internal(volume_needed) + if(internal) + if (!contents.Find(internal)) + internal = null + if (!wear_mask || !(wear_mask.flags|MASKINTERNALS) ) + internal = null if(internal) - if (!contents.Find(internal)) - internal = null - if (!wear_mask || !(wear_mask.flags|MASKINTERNALS) ) - internal = null - if(internal) - if (internals) - internals.icon_state = "internal1" - return internal.remove_air_volume(volume_needed) - else - if (internals) - internals.icon_state = "internal0" - return null - - proc/handle_breath(datum/gas_mixture/breath) - if(status_flags & GODMODE) - return - - if(!breath || (breath.total_moles() == 0)) - adjustOxyLoss(7) - - oxygen_alert = max(oxygen_alert, 1) - - return 0 - - var/safe_oxygen_min = 16 // Minimum safe partial pressure of O2, in kPa - //var/safe_oxygen_max = 140 // Maximum safe partial pressure of O2, in kPa (Not used for now) - var/safe_co2_max = 10 // Yes it's an arbitrary value who cares? - var/safe_toxins_max = 0.5 - var/SA_para_min = 0.5 - var/SA_sleep_min = 5 - var/oxygen_used = 0 - var/breath_pressure = (breath.total_moles()*R_IDEAL_GAS_EQUATION*breath.temperature)/BREATH_VOLUME - - //Partial pressure of the O2 in our breath - var/O2_pp = (breath.oxygen/breath.total_moles())*breath_pressure - // Same, but for the toxins - var/Toxins_pp = (breath.toxins/breath.total_moles())*breath_pressure - // And CO2, lets say a PP of more than 10 will be bad (It's a little less really, but eh, being passed out all round aint no fun) - var/CO2_pp = (breath.carbon_dioxide/breath.total_moles())*breath_pressure - - if(O2_pp < safe_oxygen_min) // Too little oxygen - if(prob(20)) - spawn(0) emote("gasp") - if (O2_pp == 0) - O2_pp = 0.01 - var/ratio = safe_oxygen_min/O2_pp - adjustOxyLoss(min(5*ratio, 7)) // Don't fuck them up too fast (space only does 7 after all!) - oxygen_used = breath.oxygen*ratio/6 - oxygen_alert = max(oxygen_alert, 1) - /*else if (O2_pp > safe_oxygen_max) // Too much oxygen (commented this out for now, I'll deal with pressure damage elsewhere I suppose) - spawn(0) emote("cough") - var/ratio = O2_pp/safe_oxygen_max - oxyloss += 5*ratio - oxygen_used = breath.oxygen*ratio/6 - oxygen_alert = max(oxygen_alert, 1)*/ - else // We're in safe limits - adjustOxyLoss(-5) - oxygen_used = breath.oxygen/6 - oxygen_alert = 0 - - breath.oxygen -= oxygen_used - breath.carbon_dioxide += oxygen_used - - if(CO2_pp > safe_co2_max) - if(!co2overloadtime) // If it's the first breath with too much CO2 in it, lets start a counter, then have them pass out after 12s or so. - co2overloadtime = world.time - else if(world.time - co2overloadtime > 120) - Paralyse(3) - adjustOxyLoss(3) // Lets hurt em a little, let them know we mean business - if(world.time - co2overloadtime > 300) // They've been in here 30s now, lets start to kill them for their own good! - adjustOxyLoss(8) - if(prob(20)) // Lets give them some chance to know somethings not right though I guess. - spawn(0) emote("cough") - + if (internals) + internals.icon_state = "internal1" + return internal.remove_air_volume(volume_needed) else - co2overloadtime = 0 - - if(Toxins_pp > safe_toxins_max) // Too much toxins - var/ratio = (breath.toxins/safe_toxins_max) * 10 - //adjustToxLoss(Clamp(ratio, MIN_PLASMA_DAMAGE, MAX_PLASMA_DAMAGE)) //Limit amount of damage toxin exposure can do per second - if(reagents) - reagents.add_reagent("plasma", Clamp(ratio, MIN_PLASMA_DAMAGE, MAX_PLASMA_DAMAGE)) - toxins_alert = max(toxins_alert, 1) - else - toxins_alert = 0 - - if(breath.trace_gases.len) // If there's some other shit in the air lets deal with it here. - for(var/datum/gas/sleeping_agent/SA in breath.trace_gases) - var/SA_pp = (SA.moles/breath.total_moles())*breath_pressure - if(SA_pp > SA_para_min) // Enough to make us paralysed for a bit - Paralyse(3) // 3 gives them one second to wake up and run away a bit! - if(SA_pp > SA_sleep_min) // Enough to make us sleep as well - sleeping = max(sleeping+2, 10) - else if(SA_pp > 0.01) // There is sleeping gas in their lungs, but only a little, so give them a bit of a warning - if(prob(20)) - spawn(0) emote(pick("giggle", "laugh")) - - - if(breath.temperature > (T0C+66)) // Hot air hurts :( - if(prob(20)) - src << "\red You feel a searing heat in your lungs!" - fire_alert = max(fire_alert, 2) - else - fire_alert = 0 - - - //Temporary fixes to the alerts. - - return 1 - - proc/handle_environment(datum/gas_mixture/environment) - if(!environment) - return - var/environment_heat_capacity = environment.heat_capacity() - if(istype(get_turf(src), /turf/space)) - var/turf/heat_turf = get_turf(src) - environment_heat_capacity = heat_turf.heat_capacity - - if(!on_fire) - if((environment.temperature > (T0C + 50)) || (environment.temperature < (T0C + 10))) - var/transfer_coefficient = 1 - - handle_temperature_damage(HEAD, environment.temperature, environment_heat_capacity*transfer_coefficient) - - if(stat != 2) - bodytemperature += 0.1*(environment.temperature - bodytemperature)*environment_heat_capacity/(environment_heat_capacity + 270000) - - //Account for massive pressure differences - - var/pressure = environment.return_pressure() - var/adjusted_pressure = calculate_affecting_pressure(pressure) //Returns how much pressure actually affects the mob. - switch(adjusted_pressure) - if(HAZARD_HIGH_PRESSURE to INFINITY) - adjustBruteLoss( min( ( (adjusted_pressure / HAZARD_HIGH_PRESSURE) -1 )*PRESSURE_DAMAGE_COEFFICIENT , MAX_HIGH_PRESSURE_DAMAGE) ) - pressure_alert = 2 - if(WARNING_HIGH_PRESSURE to HAZARD_HIGH_PRESSURE) - pressure_alert = 1 - if(WARNING_LOW_PRESSURE to WARNING_HIGH_PRESSURE) - pressure_alert = 0 - if(HAZARD_LOW_PRESSURE to WARNING_LOW_PRESSURE) - pressure_alert = -1 - else - if( !(COLD_RESISTANCE in mutations) ) - adjustBruteLoss( LOW_PRESSURE_DAMAGE ) - pressure_alert = -2 - else - pressure_alert = -1 + if (internals) + internals.icon_state = "internal0" + return null +/mob/living/carbon/monkey/proc/handle_breath(datum/gas_mixture/breath) + if(status_flags & GODMODE) return - proc/handle_temperature_damage(body_part, exposed_temperature, exposed_intensity) - if(status_flags & GODMODE) return - var/discomfort = min( abs(exposed_temperature - bodytemperature)*(exposed_intensity)/2000000, 1.0) - //adjustFireLoss(2.5*discomfort) + if(!breath || (breath.total_moles() == 0)) + adjustOxyLoss(7) - if(exposed_temperature > bodytemperature) - adjustFireLoss(20.0*discomfort) + oxygen_alert = max(oxygen_alert, 1) + return 0 + + var/safe_oxygen_min = 16 // Minimum safe partial pressure of O2, in kPa + //var/safe_oxygen_max = 140 // Maximum safe partial pressure of O2, in kPa (Not used for now) + var/safe_co2_max = 10 // Yes it's an arbitrary value who cares? + var/safe_toxins_max = 0.5 + var/SA_para_min = 0.5 + var/SA_sleep_min = 5 + var/oxygen_used = 0 + var/breath_pressure = (breath.total_moles()*R_IDEAL_GAS_EQUATION*breath.temperature)/BREATH_VOLUME + + //Partial pressure of the O2 in our breath + var/O2_pp = (breath.oxygen/breath.total_moles())*breath_pressure + // Same, but for the toxins + var/Toxins_pp = (breath.toxins/breath.total_moles())*breath_pressure + // And CO2, lets say a PP of more than 10 will be bad (It's a little less really, but eh, being passed out all round aint no fun) + var/CO2_pp = (breath.carbon_dioxide/breath.total_moles())*breath_pressure + + if(O2_pp < safe_oxygen_min) // Too little oxygen + if(prob(20)) + spawn(0) emote("gasp") + if (O2_pp == 0) + O2_pp = 0.01 + var/ratio = safe_oxygen_min/O2_pp + adjustOxyLoss(min(5*ratio, 7)) // Don't fuck them up too fast (space only does 7 after all!) + oxygen_used = breath.oxygen*ratio/6 + oxygen_alert = max(oxygen_alert, 1) + /*else if (O2_pp > safe_oxygen_max) // Too much oxygen (commented this out for now, I'll deal with pressure damage elsewhere I suppose) + spawn(0) emote("cough") + var/ratio = O2_pp/safe_oxygen_max + oxyloss += 5*ratio + oxygen_used = breath.oxygen*ratio/6 + oxygen_alert = max(oxygen_alert, 1)*/ + else // We're in safe limits + adjustOxyLoss(-5) + oxygen_used = breath.oxygen/6 + oxygen_alert = 0 + + breath.oxygen -= oxygen_used + breath.carbon_dioxide += oxygen_used + + if(CO2_pp > safe_co2_max) + if(!co2overloadtime) // If it's the first breath with too much CO2 in it, lets start a counter, then have them pass out after 12s or so. + co2overloadtime = world.time + else if(world.time - co2overloadtime > 120) + Paralyse(3) + adjustOxyLoss(3) // Lets hurt em a little, let them know we mean business + if(world.time - co2overloadtime > 300) // They've been in here 30s now, lets start to kill them for their own good! + adjustOxyLoss(8) + if(prob(20)) // Lets give them some chance to know somethings not right though I guess. + spawn(0) emote("cough") + + else + co2overloadtime = 0 + + if(Toxins_pp > safe_toxins_max) // Too much toxins + var/ratio = (breath.toxins/safe_toxins_max) * 10 + //adjustToxLoss(Clamp(ratio, MIN_PLASMA_DAMAGE, MAX_PLASMA_DAMAGE)) //Limit amount of damage toxin exposure can do per second + if(reagents) + reagents.add_reagent("plasma", Clamp(ratio, MIN_PLASMA_DAMAGE, MAX_PLASMA_DAMAGE)) + toxins_alert = max(toxins_alert, 1) + else + toxins_alert = 0 + + if(breath.trace_gases.len) // If there's some other shit in the air lets deal with it here. + for(var/datum/gas/sleeping_agent/SA in breath.trace_gases) + var/SA_pp = (SA.moles/breath.total_moles())*breath_pressure + if(SA_pp > SA_para_min) // Enough to make us paralysed for a bit + Paralyse(3) // 3 gives them one second to wake up and run away a bit! + if(SA_pp > SA_sleep_min) // Enough to make us sleep as well + sleeping = max(sleeping+2, 10) + else if(SA_pp > 0.01) // There is sleeping gas in their lungs, but only a little, so give them a bit of a warning + if(prob(20)) + spawn(0) emote(pick("giggle", "laugh")) + + + if(breath.temperature > (T0C+66)) // Hot air hurts :( + if(prob(20)) + src << "\red You feel a searing heat in your lungs!" + fire_alert = max(fire_alert, 2) + else + fire_alert = 0 + + + //Temporary fixes to the alerts. + + return 1 + +/mob/living/carbon/monkey/proc/handle_environment(datum/gas_mixture/environment) + if(!environment) + return + var/environment_heat_capacity = environment.heat_capacity() + if(istype(get_turf(src), /turf/space)) + var/turf/heat_turf = get_turf(src) + environment_heat_capacity = heat_turf.heat_capacity + + if(!on_fire) + if((environment.temperature > (T0C + 50)) || (environment.temperature < (T0C + 10))) + var/transfer_coefficient = 1 + + handle_temperature_damage(HEAD, environment.temperature, environment_heat_capacity*transfer_coefficient) + + if(stat != 2) + bodytemperature += 0.1*(environment.temperature - bodytemperature)*environment_heat_capacity/(environment_heat_capacity + 270000) + + //Account for massive pressure differences + + var/pressure = environment.return_pressure() + var/adjusted_pressure = calculate_affecting_pressure(pressure) //Returns how much pressure actually affects the mob. + switch(adjusted_pressure) + if(HAZARD_HIGH_PRESSURE to INFINITY) + adjustBruteLoss( min( ( (adjusted_pressure / HAZARD_HIGH_PRESSURE) -1 )*PRESSURE_DAMAGE_COEFFICIENT , MAX_HIGH_PRESSURE_DAMAGE) ) + pressure_alert = 2 + if(WARNING_HIGH_PRESSURE to HAZARD_HIGH_PRESSURE) + pressure_alert = 1 + if(WARNING_LOW_PRESSURE to WARNING_HIGH_PRESSURE) + pressure_alert = 0 + if(HAZARD_LOW_PRESSURE to WARNING_LOW_PRESSURE) + pressure_alert = -1 else - adjustFireLoss(5.0*discomfort) - - proc/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) - else - dizziness = max(0, dizziness - 1) - - updatehealth() - - return //TODO: DEFERRED - - proc/handle_regular_status_updates() - updatehealth() - - if(stat == DEAD) //DEAD. BROWN BREAD. SWIMMING WITH THE SPESS CARP - blinded = 1 - silent = 0 - else //ALIVE. LIGHTS ARE ON - if(health < config.health_threshold_dead || !getorgan(/obj/item/organ/brain)) - death() - blinded = 1 - stat = DEAD - 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("inaprovaline")) - adjustOxyLoss(1) - Paralyse(3) - - if(paralysis) - AdjustParalysis(-1) - blinded = 1 - stat = UNCONSCIOUS - else if(sleeping) - sleeping = max(sleeping-1, 0) - blinded = 1 - stat = UNCONSCIOUS - if( prob(10) && health ) - spawn(0) - emote("snore") - //CONSCIOUS + if( !(COLD_RESISTANCE in mutations) ) + adjustBruteLoss( LOW_PRESSURE_DAMAGE ) + pressure_alert = -2 else - stat = CONSCIOUS + pressure_alert = -1 - //Eyes - if(sdisabilities & BLIND) //disabled-blind, doesn't get better on its own - blinded = 1 - else if(eye_blind) //blindness, heals slowly over time - eye_blind = max(eye_blind-1,0) - blinded = 1 - else if(eye_blurry) //blurry eyes heal slowly - eye_blurry = max(eye_blurry-1, 0) + return - //Ears - if(sdisabilities & DEAF) //disabled-deaf, doesn't get better on its own - ear_deaf = max(ear_deaf, 1) - else if(ear_deaf) //deafness, heals slowly over time - ear_deaf = max(ear_deaf-1, 0) - else if(ear_damage < 25) //ear damage heals slowly under this threshold. otherwise you'll need earmuffs - ear_damage = max(ear_damage-0.05, 0) +/mob/living/carbon/monkey/proc/handle_temperature_damage(body_part, exposed_temperature, exposed_intensity) + if(status_flags & GODMODE) return + var/discomfort = min( abs(exposed_temperature - bodytemperature)*(exposed_intensity)/2000000, 1.0) + //adjustFireLoss(2.5*discomfort) - //Other - if(stunned) - AdjustStunned(-1) + if(exposed_temperature > bodytemperature) + adjustFireLoss(20.0*discomfort) - if(weakened) - weakened = max(weakened-1,0) + else + adjustFireLoss(5.0*discomfort) - if(stuttering) - stuttering = max(stuttering-1, 0) +/mob/living/carbon/monkey/proc/handle_chemicals_in_body() - if(silent) - silent = max(silent-1, 0) + 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) + else + dizziness = max(0, dizziness - 1) + + updatehealth() + + return //TODO: DEFERRED + +/mob/living/carbon/monkey/proc/handle_regular_status_updates() + updatehealth() + + if(stat == DEAD) //DEAD. BROWN BREAD. SWIMMING WITH THE SPESS CARP + blinded = 1 + silent = 0 + else //ALIVE. LIGHTS ARE ON + if(health < config.health_threshold_dead || !getorgan(/obj/item/organ/brain)) + death() + blinded = 1 + stat = DEAD + 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("inaprovaline")) + adjustOxyLoss(1) + Paralyse(3) + + if(paralysis) + AdjustParalysis(-1) + blinded = 1 + stat = UNCONSCIOUS + else if(sleeping) + sleeping = max(sleeping-1, 0) + blinded = 1 + stat = UNCONSCIOUS + if( prob(10) && health ) + spawn(0) + emote("snore") + //CONSCIOUS + else + stat = CONSCIOUS + + //Eyes + if(sdisabilities & BLIND) //disabled-blind, doesn't get better on its own + blinded = 1 + else if(eye_blind) //blindness, heals slowly over time + eye_blind = max(eye_blind-1,0) + blinded = 1 + else if(eye_blurry) //blurry eyes heal slowly + eye_blurry = max(eye_blurry-1, 0) + + //Ears + if(sdisabilities & DEAF) //disabled-deaf, doesn't get better on its own + ear_deaf = max(ear_deaf, 1) + else if(ear_deaf) //deafness, heals slowly over time + ear_deaf = max(ear_deaf-1, 0) + else if(ear_damage < 25) //ear damage heals slowly under this threshold. otherwise you'll need earmuffs + ear_damage = max(ear_damage-0.05, 0) + + //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) + + CheckStamina() + return 1 + + +/mob/living/carbon/monkey/proc/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_TURFS + sight &= ~SEE_MOBS + sight &= ~SEE_OBJS + see_in_dark = 2 + see_invisible = SEE_INVISIBLE_LIVING + if(see_override) + see_invisible = see_override + + 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(pressure) + pressure.icon_state = "pressure[pressure_alert]" + + 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 ? 2 : 0]" + //NOTE: the alerts dont reset when youre out of danger. dont blame me, + //blame the person who coded them. Temporary fix added. + + if(bodytemp) + switch(bodytemperature) //310.055 optimal body temp + if(345 to INFINITY) + bodytemp.icon_state = "temp4" + if(335 to 345) + bodytemp.icon_state = "temp3" + if(327 to 335) + bodytemp.icon_state = "temp2" + if(316 to 327) + bodytemp.icon_state = "temp1" + if(300 to 316) + bodytemp.icon_state = "temp0" + if(295 to 300) + bodytemp.icon_state = "temp-1" + if(280 to 295) + bodytemp.icon_state = "temp-2" + if(260 to 280) + bodytemp.icon_state = "temp-3" + else + bodytemp.icon_state = "temp-4" + + client.screen.Remove(global_hud.blurry,global_hud.druggy,global_hud.vimpaired) + + if(blind && stat != DEAD) + 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) - druggy = max(druggy-1, 0) + client.screen += global_hud.druggy - CheckStamina() - return 1 + if (stat != 2) + if (machine) + if (!( machine.check_eye(src) )) + reset_view(null) + else + if(!client.adminobs) + reset_view(null) + + return 1 + +/mob/living/carbon/monkey/proc/handle_random_events() + if (prob(1) && prob(2)) + spawn(0) + emote("scratch") + return - proc/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_TURFS - sight &= ~SEE_MOBS - sight &= ~SEE_OBJS - see_in_dark = 2 - see_invisible = SEE_INVISIBLE_LIVING - if(see_override) - see_invisible = see_override - - 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(pressure) - pressure.icon_state = "pressure[pressure_alert]" - - 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 ? 2 : 0]" - //NOTE: the alerts dont reset when youre out of danger. dont blame me, - //blame the person who coded them. Temporary fix added. - - if(bodytemp) - switch(bodytemperature) //310.055 optimal body temp - if(345 to INFINITY) - bodytemp.icon_state = "temp4" - if(335 to 345) - bodytemp.icon_state = "temp3" - if(327 to 335) - bodytemp.icon_state = "temp2" - if(316 to 327) - bodytemp.icon_state = "temp1" - if(300 to 316) - bodytemp.icon_state = "temp0" - if(295 to 300) - bodytemp.icon_state = "temp-1" - if(280 to 295) - bodytemp.icon_state = "temp-2" - if(260 to 280) - bodytemp.icon_state = "temp-3" - else - bodytemp.icon_state = "temp-4" - - client.screen.Remove(global_hud.blurry,global_hud.druggy,global_hud.vimpaired) - - if(blind && stat != DEAD) - 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 - - proc/handle_random_events() - if (prob(1) && prob(2)) - spawn(0) - emote("scratch") - return - - - proc/handle_changeling() - if(mind && mind.changeling) - mind.changeling.regenerate() - hud_used.lingchemdisplay.invisibility = 0 - hud_used.lingchemdisplay.maptext = "
[src.mind.changeling.chem_charges]
" +/mob/living/carbon/monkey/proc/handle_changeling() + if(mind && mind.changeling) + mind.changeling.regenerate() + hud_used.lingchemdisplay.invisibility = 0 + hud_used.lingchemdisplay.maptext = "
[src.mind.changeling.chem_charges]
" ///FIRE CODE - handle_fire() - if(..()) - return - adjustFireLoss(6) +/mob/living/carbon/monkey/handle_fire() + if(..()) return -//END FIRE CODE \ No newline at end of file + adjustFireLoss(6) + return +//END FIRE CODE diff --git a/code/modules/mob/living/silicon/pai/recruit.dm b/code/modules/mob/living/silicon/pai/recruit.dm index eb6384f17fa..b5a4f0ee025 100644 --- a/code/modules/mob/living/silicon/pai/recruit.dm +++ b/code/modules/mob/living/silicon/pai/recruit.dm @@ -20,198 +20,198 @@ var/datum/paiController/paiController // Global handler for pAI candidates var/askDelay = 10 * 60 * 1 // One minute [ms * sec * min] - Topic(href, href_list[]) - if(href_list["download"]) - var/datum/paiCandidate/candidate = locate(href_list["candidate"]) - var/obj/item/device/paicard/card = locate(href_list["device"]) - if(card.pai) +/datum/paiController/Topic(href, href_list[]) + if(href_list["download"]) + var/datum/paiCandidate/candidate = locate(href_list["candidate"]) + var/obj/item/device/paicard/card = locate(href_list["device"]) + if(card.pai) + return + if(istype(card,/obj/item/device/paicard) && istype(candidate,/datum/paiCandidate)) + var/mob/living/silicon/pai/pai = new(card) + if(!candidate.name) + pai.name = pick(ninja_names) + else + pai.name = candidate.name + pai.real_name = pai.name + pai.key = candidate.key + + card.setPersonality(pai) + card.looking_for_personality = 0 + + ticker.mode.update_cult_icons_removed(card.pai.mind) + ticker.mode.update_rev_icons_removed(card.pai.mind) + + pai_candidates -= candidate + usr << browse(null, "window=findPai") + + if(href_list["new"]) + var/datum/paiCandidate/candidate = locate(href_list["candidate"]) + var/option = href_list["option"] + var/t = "" + + switch(option) + if("name") + t = input("Enter a name for your pAI", "pAI Name", candidate.name) as text + if(t) + candidate.name = copytext(sanitize(t),1,MAX_NAME_LEN) + if("desc") + t = input("Enter a description for your pAI", "pAI Description", candidate.description) as message + if(t) + candidate.description = copytext(sanitize(t),1,MAX_MESSAGE_LEN) + if("role") + t = input("Enter a role for your pAI", "pAI Role", candidate.role) as text + if(t) + candidate.role = copytext(sanitize(t),1,MAX_MESSAGE_LEN) + if("ooc") + t = input("Enter any OOC comments", "pAI OOC Comments", candidate.comments) as message + if(t) + candidate.comments = copytext(sanitize(t),1,MAX_MESSAGE_LEN) + if("save") + candidate.savefile_save(usr) + if("load") + candidate.savefile_load(usr) + //In case people have saved unsanitized stuff. + if(candidate.name) + candidate.name = copytext(sanitize(candidate.name),1,MAX_NAME_LEN) + if(candidate.description) + candidate.description = copytext(sanitize(candidate.description),1,MAX_MESSAGE_LEN) + if(candidate.role) + candidate.role = copytext(sanitize(candidate.role),1,MAX_MESSAGE_LEN) + if(candidate.comments) + candidate.comments = copytext(sanitize(candidate.comments),1,MAX_MESSAGE_LEN) + + if("submit") + if(candidate) + candidate.ready = 1 + for(var/obj/item/device/paicard/p in world) + if(p.looking_for_personality == 1) + p.alertUpdate() + usr << browse(null, "window=paiRecruit") return - if(istype(card,/obj/item/device/paicard) && istype(candidate,/datum/paiCandidate)) - var/mob/living/silicon/pai/pai = new(card) - if(!candidate.name) - pai.name = pick(ninja_names) - else - pai.name = candidate.name - pai.real_name = pai.name - pai.key = candidate.key + recruitWindow(usr) - card.setPersonality(pai) - card.looking_for_personality = 0 - - ticker.mode.update_cult_icons_removed(card.pai.mind) - ticker.mode.update_rev_icons_removed(card.pai.mind) - - pai_candidates -= candidate - usr << browse(null, "window=findPai") - - if(href_list["new"]) - var/datum/paiCandidate/candidate = locate(href_list["candidate"]) - var/option = href_list["option"] - var/t = "" - - switch(option) - if("name") - t = input("Enter a name for your pAI", "pAI Name", candidate.name) as text - if(t) - candidate.name = copytext(sanitize(t),1,MAX_NAME_LEN) - if("desc") - t = input("Enter a description for your pAI", "pAI Description", candidate.description) as message - if(t) - candidate.description = copytext(sanitize(t),1,MAX_MESSAGE_LEN) - if("role") - t = input("Enter a role for your pAI", "pAI Role", candidate.role) as text - if(t) - candidate.role = copytext(sanitize(t),1,MAX_MESSAGE_LEN) - if("ooc") - t = input("Enter any OOC comments", "pAI OOC Comments", candidate.comments) as message - if(t) - candidate.comments = copytext(sanitize(t),1,MAX_MESSAGE_LEN) - if("save") - candidate.savefile_save(usr) - if("load") - candidate.savefile_load(usr) - //In case people have saved unsanitized stuff. - if(candidate.name) - candidate.name = copytext(sanitize(candidate.name),1,MAX_NAME_LEN) - if(candidate.description) - candidate.description = copytext(sanitize(candidate.description),1,MAX_MESSAGE_LEN) - if(candidate.role) - candidate.role = copytext(sanitize(candidate.role),1,MAX_MESSAGE_LEN) - if(candidate.comments) - candidate.comments = copytext(sanitize(candidate.comments),1,MAX_MESSAGE_LEN) - - if("submit") - if(candidate) - candidate.ready = 1 - for(var/obj/item/device/paicard/p in world) - if(p.looking_for_personality == 1) - p.alertUpdate() - usr << browse(null, "window=paiRecruit") - return - recruitWindow(usr) - - proc/recruitWindow(var/mob/M as mob) - var/datum/paiCandidate/candidate - for(var/datum/paiCandidate/c in pai_candidates) - if(c.key == M.key) - candidate = c - if(!candidate) - candidate = new /datum/paiCandidate() - candidate.key = M.key - pai_candidates.Add(candidate) +/datum/paiController/proc/recruitWindow(var/mob/M as mob) + var/datum/paiCandidate/candidate + for(var/datum/paiCandidate/c in pai_candidates) + if(c.key == M.key) + candidate = c + if(!candidate) + candidate = new /datum/paiCandidate() + candidate.key = M.key + pai_candidates.Add(candidate) - var/dat = "" - dat += {" - - "} + tr.d0 td { + background-color: #CC9999; color: black; + } + tr.d1 td { + background-color: #9999CC; color: black; + } + + "} - dat += "

Please configure your pAI personality's options. Remember, what you enter here could determine whether or not the user requesting a personality chooses you!

" - dat += "" - dat += "" - dat += "" + dat += "

Please configure your pAI personality's options. Remember, what you enter here could determine whether or not the user requesting a personality chooses you!

" + dat += "
Name:[candidate.name]
\[Edit\]What you plan to call yourself. Suggestions: Any character name you would choose for a station character OR an AI.
" + dat += "" + dat += "" - dat += "" - dat += "" + dat += "" + dat += "" - dat += "" - dat += "" + dat += "" + dat += "" - dat += "" - dat += "" + dat += "" + dat += "" - dat += "
Name:[candidate.name]
\[Edit\]What you plan to call yourself. Suggestions: Any character name you would choose for a station character OR an AI.
Description:[candidate.description]
\[Edit\]What sort of pAI you typically play; your mannerisms, your quirks, etc. This can be as sparse or as detailed as you like.
Description:[candidate.description]
\[Edit\]What sort of pAI you typically play; your mannerisms, your quirks, etc. This can be as sparse or as detailed as you like.
Preferred Role:[candidate.role]
\[Edit\]Do you like to partner with sneaky social ninjas? Like to help security hunt down thugs? Enjoy watching an engineer's back while he saves the station yet again? This doesn't have to be limited to just station jobs. Pretty much any general descriptor for what you'd like to be doing works here.
Preferred Role:[candidate.role]
\[Edit\]Do you like to partner with sneaky social ninjas? Like to help security hunt down thugs? Enjoy watching an engineer's back while he saves the station yet again? This doesn't have to be limited to just station jobs. Pretty much any general descriptor for what you'd like to be doing works here.
OOC Comments:[candidate.comments]
\[Edit\]Anything you'd like to address specifically to the player reading this in an OOC manner. \"I prefer more serious RP.\", \"I'm still learning the interface!\", etc. Feel free to leave this blank if you want.
OOC Comments:[candidate.comments]
\[Edit\]Anything you'd like to address specifically to the player reading this in an OOC manner. \"I prefer more serious RP.\", \"I'm still learning the interface!\", etc. Feel free to leave this blank if you want.
" + dat += "" - dat += "
" - dat += "

Submit Personality


" - dat += "Save Personality
" - dat += "Load Personality
" + dat += "
" + dat += "

Submit Personality


" + dat += "Save Personality
" + dat += "Load Personality
" - M << browse(dat, "window=paiRecruit") + M << browse(dat, "window=paiRecruit") - proc/findPAI(var/obj/item/device/paicard/p, var/mob/user) - requestRecruits() - var/list/available = list() - for(var/datum/paiCandidate/c in paiController.pai_candidates) - if(c.ready) - var/found = 0 - for(var/mob/dead/observer/o in player_list) - if(o.key == c.key) - found = 1 - if(found) - available.Add(c) - var/dat = "" +/datum/paiController/proc/findPAI(var/obj/item/device/paicard/p, var/mob/user) + requestRecruits() + var/list/available = list() + for(var/datum/paiCandidate/c in paiController.pai_candidates) + if(c.ready) + var/found = 0 + for(var/mob/dead/observer/o in player_list) + if(o.key == c.key) + found = 1 + if(found) + available.Add(c) + var/dat = "" - dat += {" - - "} - dat += "

Requesting AI personalities from central database... If there are no entries, or if a suitable entry is not listed, check again later as more personalities may be added.

" + tr.d0 td { + background-color: #CC9999; color: black; + } + tr.d1 td { + background-color: #9999CC; color: black; + } + tr.d2 td { + background-color: #99CC99; color: black; + } + + "} + dat += "

Requesting AI personalities from central database... If there are no entries, or if a suitable entry is not listed, check again later as more personalities may be added.

" - dat += "" + dat += "
" - for(var/datum/paiCandidate/c in available) - dat += "" - dat += "" - dat += "" - dat += "" - dat += "" + for(var/datum/paiCandidate/c in available) + dat += "" + dat += "" + dat += "" + dat += "" + dat += "" - dat += "
Name:[c.name]
Description:[c.description]
Preferred Role:[c.role]
OOC Comments:[c.comments]
\[Download [c.name]\]
Name:[c.name]
Description:[c.description]
Preferred Role:[c.role]
OOC Comments:[c.comments]
\[Download [c.name]\]
" + dat += "" - user << browse(dat, "window=findPai") + user << browse(dat, "window=findPai") - proc/requestRecruits() - for(var/mob/dead/observer/O in player_list) - if(jobban_isbanned(O, "pAI")) +/datum/paiController/proc/requestRecruits() + for(var/mob/dead/observer/O in player_list) + if(jobban_isbanned(O, "pAI")) + continue + if(asked.Find(O.key)) + if(world.time < asked[O.key] + askDelay) continue - if(asked.Find(O.key)) - if(world.time < asked[O.key] + askDelay) - continue - else - asked.Remove(O.key) - if(O.client) - var/hasSubmitted = 0 - for(var/datum/paiCandidate/c in paiController.pai_candidates) - if(c.key == O.key) - hasSubmitted = 1 - if(!hasSubmitted && (O.client.prefs.be_special & BE_PAI)) - question(O.client) + else + asked.Remove(O.key) + if(O.client) + var/hasSubmitted = 0 + for(var/datum/paiCandidate/c in paiController.pai_candidates) + if(c.key == O.key) + hasSubmitted = 1 + if(!hasSubmitted && (O.client.prefs.be_special & BE_PAI)) + question(O.client) - proc/question(var/client/C) - spawn(0) - if(!C) return - asked.Add(C.key) - asked[C.key] = world.time - var/response = alert(C, "Someone is requesting a pAI personality. Would you like to play as a personal AI?", "pAI Request", "Yes", "No", "Never for this round") - if(!C) return //handle logouts that happen whilst the alert is waiting for a response. - if(response == "Yes") - recruitWindow(C.mob) - else if (response == "Never for this round") - asked[C.key] = INFINITY +/datum/paiController/proc/question(var/client/C) + spawn(0) + if(!C) return + asked.Add(C.key) + asked[C.key] = world.time + var/response = alert(C, "Someone is requesting a pAI personality. Would you like to play as a personal AI?", "pAI Request", "Yes", "No", "Never for this round") + if(!C) return //handle logouts that happen whilst the alert is waiting for a response. + if(response == "Yes") + recruitWindow(C.mob) + else if (response == "Never for this round") + asked[C.key] = INFINITY diff --git a/code/modules/mob/living/silicon/robot/robot_modules.dm b/code/modules/mob/living/silicon/robot/robot_modules.dm index 819101c1a70..e9faf2b07f2 100644 --- a/code/modules/mob/living/silicon/robot/robot_modules.dm +++ b/code/modules/mob/living/silicon/robot/robot_modules.dm @@ -61,176 +61,177 @@ /obj/item/weapon/robot_module/standard name = "standard robot module" - New() - ..() - modules += new /obj/item/weapon/melee/baton/loaded(src) - modules += new /obj/item/weapon/extinguisher(src) - modules += new /obj/item/weapon/wrench(src) - modules += new /obj/item/weapon/crowbar(src) - modules += new /obj/item/device/healthanalyzer(src) - emag = new /obj/item/weapon/melee/energy/sword(src) +/obj/item/weapon/robot_module/standard/New() + ..() + modules += new /obj/item/weapon/melee/baton/loaded(src) + modules += new /obj/item/weapon/extinguisher(src) + modules += new /obj/item/weapon/wrench(src) + modules += new /obj/item/weapon/crowbar(src) + modules += new /obj/item/device/healthanalyzer(src) + emag = new /obj/item/weapon/melee/energy/sword(src) /obj/item/weapon/robot_module/medical name = "medical robot module" - New() - ..() - modules += new /obj/item/borg/sight/hud/med(src) - modules += new /obj/item/device/healthanalyzer(src) - modules += new /obj/item/weapon/reagent_containers/borghypo(src) - modules += new /obj/item/weapon/reagent_containers/glass/beaker/large(src) - modules += new /obj/item/weapon/reagent_containers/dropper(src) - modules += new /obj/item/weapon/reagent_containers/syringe(src) - modules += new /obj/item/weapon/extinguisher/mini(src) - emag = new /obj/item/weapon/reagent_containers/spray(src) +/obj/item/weapon/robot_module/medical/New() + ..() + modules += new /obj/item/borg/sight/hud/med(src) + modules += new /obj/item/device/healthanalyzer(src) + modules += new /obj/item/weapon/reagent_containers/borghypo(src) + modules += new /obj/item/weapon/reagent_containers/glass/beaker/large(src) + modules += new /obj/item/weapon/reagent_containers/dropper(src) + modules += new /obj/item/weapon/reagent_containers/syringe(src) + modules += new /obj/item/weapon/extinguisher/mini(src) + emag = new /obj/item/weapon/reagent_containers/spray(src) - emag.reagents.add_reagent("pacid", 250) - emag.name = "polyacid spray" + emag.reagents.add_reagent("pacid", 250) + emag.name = "polyacid spray" /obj/item/weapon/robot_module/engineering name = "engineering robot module" - New() - ..() - modules += new /obj/item/borg/sight/meson(src) - emag = new /obj/item/borg/stun(src) - modules += new /obj/item/weapon/rcd/borg(src) - modules += new /obj/item/weapon/extinguisher(src) - modules += new /obj/item/weapon/weldingtool/largetank/cyborg(src) - modules += new /obj/item/weapon/screwdriver(src) - modules += new /obj/item/weapon/wrench(src) - modules += new /obj/item/weapon/crowbar(src) - modules += new /obj/item/weapon/wirecutters(src) - modules += new /obj/item/device/multitool(src) - modules += new /obj/item/device/t_scanner(src) - modules += new /obj/item/device/analyzer(src) +/obj/item/weapon/robot_module/engineering/New() + ..() + modules += new /obj/item/borg/sight/meson(src) + emag = new /obj/item/borg/stun(src) + modules += new /obj/item/weapon/rcd/borg(src) + modules += new /obj/item/weapon/extinguisher(src) + modules += new /obj/item/weapon/weldingtool/largetank/cyborg(src) + modules += new /obj/item/weapon/screwdriver(src) + modules += new /obj/item/weapon/wrench(src) + modules += new /obj/item/weapon/crowbar(src) + modules += new /obj/item/weapon/wirecutters(src) + modules += new /obj/item/device/multitool(src) + modules += new /obj/item/device/t_scanner(src) + modules += new /obj/item/device/analyzer(src) - var/datum/robot_energy_storage/metal/metstore = new /datum/robot_energy_storage/metal(src) - var/datum/robot_energy_storage/glass/glastore = new /datum/robot_energy_storage/glass(src) - var/datum/robot_energy_storage/wire/wirestore = new /datum/robot_energy_storage/wire(src) + var/datum/robot_energy_storage/metal/metstore = new /datum/robot_energy_storage/metal(src) + var/datum/robot_energy_storage/glass/glastore = new /datum/robot_energy_storage/glass(src) + var/datum/robot_energy_storage/wire/wirestore = new /datum/robot_energy_storage/wire(src) - var/obj/item/stack/sheet/metal/cyborg/M = new /obj/item/stack/sheet/metal/cyborg(src) - M.source = metstore - modules += M + var/obj/item/stack/sheet/metal/cyborg/M = new /obj/item/stack/sheet/metal/cyborg(src) + M.source = metstore + modules += M - var/obj/item/stack/sheet/glass/cyborg/Q = new /obj/item/stack/sheet/glass/cyborg(src) - Q.source = glastore - modules += Q + var/obj/item/stack/sheet/glass/cyborg/Q = new /obj/item/stack/sheet/glass/cyborg(src) + Q.source = glastore + modules += Q - var/obj/item/stack/sheet/rglass/cyborg/G = new /obj/item/stack/sheet/rglass/cyborg(src) - G.metsource = metstore - G.glasource = glastore - modules += G + var/obj/item/stack/sheet/rglass/cyborg/G = new /obj/item/stack/sheet/rglass/cyborg(src) + G.metsource = metstore + G.glasource = glastore + modules += G - var/obj/item/stack/rods/cyborg/R = new /obj/item/stack/rods/cyborg(src) - R.source = metstore - modules += R + var/obj/item/stack/rods/cyborg/R = new /obj/item/stack/rods/cyborg(src) + R.source = metstore + modules += R - var/obj/item/stack/cable_coil/cyborg/W = new /obj/item/stack/cable_coil/cyborg(src) - W.source = wirestore - modules += W + var/obj/item/stack/cable_coil/cyborg/W = new /obj/item/stack/cable_coil/cyborg(src) + W.source = wirestore + modules += W - var/obj/item/stack/tile/plasteel/cyborg/F = new /obj/item/stack/tile/plasteel/cyborg(src) //"Plasteel" is the normal metal floor tile, Don't be confused - RR - F.source = metstore - modules += F //'F' for floor tile - RR(src) + var/obj/item/stack/tile/plasteel/cyborg/F = new /obj/item/stack/tile/plasteel/cyborg(src) //"Plasteel" is the normal metal floor tile, Don't be confused - RR + F.source = metstore + modules += F //'F' for floor tile - RR(src) - storages += metstore - storages += glastore - storages += wirestore + storages += metstore + storages += glastore + storages += wirestore /obj/item/weapon/robot_module/security name = "security robot module" - New() - ..() - modules += new /obj/item/borg/sight/hud/sec(src) - modules += new /obj/item/weapon/handcuffs/cyborg(src) - modules += new /obj/item/weapon/melee/baton/loaded(src) - modules += new /obj/item/weapon/gun/energy/taser/cyborg(src) - modules += new /obj/item/clothing/mask/gas/sechailer/cyborg(src) - emag = new /obj/item/weapon/gun/energy/laser/cyborg(src) +/obj/item/weapon/robot_module/security/New() + ..() + modules += new /obj/item/borg/sight/hud/sec(src) + modules += new /obj/item/weapon/handcuffs/cyborg(src) + modules += new /obj/item/weapon/melee/baton/loaded(src) + modules += new /obj/item/weapon/gun/energy/taser/cyborg(src) + modules += new /obj/item/clothing/mask/gas/sechailer/cyborg(src) + emag = new /obj/item/weapon/gun/energy/laser/cyborg(src) /obj/item/weapon/robot_module/janitor name = "janitorial robot module" - New() - ..() - modules += new /obj/item/weapon/soap/nanotrasen(src) - modules += new /obj/item/weapon/storage/bag/trash/cyborg(src) - modules += new /obj/item/weapon/mop/cyborg(src) - modules += new /obj/item/device/lightreplacer/cyborg(src) - emag = new /obj/item/weapon/reagent_containers/spray(src) +/obj/item/weapon/robot_module/janitor/New() + ..() + modules += new /obj/item/weapon/soap/nanotrasen(src) + modules += new /obj/item/weapon/storage/bag/trash/cyborg(src) + modules += new /obj/item/weapon/mop/cyborg(src) + modules += new /obj/item/device/lightreplacer/cyborg(src) + emag = new /obj/item/weapon/reagent_containers/spray(src) - emag.reagents.add_reagent("lube", 250) - emag.name = "lube spray" + emag.reagents.add_reagent("lube", 250) + emag.name = "lube spray" /obj/item/weapon/robot_module/butler name = "service robot module" - New() - ..() - modules += new /obj/item/weapon/reagent_containers/food/drinks/drinkingglass(src) - modules += new /obj/item/weapon/reagent_containers/food/condiment/enzyme(src) - modules += new /obj/item/weapon/pen(src) - modules += new /obj/item/weapon/razor(src) - modules += new /obj/item/device/violin(src) +/obj/item/weapon/robot_module/butler/New() + ..() + modules += new /obj/item/weapon/reagent_containers/food/drinks/drinkingglass(src) + modules += new /obj/item/weapon/reagent_containers/food/condiment/enzyme(src) + modules += new /obj/item/weapon/pen(src) + modules += new /obj/item/weapon/razor(src) + modules += new /obj/item/device/violin(src) - var/obj/item/weapon/rsf/M = new /obj/item/weapon/rsf(src) - M.matter = 30 - modules += M + var/obj/item/weapon/rsf/M = new /obj/item/weapon/rsf(src) + M.matter = 30 + modules += M - modules += new /obj/item/weapon/reagent_containers/dropper(src) + modules += new /obj/item/weapon/reagent_containers/dropper(src) - var/obj/item/weapon/lighter/zippo/L = new /obj/item/weapon/lighter/zippo(src) - L.lit = 1 - modules += L + var/obj/item/weapon/lighter/zippo/L = new /obj/item/weapon/lighter/zippo(src) + L.lit = 1 + modules += L - modules += new /obj/item/weapon/storage/bag/tray(src) - modules += new /obj/item/weapon/reagent_containers/borghypo/borgshaker(src) - emag = new /obj/item/weapon/reagent_containers/borghypo/borgshaker/hacked(src) + modules += new /obj/item/weapon/storage/bag/tray(src) + modules += new /obj/item/weapon/reagent_containers/borghypo/borgshaker(src) + emag = new /obj/item/weapon/reagent_containers/borghypo/borgshaker/hacked(src) /obj/item/weapon/robot_module/miner name = "miner robot module" - New() - ..() - var/mob/living/silicon/robot/R = loc - modules += new /obj/item/borg/sight/meson(src) - emag = new /obj/item/borg/stun(src) - modules += new /obj/item/weapon/storage/bag/ore(src) - if(R.emagged) - modules += new /obj/item/weapon/pickaxe/diamonddrill(src) - else - modules += new /obj/item/weapon/pickaxe/borgdrill(src) - modules += new /obj/item/weapon/storage/bag/sheetsnatcher/borg(src) - modules += new /obj/item/device/mining_scanner(src) - modules += new /obj/item/weapon/gun/energy/kinetic_accelerator(src) - on_emag() - ..() - for(var/obj/item/weapon/pickaxe/borgdrill/D in modules) - qdel(D) +/obj/item/weapon/robot_module/miner/New() + ..() + var/mob/living/silicon/robot/R = loc + modules += new /obj/item/borg/sight/meson(src) + emag = new /obj/item/borg/stun(src) + modules += new /obj/item/weapon/storage/bag/ore(src) + if(R.emagged) modules += new /obj/item/weapon/pickaxe/diamonddrill(src) - rebuild() + else + modules += new /obj/item/weapon/pickaxe/borgdrill(src) + modules += new /obj/item/weapon/storage/bag/sheetsnatcher/borg(src) + modules += new /obj/item/device/mining_scanner(src) + modules += new /obj/item/weapon/gun/energy/kinetic_accelerator(src) + +/obj/item/weapon/robot_module/miner/on_emag() + ..() + for(var/obj/item/weapon/pickaxe/borgdrill/D in modules) + qdel(D) + modules += new /obj/item/weapon/pickaxe/diamonddrill(src) + rebuild() /obj/item/weapon/robot_module/syndicate name = "syndicate robot module" - New() - ..() - modules += new /obj/item/weapon/melee/energy/sword/cyborg(src) - modules += new /obj/item/weapon/gun/energy/crossbow/cyborg(src) - modules += new /obj/item/weapon/card/emag(src) - modules += new /obj/item/weapon/gun/energy/laser/cyborg(src) - modules += new /obj/item/weapon/tank/jetpack/carbondioxide(src) - modules += new /obj/item/weapon/crowbar(src) - emag = null +/obj/item/weapon/robot_module/syndicate/New() + ..() + modules += new /obj/item/weapon/melee/energy/sword/cyborg(src) + modules += new /obj/item/weapon/gun/energy/crossbow/cyborg(src) + modules += new /obj/item/weapon/card/emag(src) + modules += new /obj/item/weapon/gun/energy/laser/cyborg(src) + modules += new /obj/item/weapon/tank/jetpack/carbondioxide(src) + modules += new /obj/item/weapon/crowbar(src) + emag = null /datum/robot_energy_storage var/name = "Generic energy storage" diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index 0ebc94fedd1..8d5326e2dd3 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -14,353 +14,353 @@ anchored = 1 // don't get pushed around - New() - tag = "mob_[next_mob_id++]" - mob_list += src +/mob/new_player/New() + tag = "mob_[next_mob_id++]" + mob_list += src - proc/new_player_panel() +/mob/new_player/proc/new_player_panel() - var/output = "

Setup Character

" + var/output = "

Setup Character

" - if(!ticker || ticker.current_state <= GAME_STATE_PREGAME) - if(!ready) output += "

Declare Ready

" - else output += "

You are ready Cancel

" + if(!ticker || ticker.current_state <= GAME_STATE_PREGAME) + if(!ready) output += "

Declare Ready

" + else output += "

You are ready Cancel

" - else - output += "

Join Game!

" + else + output += "

Join Game!

" - output += "

Observe

" + output += "

Observe

" - if(!IsGuestKey(src.key)) - establish_db_connection() + if(!IsGuestKey(src.key)) + establish_db_connection() - if(dbcon.IsConnected()) - var/isadmin = 0 - if(src.client && src.client.holder) - isadmin = 1 - var/DBQuery/query = dbcon.NewQuery("SELECT id FROM erro_poll_question WHERE [(isadmin ? "" : "adminonly = false AND")] Now() BETWEEN starttime AND endtime AND id NOT IN (SELECT pollid FROM erro_poll_vote WHERE ckey = \"[ckey]\") AND id NOT IN (SELECT pollid FROM erro_poll_textreply WHERE ckey = \"[ckey]\")") - query.Execute() - var/newpoll = 0 - while(query.NextRow()) - newpoll = 1 - break - - if(newpoll) - output += "

Show Player Polls (NEW!)

" - else - output += "

Show Player Polls

" - - output += "
" - - //src << browse(output,"window=playersetup;size=210x240;can_close=0") - var/datum/browser/popup = new(src, "playersetup", "
New Player Options
", 210, 240) - popup.set_window_options("can_close=0") - popup.set_content(output) - popup.open(0) - return - - Stat() - ..() - - statpanel("Lobby") - if(client.statpanel == "Lobby" && ticker) - if(ticker.hide_mode) - stat("Game Mode:", "Secret") - else - stat("Game Mode:", "[master_mode]") - - if((ticker.current_state == GAME_STATE_PREGAME) && going) - stat("Time To Start:", ticker.pregame_timeleft) - if((ticker.current_state == GAME_STATE_PREGAME) && !going) - stat("Time To Start:", "DELAYED") - - if(ticker.current_state == GAME_STATE_PREGAME) - stat("Players: [totalPlayers]", "Players Ready: [totalPlayersReady]") - totalPlayers = 0 - totalPlayersReady = 0 - for(var/mob/new_player/player in player_list) - stat("[player.key]", (player.ready)?("(Playing)"):(null)) - totalPlayers++ - if(player.ready)totalPlayersReady++ - - Topic(href, href_list[]) - if(src != usr) - return 0 - - if(!client) return 0 - - if(href_list["show_preferences"]) - client.prefs.ShowChoices(src) - return 1 - - if(href_list["ready"]) - ready = text2num(href_list["ready"]) - - if(href_list["refresh"]) - src << browse(null, "window=playersetup") //closes the player setup window - new_player_panel() - - if(href_list["observe"]) - - if(alert(src,"Are you sure you wish to observe? You will not be able to play this round!","Player Setup","Yes","No") == "Yes") - if(!client) return 1 - var/mob/dead/observer/observer = new() - - spawning = 1 - src << sound(null, repeat = 0, wait = 0, volume = 85, channel = 1) // MAD JAMS cant last forever yo - - observer.started_as_observer = 1 - close_spawn_windows() - var/obj/O = locate("landmark*Observer-Start") - src << "\blue Now teleporting." - observer.loc = O.loc - if(client.prefs.be_random_name) - client.prefs.real_name = random_name(gender) - observer.real_name = client.prefs.real_name - observer.name = observer.real_name - observer.key = key - qdel(mind) - - qdel(src) - return 1 - - if(href_list["late_join"]) - if(!ticker || ticker.current_state != GAME_STATE_PLAYING) - usr << "\red The round is either not ready, or has already finished..." - return - LateChoices() - - if(href_list["SelectedJob"]) - - if(!enter_allowed) - usr << "\blue There is an administrative lock on entering the game!" - return - - AttemptLateSpawn(href_list["SelectedJob"]) - return - - if(href_list["privacy_poll"]) - establish_db_connection() - if(!dbcon.IsConnected()) - return - var/voted = 0 - - //First check if the person has not voted yet. - var/DBQuery/query = dbcon.NewQuery("SELECT * FROM erro_privacy WHERE ckey='[src.ckey]'") + if(dbcon.IsConnected()) + var/isadmin = 0 + if(src.client && src.client.holder) + isadmin = 1 + var/DBQuery/query = dbcon.NewQuery("SELECT id FROM erro_poll_question WHERE [(isadmin ? "" : "adminonly = false AND")] Now() BETWEEN starttime AND endtime AND id NOT IN (SELECT pollid FROM erro_poll_vote WHERE ckey = \"[ckey]\") AND id NOT IN (SELECT pollid FROM erro_poll_textreply WHERE ckey = \"[ckey]\")") query.Execute() + var/newpoll = 0 while(query.NextRow()) - voted = 1 + newpoll = 1 break - //This is a safety switch, so only valid options pass through - var/option = "UNKNOWN" - switch(href_list["privacy_poll"]) - if("signed") - option = "SIGNED" - if("anonymous") - option = "ANONYMOUS" - if("nostats") - option = "NOSTATS" - if("later") - usr << browse(null,"window=privacypoll") - return - if("abstain") - option = "ABSTAIN" + if(newpoll) + output += "

Show Player Polls (NEW!)

" + else + output += "

Show Player Polls

" - if(option == "UNKNOWN") - return + output += "
" - if(!voted) - var/sql = "INSERT INTO erro_privacy VALUES (null, Now(), '[src.ckey]', '[option]')" - var/DBQuery/query_insert = dbcon.NewQuery(sql) - query_insert.Execute() - usr << "Thank you for your vote!" - usr << browse(null,"window=privacypoll") + //src << browse(output,"window=playersetup;size=210x240;can_close=0") + var/datum/browser/popup = new(src, "playersetup", "
New Player Options
", 210, 240) + popup.set_window_options("can_close=0") + popup.set_content(output) + popup.open(0) + return - if(!ready && href_list["preference"]) - if(client) - client.prefs.process_link(src, href_list) - else if(!href_list["late_join"]) - new_player_panel() +/mob/new_player/Stat() + ..() - if(href_list["showpoll"]) - handle_player_polling() - return - - if(href_list["pollid"]) - var/pollid = href_list["pollid"] - if(istext(pollid)) - pollid = text2num(pollid) - if(isnum(pollid)) - src.poll_player(pollid) - return - - if(href_list["votepollid"] && href_list["votetype"]) - var/pollid = text2num(href_list["votepollid"]) - var/votetype = href_list["votetype"] - switch(votetype) - if("OPTION") - var/optionid = text2num(href_list["voteoptionid"]) - vote_on_poll(pollid, optionid) - if("TEXT") - var/replytext = href_list["replytext"] - log_text_poll_reply(pollid, replytext) - if("NUMVAL") - var/id_min = text2num(href_list["minid"]) - var/id_max = text2num(href_list["maxid"]) - - if( (id_max - id_min) > 100 ) //Basic exploit prevention - usr << "The option ID difference is too big. Please contact administration or the database admin." - return - - for(var/optionid = id_min; optionid <= id_max; optionid++) - if(!isnull(href_list["o[optionid]"])) //Test if this optionid was replied to - var/rating - if(href_list["o[optionid]"] == "abstain") - rating = null - else - rating = text2num(href_list["o[optionid]"]) - if(!isnum(rating)) - return - - vote_on_numval_poll(pollid, optionid, rating) - if("MULTICHOICE") - var/id_min = text2num(href_list["minoptionid"]) - var/id_max = text2num(href_list["maxoptionid"]) - - if( (id_max - id_min) > 100 ) //Basic exploit prevention - usr << "The option ID difference is too big. Please contact administration or the database admin." - return - - for(var/optionid = id_min; optionid <= id_max; optionid++) - if(!isnull(href_list["option_[optionid]"])) //Test if this optionid was selected - vote_on_poll(pollid, optionid, 1) - - proc/IsJobAvailable(rank) - var/datum/job/job = job_master.GetJob(rank) - if(!job) return 0 - if((job.current_positions >= job.total_positions) && job.total_positions != -1) return 0 - if(jobban_isbanned(src,rank)) return 0 - if(!job.player_old_enough(src.client)) return 0 - return 1 - - - proc/AttemptLateSpawn(rank) - if(!IsJobAvailable(rank)) - src << alert("[rank] is not available. Please try another.") - return 0 - - job_master.AssignRole(src, rank, 1) - - var/mob/living/carbon/human/character = create_character() //creates the human and transfers vars and mind - job_master.EquipRank(character, rank, 1) //equips the human - character.loc = pick(latejoin) - character.lastarea = get_area(loc) - - if(character.mind.assigned_role != "Cyborg") - data_core.manifest_inject(character) - ticker.minds += character.mind//Cyborgs and AIs handle this in the transform proc. //TODO!!!!! ~Carn - AnnounceArrival(character, rank) + statpanel("Lobby") + if(client.statpanel == "Lobby" && ticker) + if(ticker.hide_mode) + stat("Game Mode:", "Secret") else - character.Robotize() + stat("Game Mode:", "[master_mode]") - joined_player_list += character.ckey + if((ticker.current_state == GAME_STATE_PREGAME) && going) + stat("Time To Start:", ticker.pregame_timeleft) + if((ticker.current_state == GAME_STATE_PREGAME) && !going) + stat("Time To Start:", "DELAYED") - if(config.allow_latejoin_antagonists && emergency_shuttle.timeleft() > 300) //Don't make them antags if the station is evacuating - ticker.mode.make_antag_chance(character) - qdel(src) + if(ticker.current_state == GAME_STATE_PREGAME) + stat("Players: [totalPlayers]", "Players Ready: [totalPlayersReady]") + totalPlayers = 0 + totalPlayersReady = 0 + for(var/mob/new_player/player in player_list) + stat("[player.key]", (player.ready)?("(Playing)"):(null)) + totalPlayers++ + if(player.ready)totalPlayersReady++ - proc/AnnounceArrival(var/mob/living/carbon/human/character, var/rank) - if (ticker.current_state == GAME_STATE_PLAYING) - var/ailist[] = list() - for (var/mob/living/silicon/ai/A in living_mob_list) - ailist += A - if (ailist.len) - var/mob/living/silicon/ai/announcer = pick(ailist) - if(character.mind) - if((character.mind.assigned_role != "Cyborg") && (character.mind.special_role != "MODE")) - announcer.say("[character.real_name] has signed up as [rank].") - - proc/LateChoices() - var/mills = world.time // 1/10 of a second, not real milliseconds but whatever - //var/secs = ((mills % 36000) % 600) / 10 //Not really needed, but I'll leave it here for refrence.. or something - var/mins = (mills % 36000) / 600 - var/hours = mills / 36000 - - var/dat = "
Round Duration: [round(hours)]h [round(mins)]m
" - - if(emergency_shuttle) //In case Nanotrasen decides reposess Centcom's shuttles. - if(emergency_shuttle.direction == 2) //Shuttle is going to centcom, not recalled - dat += "
The station has been evacuated.

" - if(emergency_shuttle.direction == 1 && emergency_shuttle.timeleft() < 300) //Shuttle is past the point of no recall - dat += "
The station is currently undergoing evacuation procedures.

" - - var/available_job_count = 0 - for(var/datum/job/job in job_master.occupations) - if(job && IsJobAvailable(job.title)) - available_job_count++; - - dat += "
Choose from the following open positions:

" - dat += "
" - var/job_count = 0 - for(var/datum/job/job in job_master.occupations) - if(job && IsJobAvailable(job.title)) - job_count++; - if (job_count > round(available_job_count / 2)) - dat += "
" - var/position_class = "otherPosition" - if (job.title in command_positions) - position_class = "commandPosition" - dat += "[job.title] ([job.current_positions])
" - dat += "
" - - // Removing the old window method but leaving it here for reference - //src << browse(dat, "window=latechoices;size=300x640;can_close=1") - - // Added the new browser window method - var/datum/browser/popup = new(src, "latechoices", "Choose Profession", 440, 500) - popup.add_stylesheet("playeroptions", 'html/browser/playeroptions.css') - popup.set_content(dat) - popup.open(0) // 0 is passed to open so that it doesn't use the onclose() proc - - - proc/create_character() - spawning = 1 - close_spawn_windows() - - var/mob/living/carbon/human/new_character = new(loc) - new_character.lastarea = get_area(loc) - - create_dna(new_character) - - if(config.force_random_names || appearance_isbanned(src)) - client.prefs.random_character() - client.prefs.real_name = random_name(gender) - client.prefs.copy_to(new_character) - - src << sound(null, repeat = 0, wait = 0, volume = 85, channel = 1) // MAD JAMS cant last forever yo - - if(mind) - mind.active = 0 //we wish to transfer the key manually - mind.transfer_to(new_character) //won't transfer key since the mind is not active - - new_character.name = real_name - - ready_dna(new_character, client.prefs.blood_type) - - new_character.key = key //Manually transfer the key to log them in - - return new_character - - - Move() +/mob/new_player/Topic(href, href_list[]) + if(src != usr) return 0 + if(!client) return 0 - proc/close_spawn_windows() + if(href_list["show_preferences"]) + client.prefs.ShowChoices(src) + return 1 - src << browse(null, "window=latechoices") //closes late choices window + if(href_list["ready"]) + ready = text2num(href_list["ready"]) + + if(href_list["refresh"]) src << browse(null, "window=playersetup") //closes the player setup window - src << browse(null, "window=preferences") //closes job selection - src << browse(null, "window=mob_occupation") - src << browse(null, "window=latechoices") //closes late job selection + new_player_panel() + + if(href_list["observe"]) + + if(alert(src,"Are you sure you wish to observe? You will not be able to play this round!","Player Setup","Yes","No") == "Yes") + if(!client) return 1 + var/mob/dead/observer/observer = new() + + spawning = 1 + src << sound(null, repeat = 0, wait = 0, volume = 85, channel = 1) // MAD JAMS cant last forever yo + + observer.started_as_observer = 1 + close_spawn_windows() + var/obj/O = locate("landmark*Observer-Start") + src << "\blue Now teleporting." + observer.loc = O.loc + if(client.prefs.be_random_name) + client.prefs.real_name = random_name(gender) + observer.real_name = client.prefs.real_name + observer.name = observer.real_name + observer.key = key + qdel(mind) + + qdel(src) + return 1 + + if(href_list["late_join"]) + if(!ticker || ticker.current_state != GAME_STATE_PLAYING) + usr << "\red The round is either not ready, or has already finished..." + return + LateChoices() + + if(href_list["SelectedJob"]) + + if(!enter_allowed) + usr << "\blue There is an administrative lock on entering the game!" + return + + AttemptLateSpawn(href_list["SelectedJob"]) + return + + if(href_list["privacy_poll"]) + establish_db_connection() + if(!dbcon.IsConnected()) + return + var/voted = 0 + + //First check if the person has not voted yet. + var/DBQuery/query = dbcon.NewQuery("SELECT * FROM erro_privacy WHERE ckey='[src.ckey]'") + query.Execute() + while(query.NextRow()) + voted = 1 + break + + //This is a safety switch, so only valid options pass through + var/option = "UNKNOWN" + switch(href_list["privacy_poll"]) + if("signed") + option = "SIGNED" + if("anonymous") + option = "ANONYMOUS" + if("nostats") + option = "NOSTATS" + if("later") + usr << browse(null,"window=privacypoll") + return + if("abstain") + option = "ABSTAIN" + + if(option == "UNKNOWN") + return + + if(!voted) + var/sql = "INSERT INTO erro_privacy VALUES (null, Now(), '[src.ckey]', '[option]')" + var/DBQuery/query_insert = dbcon.NewQuery(sql) + query_insert.Execute() + usr << "Thank you for your vote!" + usr << browse(null,"window=privacypoll") + + if(!ready && href_list["preference"]) + if(client) + client.prefs.process_link(src, href_list) + else if(!href_list["late_join"]) + new_player_panel() + + if(href_list["showpoll"]) + handle_player_polling() + return + + if(href_list["pollid"]) + var/pollid = href_list["pollid"] + if(istext(pollid)) + pollid = text2num(pollid) + if(isnum(pollid)) + src.poll_player(pollid) + return + + if(href_list["votepollid"] && href_list["votetype"]) + var/pollid = text2num(href_list["votepollid"]) + var/votetype = href_list["votetype"] + switch(votetype) + if("OPTION") + var/optionid = text2num(href_list["voteoptionid"]) + vote_on_poll(pollid, optionid) + if("TEXT") + var/replytext = href_list["replytext"] + log_text_poll_reply(pollid, replytext) + if("NUMVAL") + var/id_min = text2num(href_list["minid"]) + var/id_max = text2num(href_list["maxid"]) + + if( (id_max - id_min) > 100 ) //Basic exploit prevention + usr << "The option ID difference is too big. Please contact administration or the database admin." + return + + for(var/optionid = id_min; optionid <= id_max; optionid++) + if(!isnull(href_list["o[optionid]"])) //Test if this optionid was replied to + var/rating + if(href_list["o[optionid]"] == "abstain") + rating = null + else + rating = text2num(href_list["o[optionid]"]) + if(!isnum(rating)) + return + + vote_on_numval_poll(pollid, optionid, rating) + if("MULTICHOICE") + var/id_min = text2num(href_list["minoptionid"]) + var/id_max = text2num(href_list["maxoptionid"]) + + if( (id_max - id_min) > 100 ) //Basic exploit prevention + usr << "The option ID difference is too big. Please contact administration or the database admin." + return + + for(var/optionid = id_min; optionid <= id_max; optionid++) + if(!isnull(href_list["option_[optionid]"])) //Test if this optionid was selected + vote_on_poll(pollid, optionid, 1) + +/mob/new_player/proc/IsJobAvailable(rank) + var/datum/job/job = job_master.GetJob(rank) + if(!job) return 0 + if((job.current_positions >= job.total_positions) && job.total_positions != -1) return 0 + if(jobban_isbanned(src,rank)) return 0 + if(!job.player_old_enough(src.client)) return 0 + return 1 + + +/mob/new_player/proc/AttemptLateSpawn(rank) + if(!IsJobAvailable(rank)) + src << alert("[rank] is not available. Please try another.") + return 0 + + job_master.AssignRole(src, rank, 1) + + var/mob/living/carbon/human/character = create_character() //creates the human and transfers vars and mind + job_master.EquipRank(character, rank, 1) //equips the human + character.loc = pick(latejoin) + character.lastarea = get_area(loc) + + if(character.mind.assigned_role != "Cyborg") + data_core.manifest_inject(character) + ticker.minds += character.mind//Cyborgs and AIs handle this in the transform proc. //TODO!!!!! ~Carn + AnnounceArrival(character, rank) + else + character.Robotize() + + joined_player_list += character.ckey + + if(config.allow_latejoin_antagonists && emergency_shuttle.timeleft() > 300) //Don't make them antags if the station is evacuating + ticker.mode.make_antag_chance(character) + qdel(src) + +/mob/new_player/proc/AnnounceArrival(var/mob/living/carbon/human/character, var/rank) + if (ticker.current_state == GAME_STATE_PLAYING) + var/ailist[] = list() + for (var/mob/living/silicon/ai/A in living_mob_list) + ailist += A + if (ailist.len) + var/mob/living/silicon/ai/announcer = pick(ailist) + if(character.mind) + if((character.mind.assigned_role != "Cyborg") && (character.mind.special_role != "MODE")) + announcer.say("[character.real_name] has signed up as [rank].") + +/mob/new_player/proc/LateChoices() + var/mills = world.time // 1/10 of a second, not real milliseconds but whatever + //var/secs = ((mills % 36000) % 600) / 10 //Not really needed, but I'll leave it here for refrence.. or something + var/mins = (mills % 36000) / 600 + var/hours = mills / 36000 + + var/dat = "
Round Duration: [round(hours)]h [round(mins)]m
" + + if(emergency_shuttle) //In case Nanotrasen decides reposess Centcom's shuttles. + if(emergency_shuttle.direction == 2) //Shuttle is going to centcom, not recalled + dat += "
The station has been evacuated.

" + if(emergency_shuttle.direction == 1 && emergency_shuttle.timeleft() < 300) //Shuttle is past the point of no recall + dat += "
The station is currently undergoing evacuation procedures.

" + + var/available_job_count = 0 + for(var/datum/job/job in job_master.occupations) + if(job && IsJobAvailable(job.title)) + available_job_count++; + + dat += "
Choose from the following open positions:

" + dat += "
" + var/job_count = 0 + for(var/datum/job/job in job_master.occupations) + if(job && IsJobAvailable(job.title)) + job_count++; + if (job_count > round(available_job_count / 2)) + dat += "
" + var/position_class = "otherPosition" + if (job.title in command_positions) + position_class = "commandPosition" + dat += "[job.title] ([job.current_positions])
" + dat += "
" + + // Removing the old window method but leaving it here for reference + //src << browse(dat, "window=latechoices;size=300x640;can_close=1") + + // Added the new browser window method + var/datum/browser/popup = new(src, "latechoices", "Choose Profession", 440, 500) + popup.add_stylesheet("playeroptions", 'html/browser/playeroptions.css') + popup.set_content(dat) + popup.open(0) // 0 is passed to open so that it doesn't use the onclose() proc + + +/mob/new_player/proc/create_character() + spawning = 1 + close_spawn_windows() + + var/mob/living/carbon/human/new_character = new(loc) + new_character.lastarea = get_area(loc) + + create_dna(new_character) + + if(config.force_random_names || appearance_isbanned(src)) + client.prefs.random_character() + client.prefs.real_name = random_name(gender) + client.prefs.copy_to(new_character) + + src << sound(null, repeat = 0, wait = 0, volume = 85, channel = 1) // MAD JAMS cant last forever yo + + if(mind) + mind.active = 0 //we wish to transfer the key manually + mind.transfer_to(new_character) //won't transfer key since the mind is not active + + new_character.name = real_name + + ready_dna(new_character, client.prefs.blood_type) + + new_character.key = key //Manually transfer the key to log them in + + return new_character + + +/mob/new_player/Move() + return 0 + + +/mob/new_player/proc/close_spawn_windows() + + src << browse(null, "window=latechoices") //closes late choices window + src << browse(null, "window=playersetup") //closes the player setup window + src << browse(null, "window=preferences") //closes job selection + src << browse(null, "window=mob_occupation") + src << browse(null, "window=latechoices") //closes late job selection diff --git a/code/modules/mob/new_player/preferences_setup.dm b/code/modules/mob/new_player/preferences_setup.dm index d91da2be50f..01e73989d95 100644 --- a/code/modules/mob/new_player/preferences_setup.dm +++ b/code/modules/mob/new_player/preferences_setup.dm @@ -1,351 +1,351 @@ -datum/preferences + //The mob should have a gender you want before running this proc. Will run fine without H - proc/random_character(gender_override) - if(gender_override) - gender = gender_override - else - gender = pick(MALE,FEMALE) - underwear = random_underwear(gender) - skin_tone = random_skin_tone() - hair_style = random_hair_style(gender) - facial_hair_style = random_facial_hair_style(gender) - hair_color = random_short_color() - facial_hair_color = hair_color - eye_color = random_eye_color() - pref_species = new /datum/species/human() - backbag = 2 - age = rand(AGE_MIN,AGE_MAX) +/datum/preferences/proc/random_character(gender_override) + if(gender_override) + gender = gender_override + else + gender = pick(MALE,FEMALE) + underwear = random_underwear(gender) + skin_tone = random_skin_tone() + hair_style = random_hair_style(gender) + facial_hair_style = random_facial_hair_style(gender) + hair_color = random_short_color() + facial_hair_color = hair_color + eye_color = random_eye_color() + pref_species = new /datum/species/human() + backbag = 2 + age = rand(AGE_MIN,AGE_MAX) - proc/update_preview_icon() //seriously. This is horrendous. - del(preview_icon_front) - del(preview_icon_side) - var/icon/preview_icon = null +/datum/preferences/proc/update_preview_icon() //seriously. This is horrendous. + del(preview_icon_front) + del(preview_icon_side) + var/icon/preview_icon = null - var/g = "m" - if(gender == FEMALE) g = "f" + var/g = "m" + if(gender == FEMALE) g = "f" - if(pref_species.id == "human" || !config.mutant_races) - preview_icon = new /icon('icons/mob/human.dmi', "[skin_tone]_[g]_s") - else - preview_icon = new /icon('icons/mob/human.dmi', "[pref_species.id]_[g]_s") - preview_icon.Blend("#[mutant_color]", ICON_MULTIPLY) + if(pref_species.id == "human" || !config.mutant_races) + preview_icon = new /icon('icons/mob/human.dmi', "[skin_tone]_[g]_s") + else + preview_icon = new /icon('icons/mob/human.dmi', "[pref_species.id]_[g]_s") + preview_icon.Blend("#[mutant_color]", ICON_MULTIPLY) - var/datum/sprite_accessory/S - if(underwear) - S = underwear_all[underwear] - if(S) - preview_icon.Blend(new /icon(S.icon, "[S.icon_state]_s"), ICON_OVERLAY) + var/datum/sprite_accessory/S + if(underwear) + S = underwear_all[underwear] + if(S) + preview_icon.Blend(new /icon(S.icon, "[S.icon_state]_s"), ICON_OVERLAY) - var/icon/eyes_s = new/icon() - if(EYECOLOR in pref_species.specflags) - eyes_s = new/icon("icon" = 'icons/mob/human_face.dmi', "icon_state" = "[pref_species.eyes]_s") - eyes_s.Blend("#[eye_color]", ICON_MULTIPLY) + var/icon/eyes_s = new/icon() + if(EYECOLOR in pref_species.specflags) + eyes_s = new/icon("icon" = 'icons/mob/human_face.dmi', "icon_state" = "[pref_species.eyes]_s") + eyes_s.Blend("#[eye_color]", ICON_MULTIPLY) - S = hair_styles_list[hair_style] - if(S && (HAIR in pref_species.specflags)) - var/icon/hair_s = new/icon("icon" = S.icon, "icon_state" = "[S.icon_state]_s") - hair_s.Blend("#[hair_color]", ICON_MULTIPLY) - eyes_s.Blend(hair_s, ICON_OVERLAY) + S = hair_styles_list[hair_style] + if(S && (HAIR in pref_species.specflags)) + var/icon/hair_s = new/icon("icon" = S.icon, "icon_state" = "[S.icon_state]_s") + hair_s.Blend("#[hair_color]", ICON_MULTIPLY) + eyes_s.Blend(hair_s, ICON_OVERLAY) - S = facial_hair_styles_list[facial_hair_style] - if(S && (FACEHAIR in pref_species.specflags)) - var/icon/facial_s = new/icon("icon" = S.icon, "icon_state" = "[S.icon_state]_s") - facial_s.Blend("#[facial_hair_color]", ICON_MULTIPLY) - eyes_s.Blend(facial_s, ICON_OVERLAY) + S = facial_hair_styles_list[facial_hair_style] + if(S && (FACEHAIR in pref_species.specflags)) + var/icon/facial_s = new/icon("icon" = S.icon, "icon_state" = "[S.icon_state]_s") + facial_s.Blend("#[facial_hair_color]", ICON_MULTIPLY) + eyes_s.Blend(facial_s, ICON_OVERLAY) - var/icon/clothes_s = null - if(job_civilian_low & ASSISTANT)//This gives the preview icon clothes depending on which job(if any) is set to 'high' - clothes_s = new /icon('icons/mob/uniform.dmi', "grey_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY) - if(backbag == 2) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "backpack"), ICON_OVERLAY) - else if(backbag == 3) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel"), ICON_OVERLAY) + var/icon/clothes_s = null + if(job_civilian_low & ASSISTANT)//This gives the preview icon clothes depending on which job(if any) is set to 'high' + clothes_s = new /icon('icons/mob/uniform.dmi', "grey_s") + clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY) + if(backbag == 2) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "backpack"), ICON_OVERLAY) + else if(backbag == 3) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel"), ICON_OVERLAY) - else if(job_civilian_high)//I hate how this looks, but there's no reason to go through this switch if it's empty - switch(job_civilian_high) - if(HOP) - clothes_s = new /icon('icons/mob/uniform.dmi', "hop_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "brown"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/head.dmi', "hopcap"), ICON_OVERLAY) - if(backbag == 2) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "backpack"), ICON_OVERLAY) - else if(backbag == 3) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-norm"), ICON_OVERLAY) - if(BARTENDER) - clothes_s = new /icon('icons/mob/uniform.dmi', "ba_suit_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/suit.dmi', "armor"), ICON_OVERLAY) - if(backbag == 2) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "backpack"), ICON_OVERLAY) - else if(backbag == 3) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-norm"), ICON_OVERLAY) - if(BOTANIST) - clothes_s = new /icon('icons/mob/uniform.dmi', "hydroponics_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/hands.dmi', "ggloves"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/suit.dmi', "apron"), ICON_OVERLAY) - if(backbag == 2) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "backpack"), ICON_OVERLAY) - else if(backbag == 3) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-hyd"), ICON_OVERLAY) - if(CHEF) - clothes_s = new /icon('icons/mob/uniform.dmi', "chef_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/head.dmi', "chef"), ICON_OVERLAY) - if(backbag == 2) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "backpack"), ICON_OVERLAY) - if(backbag == 3) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-norm"), ICON_OVERLAY) - if(JANITOR) - clothes_s = new /icon('icons/mob/uniform.dmi', "janitor_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY) - if(backbag == 2) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "backpack"), ICON_OVERLAY) - if(backbag == 3) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-norm"), ICON_OVERLAY) - if(LIBRARIAN) - clothes_s = new /icon('icons/mob/uniform.dmi', "red_suit_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY) - if(backbag == 2) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "backpack"), ICON_OVERLAY) - if(backbag == 3) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-norm"), ICON_OVERLAY) - if(QUARTERMASTER) - clothes_s = new /icon('icons/mob/uniform.dmi', "qm_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "brown"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/hands.dmi', "bgloves"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/eyes.dmi', "sun"), ICON_OVERLAY) - clothes_s.Blend(new /icon('icons/mob/items_righthand.dmi', "clipboard"), ICON_UNDERLAY) - if(backbag == 2) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "backpack"), ICON_OVERLAY) - if(backbag == 3) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-norm"), ICON_OVERLAY) - if(CARGOTECH) - clothes_s = new /icon('icons/mob/uniform.dmi', "cargotech_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/hands.dmi', "bgloves"), ICON_UNDERLAY) - if(backbag == 2) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "backpack"), ICON_OVERLAY) - if(backbag == 3) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-norm"), ICON_OVERLAY) - if(MINER) - clothes_s = new /icon('icons/mob/uniform.dmi', "miner_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/hands.dmi', "bgloves"), ICON_UNDERLAY) - if(backbag == 2) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "engiepack"), ICON_OVERLAY) - if(backbag == 3) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-eng"), ICON_OVERLAY) - if(LAWYER) - clothes_s = new /icon('icons/mob/uniform.dmi', "lawyer_blue_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "brown"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/items_righthand.dmi', "briefcase"), ICON_UNDERLAY) - if(backbag == 2) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "backpack"), ICON_OVERLAY) - if(backbag == 3) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-norm"), ICON_OVERLAY) - if(CHAPLAIN) - clothes_s = new /icon('icons/mob/uniform.dmi', "chapblack_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY) - if(backbag == 2) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "backpack"), ICON_OVERLAY) - if(backbag == 3) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-norm"), ICON_OVERLAY) - if(CLOWN) - clothes_s = new /icon('icons/mob/uniform.dmi', "clown_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "clown"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/mask.dmi', "clown"), ICON_OVERLAY) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "clownpack"), ICON_OVERLAY) - if(MIME) - clothes_s = new /icon('icons/mob/uniform.dmi', "mime_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/hands.dmi', "lgloves"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/mask.dmi', "mime"), ICON_OVERLAY) - clothes_s.Blend(new /icon('icons/mob/head.dmi', "beret"), ICON_OVERLAY) - clothes_s.Blend(new /icon('icons/mob/suit.dmi', "suspenders"), ICON_OVERLAY) - if(backbag == 2) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "mimepack"), ICON_OVERLAY) - if(backbag == 3) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-norm"), ICON_OVERLAY) + else if(job_civilian_high)//I hate how this looks, but there's no reason to go through this switch if it's empty + switch(job_civilian_high) + if(HOP) + clothes_s = new /icon('icons/mob/uniform.dmi', "hop_s") + clothes_s.Blend(new /icon('icons/mob/feet.dmi', "brown"), ICON_UNDERLAY) + clothes_s.Blend(new /icon('icons/mob/head.dmi', "hopcap"), ICON_OVERLAY) + if(backbag == 2) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "backpack"), ICON_OVERLAY) + else if(backbag == 3) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-norm"), ICON_OVERLAY) + if(BARTENDER) + clothes_s = new /icon('icons/mob/uniform.dmi', "ba_suit_s") + clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY) + clothes_s.Blend(new /icon('icons/mob/suit.dmi', "armor"), ICON_OVERLAY) + if(backbag == 2) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "backpack"), ICON_OVERLAY) + else if(backbag == 3) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-norm"), ICON_OVERLAY) + if(BOTANIST) + clothes_s = new /icon('icons/mob/uniform.dmi', "hydroponics_s") + clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY) + clothes_s.Blend(new /icon('icons/mob/hands.dmi', "ggloves"), ICON_UNDERLAY) + clothes_s.Blend(new /icon('icons/mob/suit.dmi', "apron"), ICON_OVERLAY) + if(backbag == 2) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "backpack"), ICON_OVERLAY) + else if(backbag == 3) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-hyd"), ICON_OVERLAY) + if(CHEF) + clothes_s = new /icon('icons/mob/uniform.dmi', "chef_s") + clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY) + clothes_s.Blend(new /icon('icons/mob/head.dmi', "chef"), ICON_OVERLAY) + if(backbag == 2) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "backpack"), ICON_OVERLAY) + if(backbag == 3) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-norm"), ICON_OVERLAY) + if(JANITOR) + clothes_s = new /icon('icons/mob/uniform.dmi', "janitor_s") + clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY) + if(backbag == 2) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "backpack"), ICON_OVERLAY) + if(backbag == 3) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-norm"), ICON_OVERLAY) + if(LIBRARIAN) + clothes_s = new /icon('icons/mob/uniform.dmi', "red_suit_s") + clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY) + if(backbag == 2) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "backpack"), ICON_OVERLAY) + if(backbag == 3) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-norm"), ICON_OVERLAY) + if(QUARTERMASTER) + clothes_s = new /icon('icons/mob/uniform.dmi', "qm_s") + clothes_s.Blend(new /icon('icons/mob/feet.dmi', "brown"), ICON_UNDERLAY) + clothes_s.Blend(new /icon('icons/mob/hands.dmi', "bgloves"), ICON_UNDERLAY) + clothes_s.Blend(new /icon('icons/mob/eyes.dmi', "sun"), ICON_OVERLAY) + clothes_s.Blend(new /icon('icons/mob/items_righthand.dmi', "clipboard"), ICON_UNDERLAY) + if(backbag == 2) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "backpack"), ICON_OVERLAY) + if(backbag == 3) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-norm"), ICON_OVERLAY) + if(CARGOTECH) + clothes_s = new /icon('icons/mob/uniform.dmi', "cargotech_s") + clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY) + clothes_s.Blend(new /icon('icons/mob/hands.dmi', "bgloves"), ICON_UNDERLAY) + if(backbag == 2) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "backpack"), ICON_OVERLAY) + if(backbag == 3) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-norm"), ICON_OVERLAY) + if(MINER) + clothes_s = new /icon('icons/mob/uniform.dmi', "miner_s") + clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY) + clothes_s.Blend(new /icon('icons/mob/hands.dmi', "bgloves"), ICON_UNDERLAY) + if(backbag == 2) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "engiepack"), ICON_OVERLAY) + if(backbag == 3) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-eng"), ICON_OVERLAY) + if(LAWYER) + clothes_s = new /icon('icons/mob/uniform.dmi', "lawyer_blue_s") + clothes_s.Blend(new /icon('icons/mob/feet.dmi', "brown"), ICON_UNDERLAY) + clothes_s.Blend(new /icon('icons/mob/items_righthand.dmi', "briefcase"), ICON_UNDERLAY) + if(backbag == 2) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "backpack"), ICON_OVERLAY) + if(backbag == 3) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-norm"), ICON_OVERLAY) + if(CHAPLAIN) + clothes_s = new /icon('icons/mob/uniform.dmi', "chapblack_s") + clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY) + if(backbag == 2) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "backpack"), ICON_OVERLAY) + if(backbag == 3) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-norm"), ICON_OVERLAY) + if(CLOWN) + clothes_s = new /icon('icons/mob/uniform.dmi', "clown_s") + clothes_s.Blend(new /icon('icons/mob/feet.dmi', "clown"), ICON_UNDERLAY) + clothes_s.Blend(new /icon('icons/mob/mask.dmi', "clown"), ICON_OVERLAY) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "clownpack"), ICON_OVERLAY) + if(MIME) + clothes_s = new /icon('icons/mob/uniform.dmi', "mime_s") + clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY) + clothes_s.Blend(new /icon('icons/mob/hands.dmi', "lgloves"), ICON_UNDERLAY) + clothes_s.Blend(new /icon('icons/mob/mask.dmi', "mime"), ICON_OVERLAY) + clothes_s.Blend(new /icon('icons/mob/head.dmi', "beret"), ICON_OVERLAY) + clothes_s.Blend(new /icon('icons/mob/suit.dmi', "suspenders"), ICON_OVERLAY) + if(backbag == 2) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "mimepack"), ICON_OVERLAY) + if(backbag == 3) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-norm"), ICON_OVERLAY) - else if(job_medsci_high) - switch(job_medsci_high) - if(RD) - clothes_s = new /icon('icons/mob/uniform.dmi', "director_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "brown"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/items_righthand.dmi', "clipboard"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/suit.dmi', "labcoat_open"), ICON_OVERLAY) - if(backbag == 2) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "backpack"), ICON_OVERLAY) - if(backbag == 3) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-tox"), ICON_OVERLAY) - if(SCIENTIST) - clothes_s = new /icon('icons/mob/uniform.dmi', "toxinswhite_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "white"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/suit.dmi', "labcoat_tox_open"), ICON_OVERLAY) - if(backbag == 2) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "backpack"), ICON_OVERLAY) - if(backbag == 3) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-tox"), ICON_OVERLAY) - if(CHEMIST) - clothes_s = new /icon('icons/mob/uniform.dmi', "chemistrywhite_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "white"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/suit.dmi', "labcoat_chem_open"), ICON_OVERLAY) - if(backbag == 2) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "backpack"), ICON_OVERLAY) - if(backbag == 3) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-chem"), ICON_OVERLAY) - if(CMO) - clothes_s = new /icon('icons/mob/uniform.dmi', "cmo_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "brown"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/items_lefthand.dmi', "firstaid"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/suit.dmi', "labcoat_cmo_open"), ICON_OVERLAY) - if(backbag == 2) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "medicalpack"), ICON_OVERLAY) - if(backbag == 3) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-med"), ICON_OVERLAY) - if(DOCTOR) - clothes_s = new /icon('icons/mob/uniform.dmi', "medical_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "white"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/items_lefthand.dmi', "firstaid"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/suit.dmi', "labcoat_open"), ICON_OVERLAY) - if(backbag == 2) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "medicalpack"), ICON_OVERLAY) - if(backbag == 3) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-med"), ICON_OVERLAY) - if(GENETICIST) - clothes_s = new /icon('icons/mob/uniform.dmi', "geneticswhite_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "white"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/suit.dmi', "labcoat_gen_open"), ICON_OVERLAY) - if(backbag == 2) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "backpack"), ICON_OVERLAY) - if(backbag == 3) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-gen"), ICON_OVERLAY) - if(VIROLOGIST) - clothes_s = new /icon('icons/mob/uniform.dmi', "virologywhite_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "white"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/mask.dmi', "sterile"), ICON_OVERLAY) - clothes_s.Blend(new /icon('icons/mob/suit.dmi', "labcoat_vir_open"), ICON_OVERLAY) - if(backbag == 2) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "medicalpack"), ICON_OVERLAY) - if(backbag == 3) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-vir"), ICON_OVERLAY) - if(ROBOTICIST) - clothes_s = new /icon('icons/mob/uniform.dmi', "robotics_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/hands.dmi', "bgloves"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/items_righthand.dmi', "toolbox_blue"), ICON_OVERLAY) - clothes_s.Blend(new /icon('icons/mob/suit.dmi', "labcoat_open"), ICON_OVERLAY) - if(backbag == 2) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "backpack"), ICON_OVERLAY) - if(backbag == 3) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-norm"), ICON_OVERLAY) + else if(job_medsci_high) + switch(job_medsci_high) + if(RD) + clothes_s = new /icon('icons/mob/uniform.dmi', "director_s") + clothes_s.Blend(new /icon('icons/mob/feet.dmi', "brown"), ICON_UNDERLAY) + clothes_s.Blend(new /icon('icons/mob/items_righthand.dmi', "clipboard"), ICON_UNDERLAY) + clothes_s.Blend(new /icon('icons/mob/suit.dmi', "labcoat_open"), ICON_OVERLAY) + if(backbag == 2) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "backpack"), ICON_OVERLAY) + if(backbag == 3) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-tox"), ICON_OVERLAY) + if(SCIENTIST) + clothes_s = new /icon('icons/mob/uniform.dmi', "toxinswhite_s") + clothes_s.Blend(new /icon('icons/mob/feet.dmi', "white"), ICON_UNDERLAY) + clothes_s.Blend(new /icon('icons/mob/suit.dmi', "labcoat_tox_open"), ICON_OVERLAY) + if(backbag == 2) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "backpack"), ICON_OVERLAY) + if(backbag == 3) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-tox"), ICON_OVERLAY) + if(CHEMIST) + clothes_s = new /icon('icons/mob/uniform.dmi', "chemistrywhite_s") + clothes_s.Blend(new /icon('icons/mob/feet.dmi', "white"), ICON_UNDERLAY) + clothes_s.Blend(new /icon('icons/mob/suit.dmi', "labcoat_chem_open"), ICON_OVERLAY) + if(backbag == 2) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "backpack"), ICON_OVERLAY) + if(backbag == 3) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-chem"), ICON_OVERLAY) + if(CMO) + clothes_s = new /icon('icons/mob/uniform.dmi', "cmo_s") + clothes_s.Blend(new /icon('icons/mob/feet.dmi', "brown"), ICON_UNDERLAY) + clothes_s.Blend(new /icon('icons/mob/items_lefthand.dmi', "firstaid"), ICON_UNDERLAY) + clothes_s.Blend(new /icon('icons/mob/suit.dmi', "labcoat_cmo_open"), ICON_OVERLAY) + if(backbag == 2) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "medicalpack"), ICON_OVERLAY) + if(backbag == 3) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-med"), ICON_OVERLAY) + if(DOCTOR) + clothes_s = new /icon('icons/mob/uniform.dmi', "medical_s") + clothes_s.Blend(new /icon('icons/mob/feet.dmi', "white"), ICON_UNDERLAY) + clothes_s.Blend(new /icon('icons/mob/items_lefthand.dmi', "firstaid"), ICON_UNDERLAY) + clothes_s.Blend(new /icon('icons/mob/suit.dmi', "labcoat_open"), ICON_OVERLAY) + if(backbag == 2) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "medicalpack"), ICON_OVERLAY) + if(backbag == 3) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-med"), ICON_OVERLAY) + if(GENETICIST) + clothes_s = new /icon('icons/mob/uniform.dmi', "geneticswhite_s") + clothes_s.Blend(new /icon('icons/mob/feet.dmi', "white"), ICON_UNDERLAY) + clothes_s.Blend(new /icon('icons/mob/suit.dmi', "labcoat_gen_open"), ICON_OVERLAY) + if(backbag == 2) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "backpack"), ICON_OVERLAY) + if(backbag == 3) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-gen"), ICON_OVERLAY) + if(VIROLOGIST) + clothes_s = new /icon('icons/mob/uniform.dmi', "virologywhite_s") + clothes_s.Blend(new /icon('icons/mob/feet.dmi', "white"), ICON_UNDERLAY) + clothes_s.Blend(new /icon('icons/mob/mask.dmi', "sterile"), ICON_OVERLAY) + clothes_s.Blend(new /icon('icons/mob/suit.dmi', "labcoat_vir_open"), ICON_OVERLAY) + if(backbag == 2) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "medicalpack"), ICON_OVERLAY) + if(backbag == 3) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-vir"), ICON_OVERLAY) + if(ROBOTICIST) + clothes_s = new /icon('icons/mob/uniform.dmi', "robotics_s") + clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY) + clothes_s.Blend(new /icon('icons/mob/hands.dmi', "bgloves"), ICON_UNDERLAY) + clothes_s.Blend(new /icon('icons/mob/items_righthand.dmi', "toolbox_blue"), ICON_OVERLAY) + clothes_s.Blend(new /icon('icons/mob/suit.dmi', "labcoat_open"), ICON_OVERLAY) + if(backbag == 2) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "backpack"), ICON_OVERLAY) + if(backbag == 3) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-norm"), ICON_OVERLAY) - else if(job_engsec_high) - switch(job_engsec_high) - if(CAPTAIN) - clothes_s = new /icon('icons/mob/uniform.dmi', "captain_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "brown"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/head.dmi', "captain"), ICON_OVERLAY) - clothes_s.Blend(new /icon('icons/mob/eyes.dmi', "sun"), ICON_OVERLAY) - clothes_s.Blend(new /icon('icons/mob/suit.dmi', "capcarapace"), ICON_OVERLAY) - if(backbag == 2) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "backpack"), ICON_OVERLAY) - if(backbag == 3) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-norm"), ICON_OVERLAY) - if(HOS) - clothes_s = new /icon('icons/mob/uniform.dmi', "hosred_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "jackboots"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/hands.dmi', "bgloves"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/head.dmi', "hoscap"), ICON_OVERLAY) - clothes_s.Blend(new /icon('icons/mob/eyes.dmi', "sunhud"), ICON_OVERLAY) - clothes_s.Blend(new /icon('icons/mob/suit.dmi', "hos"), ICON_OVERLAY) - if(backbag == 2) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "securitypack"), ICON_OVERLAY) - if(backbag == 3) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-sec"), ICON_OVERLAY) - if(WARDEN) - clothes_s = new /icon('icons/mob/uniform.dmi', "warden_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "jackboots"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/hands.dmi', "bgloves"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/head.dmi', "policehelm"), ICON_OVERLAY) - clothes_s.Blend(new /icon('icons/mob/eyes.dmi', "sunhud"), ICON_OVERLAY) - clothes_s.Blend(new /icon('icons/mob/suit.dmi', "warden_jacket"), ICON_OVERLAY) - if(backbag == 2) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "securitypack"), ICON_OVERLAY) - if(backbag == 3) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-sec"), ICON_OVERLAY) - if(DETECTIVE) - clothes_s = new /icon('icons/mob/uniform.dmi', "detective_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "brown"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/hands.dmi', "bgloves"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/mask.dmi', "cigaron"), ICON_OVERLAY) - clothes_s.Blend(new /icon('icons/mob/head.dmi', "detective"), ICON_OVERLAY) - clothes_s.Blend(new /icon('icons/mob/suit.dmi', "detective"), ICON_OVERLAY) - if(backbag == 2) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "backpack"), ICON_OVERLAY) - if(backbag == 3) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-norm"), ICON_OVERLAY) - if(OFFICER) - clothes_s = new /icon('icons/mob/uniform.dmi', "secred_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "jackboots"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/head.dmi', "helmet"), ICON_OVERLAY) - clothes_s.Blend(new /icon('icons/mob/suit.dmi', "armor"), ICON_OVERLAY) - if(backbag == 2) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "securitypack"), ICON_OVERLAY) - if(backbag == 3) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-sec"), ICON_OVERLAY) - if(CHIEF) - clothes_s = new /icon('icons/mob/uniform.dmi', "chief_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "brown"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/hands.dmi', "bgloves"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/belt.dmi', "utility"), ICON_OVERLAY) - clothes_s.Blend(new /icon('icons/mob/mask.dmi', "cigaron"), ICON_OVERLAY) - clothes_s.Blend(new /icon('icons/mob/head.dmi', "hardhat0_white"), ICON_OVERLAY) - if(backbag == 2) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "engiepack"), ICON_OVERLAY) - if(backbag == 3) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-eng"), ICON_OVERLAY) - if(ENGINEER) - clothes_s = new /icon('icons/mob/uniform.dmi', "engine_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "orange"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/belt.dmi', "utility"), ICON_OVERLAY) - clothes_s.Blend(new /icon('icons/mob/head.dmi', "hardhat0_yellow"), ICON_OVERLAY) - if(backbag == 2) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "engiepack"), ICON_OVERLAY) - if(backbag == 3) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-eng"), ICON_OVERLAY) - if(ATMOSTECH) - clothes_s = new /icon('icons/mob/uniform.dmi', "atmos_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/hands.dmi', "bgloves"), ICON_UNDERLAY) - clothes_s.Blend(new /icon('icons/mob/belt.dmi', "utility"), ICON_OVERLAY) - if(backbag == 2) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "backpack"), ICON_OVERLAY) - if(backbag == 3) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-norm"), ICON_OVERLAY) - if(AI)//Gives AI and borgs assistant-wear, so they can still customize their character - clothes_s = new /icon('icons/mob/uniform.dmi', "grey_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY) - if(backbag == 2) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "backpack"), ICON_OVERLAY) - else if(backbag == 3) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel"), ICON_OVERLAY) - if(CYBORG) - clothes_s = new /icon('icons/mob/uniform.dmi', "grey_s") - clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY) - if(backbag == 2) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "backpack"), ICON_OVERLAY) - else if(backbag == 3) - clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel"), ICON_OVERLAY) + else if(job_engsec_high) + switch(job_engsec_high) + if(CAPTAIN) + clothes_s = new /icon('icons/mob/uniform.dmi', "captain_s") + clothes_s.Blend(new /icon('icons/mob/feet.dmi', "brown"), ICON_UNDERLAY) + clothes_s.Blend(new /icon('icons/mob/head.dmi', "captain"), ICON_OVERLAY) + clothes_s.Blend(new /icon('icons/mob/eyes.dmi', "sun"), ICON_OVERLAY) + clothes_s.Blend(new /icon('icons/mob/suit.dmi', "capcarapace"), ICON_OVERLAY) + if(backbag == 2) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "backpack"), ICON_OVERLAY) + if(backbag == 3) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-norm"), ICON_OVERLAY) + if(HOS) + clothes_s = new /icon('icons/mob/uniform.dmi', "hosred_s") + clothes_s.Blend(new /icon('icons/mob/feet.dmi', "jackboots"), ICON_UNDERLAY) + clothes_s.Blend(new /icon('icons/mob/hands.dmi', "bgloves"), ICON_UNDERLAY) + clothes_s.Blend(new /icon('icons/mob/head.dmi', "hoscap"), ICON_OVERLAY) + clothes_s.Blend(new /icon('icons/mob/eyes.dmi', "sunhud"), ICON_OVERLAY) + clothes_s.Blend(new /icon('icons/mob/suit.dmi', "hos"), ICON_OVERLAY) + if(backbag == 2) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "securitypack"), ICON_OVERLAY) + if(backbag == 3) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-sec"), ICON_OVERLAY) + if(WARDEN) + clothes_s = new /icon('icons/mob/uniform.dmi', "warden_s") + clothes_s.Blend(new /icon('icons/mob/feet.dmi', "jackboots"), ICON_UNDERLAY) + clothes_s.Blend(new /icon('icons/mob/hands.dmi', "bgloves"), ICON_UNDERLAY) + clothes_s.Blend(new /icon('icons/mob/head.dmi', "policehelm"), ICON_OVERLAY) + clothes_s.Blend(new /icon('icons/mob/eyes.dmi', "sunhud"), ICON_OVERLAY) + clothes_s.Blend(new /icon('icons/mob/suit.dmi', "warden_jacket"), ICON_OVERLAY) + if(backbag == 2) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "securitypack"), ICON_OVERLAY) + if(backbag == 3) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-sec"), ICON_OVERLAY) + if(DETECTIVE) + clothes_s = new /icon('icons/mob/uniform.dmi', "detective_s") + clothes_s.Blend(new /icon('icons/mob/feet.dmi', "brown"), ICON_UNDERLAY) + clothes_s.Blend(new /icon('icons/mob/hands.dmi', "bgloves"), ICON_UNDERLAY) + clothes_s.Blend(new /icon('icons/mob/mask.dmi', "cigaron"), ICON_OVERLAY) + clothes_s.Blend(new /icon('icons/mob/head.dmi', "detective"), ICON_OVERLAY) + clothes_s.Blend(new /icon('icons/mob/suit.dmi', "detective"), ICON_OVERLAY) + if(backbag == 2) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "backpack"), ICON_OVERLAY) + if(backbag == 3) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-norm"), ICON_OVERLAY) + if(OFFICER) + clothes_s = new /icon('icons/mob/uniform.dmi', "secred_s") + clothes_s.Blend(new /icon('icons/mob/feet.dmi', "jackboots"), ICON_UNDERLAY) + clothes_s.Blend(new /icon('icons/mob/head.dmi', "helmet"), ICON_OVERLAY) + clothes_s.Blend(new /icon('icons/mob/suit.dmi', "armor"), ICON_OVERLAY) + if(backbag == 2) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "securitypack"), ICON_OVERLAY) + if(backbag == 3) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-sec"), ICON_OVERLAY) + if(CHIEF) + clothes_s = new /icon('icons/mob/uniform.dmi', "chief_s") + clothes_s.Blend(new /icon('icons/mob/feet.dmi', "brown"), ICON_UNDERLAY) + clothes_s.Blend(new /icon('icons/mob/hands.dmi', "bgloves"), ICON_UNDERLAY) + clothes_s.Blend(new /icon('icons/mob/belt.dmi', "utility"), ICON_OVERLAY) + clothes_s.Blend(new /icon('icons/mob/mask.dmi', "cigaron"), ICON_OVERLAY) + clothes_s.Blend(new /icon('icons/mob/head.dmi', "hardhat0_white"), ICON_OVERLAY) + if(backbag == 2) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "engiepack"), ICON_OVERLAY) + if(backbag == 3) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-eng"), ICON_OVERLAY) + if(ENGINEER) + clothes_s = new /icon('icons/mob/uniform.dmi', "engine_s") + clothes_s.Blend(new /icon('icons/mob/feet.dmi', "orange"), ICON_UNDERLAY) + clothes_s.Blend(new /icon('icons/mob/belt.dmi', "utility"), ICON_OVERLAY) + clothes_s.Blend(new /icon('icons/mob/head.dmi', "hardhat0_yellow"), ICON_OVERLAY) + if(backbag == 2) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "engiepack"), ICON_OVERLAY) + if(backbag == 3) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-eng"), ICON_OVERLAY) + if(ATMOSTECH) + clothes_s = new /icon('icons/mob/uniform.dmi', "atmos_s") + clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY) + clothes_s.Blend(new /icon('icons/mob/hands.dmi', "bgloves"), ICON_UNDERLAY) + clothes_s.Blend(new /icon('icons/mob/belt.dmi', "utility"), ICON_OVERLAY) + if(backbag == 2) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "backpack"), ICON_OVERLAY) + if(backbag == 3) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel-norm"), ICON_OVERLAY) + if(AI)//Gives AI and borgs assistant-wear, so they can still customize their character + clothes_s = new /icon('icons/mob/uniform.dmi', "grey_s") + clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY) + if(backbag == 2) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "backpack"), ICON_OVERLAY) + else if(backbag == 3) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel"), ICON_OVERLAY) + if(CYBORG) + clothes_s = new /icon('icons/mob/uniform.dmi', "grey_s") + clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY) + if(backbag == 2) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "backpack"), ICON_OVERLAY) + else if(backbag == 3) + clothes_s.Blend(new /icon('icons/mob/back.dmi', "satchel"), ICON_OVERLAY) - preview_icon.Blend(eyes_s, ICON_OVERLAY) - if(clothes_s) - preview_icon.Blend(clothes_s, ICON_OVERLAY) - preview_icon_front = new(preview_icon, dir = SOUTH) - preview_icon_side = new(preview_icon, dir = WEST) + preview_icon.Blend(eyes_s, ICON_OVERLAY) + if(clothes_s) + preview_icon.Blend(clothes_s, ICON_OVERLAY) + preview_icon_front = new(preview_icon, dir = SOUTH) + preview_icon_side = new(preview_icon, dir = WEST) - del(preview_icon) - del(eyes_s) - del(clothes_s) \ No newline at end of file + del(preview_icon) + del(eyes_s) + del(clothes_s) \ No newline at end of file diff --git a/code/modules/mob/new_player/sprite_accessories.dm b/code/modules/mob/new_player/sprite_accessories.dm index cd96649604b..ac4efb44ed9 100644 --- a/code/modules/mob/new_player/sprite_accessories.dm +++ b/code/modules/mob/new_player/sprite_accessories.dm @@ -48,285 +48,285 @@ /datum/sprite_accessory/hair icon = 'icons/mob/human_face.dmi' // default icon for all hairs - short - name = "Short Hair" // try to capatilize the names please~ - icon_state = "hair_a" // you do not need to define _s or _l sub-states, game automatically does this for you +/datum/sprite_accessory/hair/short + name = "Short Hair" // try to capatilize the names please~ + icon_state = "hair_a" // you do not need to define _s or _l sub-states, game automatically does this for you - shorthair2 - name = "Short Hair 2" - icon_state = "hair_shorthair2" +/datum/sprite_accessory/hair/shorthair2 + name = "Short Hair 2" + icon_state = "hair_shorthair2" - cut - name = "Cut Hair" - icon_state = "hair_c" +/datum/sprite_accessory/hair/cut + name = "Cut Hair" + icon_state = "hair_c" - long - name = "Shoulder-length Hair" - icon_state = "hair_b" +/datum/sprite_accessory/hair/long + name = "Shoulder-length Hair" + icon_state = "hair_b" - longer - name = "Long Hair" - icon_state = "hair_vlong" +/datum/sprite_accessory/hair/longer + name = "Long Hair" + icon_state = "hair_vlong" - long_over_eye - name = "Over eye" - icon_state = "hair_longovereye" +/datum/sprite_accessory/hair/long_over_eye + name = "Over eye" + icon_state = "hair_longovereye" - longest - name = "Very Long Hair" - icon_state = "hair_longest" +/datum/sprite_accessory/hair/longest + name = "Very Long Hair" + icon_state = "hair_longest" - longest2 - name = "Very Long Over Eye" - icon_state = "hair_longest2" +/datum/sprite_accessory/hair/longest2 + name = "Very Long Over Eye" + icon_state = "hair_longest2" - longfringe - name = "Long Fringe" - icon_state = "hair_longfringe" +/datum/sprite_accessory/hair/longfringe + name = "Long Fringe" + icon_state = "hair_longfringe" - longestalt - name = "Longer Fringe" - icon_state = "hair_vlongfringe" +/datum/sprite_accessory/hair/longestalt + name = "Longer Fringe" + icon_state = "hair_vlongfringe" - gentle - name = "Gentle" - icon_state = "hair_gentle" +/datum/sprite_accessory/hair/gentle + name = "Gentle" + icon_state = "hair_gentle" - halfbang - name = "Half-banged Hair" - icon_state = "hair_halfbang" +/datum/sprite_accessory/hair/halfbang + name = "Half-banged Hair" + icon_state = "hair_halfbang" - halfbangalt - name = "Half-banged Hair Alt" - icon_state = "hair_halfbang_alt" +/datum/sprite_accessory/hair/halfbangalt + name = "Half-banged Hair Alt" + icon_state = "hair_halfbang_alt" - ponytail1 - name = "Ponytail 1" - icon_state = "hair_ponytail" +/datum/sprite_accessory/hair/ponytail1 + name = "Ponytail 1" + icon_state = "hair_ponytail" - ponytail2 - name = "Ponytail 2" - icon_state = "hair_pa" +/datum/sprite_accessory/hair/ponytail2 + name = "Ponytail 2" + icon_state = "hair_pa" - ponytail3 - name = "Ponytail 3" - icon_state = "hair_ponytail3" +/datum/sprite_accessory/hair/ponytail3 + name = "Ponytail 3" + icon_state = "hair_ponytail3" - side_tail - name = "Side Pony" - icon_state = "hair_sidetail" +/datum/sprite_accessory/hair/side_tail + name = "Side Pony" + icon_state = "hair_sidetail" - side_tail2 - name = "Side Pony 2" - icon_state = "hair_sidetail2" +/datum/sprite_accessory/hair/side_tail2 + name = "Side Pony 2" + icon_state = "hair_sidetail2" - side_tail3 - name = "Side Pony 3" - icon_state = "hair_stail" +/datum/sprite_accessory/hair/side_tail3 + name = "Side Pony 3" + icon_state = "hair_stail" - oneshoulder - name = "One Shoulder" - icon_state = "hair_oneshoulder" +/datum/sprite_accessory/hair/oneshoulder + name = "One Shoulder" + icon_state = "hair_oneshoulder" - tressshoulder - name = "Tress Shoulder" - icon_state = "hair_tressshoulder" +/datum/sprite_accessory/hair/tressshoulder + name = "Tress Shoulder" + icon_state = "hair_tressshoulder" - parted - name = "Parted" - icon_state = "hair_parted" +/datum/sprite_accessory/hair/parted + name = "Parted" + icon_state = "hair_parted" - pompadour - name = "Pompadour" - icon_state = "hair_pompadour" +/datum/sprite_accessory/hair/pompadour + name = "Pompadour" + icon_state = "hair_pompadour" - quiff - name = "Quiff" - icon_state = "hair_quiff" +/datum/sprite_accessory/hair/quiff + name = "Quiff" + icon_state = "hair_quiff" - bedhead - name = "Bedhead" - icon_state = "hair_bedhead" +/datum/sprite_accessory/hair/bedhead + name = "Bedhead" + icon_state = "hair_bedhead" - bedhead2 - name = "Bedhead 2" - icon_state = "hair_bedheadv2" +/datum/sprite_accessory/hair/bedhead2 + name = "Bedhead 2" + icon_state = "hair_bedheadv2" - bedhead3 - name = "Bedhead 3" - icon_state = "hair_bedheadv3" +/datum/sprite_accessory/hair/bedhead3 + name = "Bedhead 3" + icon_state = "hair_bedheadv3" - messy - name = "Messy" - icon_state = "hair_messy" +/datum/sprite_accessory/hair/messy + name = "Messy" + icon_state = "hair_messy" - beehive - name = "Beehive" - icon_state = "hair_beehive" +/datum/sprite_accessory/hair/beehive + name = "Beehive" + icon_state = "hair_beehive" - bobcurl - name = "Bobcurl" - icon_state = "hair_bobcurl" +/datum/sprite_accessory/hair/bobcurl + name = "Bobcurl" + icon_state = "hair_bobcurl" - bob - name = "Bob" - icon_state = "hair_bobcut" +/datum/sprite_accessory/hair/bob + name = "Bob" + icon_state = "hair_bobcut" - bowl - name = "Bowl" - icon_state = "hair_bowlcut" +/datum/sprite_accessory/hair/bowl + name = "Bowl" + icon_state = "hair_bowlcut" - buzz - name = "Buzzcut" - icon_state = "hair_buzzcut" +/datum/sprite_accessory/hair/buzz + name = "Buzzcut" + icon_state = "hair_buzzcut" - crew - name = "Crewcut" - icon_state = "hair_crewcut" +/datum/sprite_accessory/hair/crew + name = "Crewcut" + icon_state = "hair_crewcut" - combover - name = "Combover" - icon_state = "hair_combover" +/datum/sprite_accessory/hair/combover + name = "Combover" + icon_state = "hair_combover" - devillock - name = "Devil Lock" - icon_state = "hair_devilock" +/datum/sprite_accessory/hair/devillock + name = "Devil Lock" + icon_state = "hair_devilock" - dreadlocks - name = "Dreadlocks" - icon_state = "hair_dreads" +/datum/sprite_accessory/hair/dreadlocks + name = "Dreadlocks" + icon_state = "hair_dreads" - curls - name = "Curls" - icon_state = "hair_curls" +/datum/sprite_accessory/hair/curls + name = "Curls" + icon_state = "hair_curls" - afro - name = "Afro" - icon_state = "hair_afro" +/datum/sprite_accessory/hair/afro + name = "Afro" + icon_state = "hair_afro" - afro2 - name = "Afro 2" - icon_state = "hair_afro2" +/datum/sprite_accessory/hair/afro2 + name = "Afro 2" + icon_state = "hair_afro2" - afro_large - name = "Big Afro" - icon_state = "hair_bigafro" +/datum/sprite_accessory/hair/afro_large + name = "Big Afro" + icon_state = "hair_bigafro" - sargeant - name = "Flat Top" - icon_state = "hair_sargeant" +/datum/sprite_accessory/hair/sargeant + name = "Flat Top" + icon_state = "hair_sargeant" - emo - name = "Emo" - icon_state = "hair_emo" +/datum/sprite_accessory/hair/emo + name = "Emo" + icon_state = "hair_emo" - fag - name = "Flow Hair" - icon_state = "hair_f" +/datum/sprite_accessory/hair/fag + name = "Flow Hair" + icon_state = "hair_f" - feather - name = "Feather" - icon_state = "hair_feather" +/datum/sprite_accessory/hair/feather + name = "Feather" + icon_state = "hair_feather" - hitop - name = "Hitop" - icon_state = "hair_hitop" +/datum/sprite_accessory/hair/hitop + name = "Hitop" + icon_state = "hair_hitop" - mohawk - name = "Mohawk" - icon_state = "hair_d" +/datum/sprite_accessory/hair/mohawk + name = "Mohawk" + icon_state = "hair_d" - jensen - name = "Adam Jensen Hair" - icon_state = "hair_jensen" +/datum/sprite_accessory/hair/jensen + name = "Adam Jensen Hair" + icon_state = "hair_jensen" - gelled - name = "Gelled Back" - icon_state = "hair_gelled" +/datum/sprite_accessory/hair/gelled + name = "Gelled Back" + icon_state = "hair_gelled" - spiky - name = "Spiky" - icon_state = "hair_spikey" +/datum/sprite_accessory/hair/spiky + name = "Spiky" + icon_state = "hair_spikey" - protagonist - name = "Slightly long" - icon_state = "hair_protagonist" +/datum/sprite_accessory/hair/protagonist + name = "Slightly long" + icon_state = "hair_protagonist" - kusangi - name = "Kusanagi Hair" - icon_state = "hair_kusanagi" +/datum/sprite_accessory/hair/kusangi + name = "Kusanagi Hair" + icon_state = "hair_kusanagi" - kagami - name = "Pigtails" - icon_state = "hair_kagami" +/datum/sprite_accessory/hair/kagami + name = "Pigtails" + icon_state = "hair_kagami" - himecut - name = "Hime Cut" - icon_state = "hair_himecut" +/datum/sprite_accessory/hair/himecut + name = "Hime Cut" + icon_state = "hair_himecut" - antenna - name = "Ahoge" - icon_state = "hair_antenna" +/datum/sprite_accessory/hair/antenna + name = "Ahoge" + icon_state = "hair_antenna" - pigtail - name = "Pig tails" - icon_state = "hair_pigtails" +/datum/sprite_accessory/hair/pigtail + name = "Pig tails" + icon_state = "hair_pigtails" - front_braid - name = "Braided front" - icon_state = "hair_braidfront" +/datum/sprite_accessory/hair/front_braid + name = "Braided front" + icon_state = "hair_braidfront" - lowbraid - name = "Low Braid" - icon_state = "hair_hbraid" +/datum/sprite_accessory/hair/lowbraid + name = "Low Braid" + icon_state = "hair_hbraid" - not_floorlength_braid - name = "High Braid" - icon_state = "hair_braid2" +/datum/sprite_accessory/hair/not_floorlength_braid + name = "High Braid" + icon_state = "hair_braid2" - braid - name = "Floorlength Braid" - icon_state = "hair_braid" +/datum/sprite_accessory/hair/braid + name = "Floorlength Braid" + icon_state = "hair_braid" - odango - name = "Odango" - icon_state = "hair_odango" +/datum/sprite_accessory/hair/odango + name = "Odango" + icon_state = "hair_odango" - ombre - name = "Ombre" - icon_state = "hair_ombre" +/datum/sprite_accessory/hair/ombre + name = "Ombre" + icon_state = "hair_ombre" - updo - name = "Updo" - icon_state = "hair_updo" +/datum/sprite_accessory/hair/updo + name = "Updo" + icon_state = "hair_updo" - skinhead - name = "Skinhead" - icon_state = "hair_skinhead" +/datum/sprite_accessory/hair/skinhead + name = "Skinhead" + icon_state = "hair_skinhead" - longbangs - name = "Long Bangs" - icon_state = "hair_lbangs" +/datum/sprite_accessory/hair/longbangs + name = "Long Bangs" + icon_state = "hair_lbangs" - balding - name = "Balding Hair" - icon_state = "hair_e" +/datum/sprite_accessory/hair/balding + name = "Balding Hair" + icon_state = "hair_e" - bald - name = "Bald" - icon_state = null +/datum/sprite_accessory/hair/bald + name = "Bald" + icon_state = null - parted - name = "Side Part" - icon_state = "hair_part" +/datum/sprite_accessory/hair/parted + name = "Side Part" + icon_state = "hair_part" - braided - name = "Braided" - icon_state = "hair_braided" +/datum/sprite_accessory/hair/braided + name = "Braided" + icon_state = "hair_braided" - bun - name = "Bun Head" - icon_state = "hair_bun" +/datum/sprite_accessory/hair/bun + name = "Bun Head" + icon_state = "hair_bun" ///////////////////////////// // Facial Hair Definitions // @@ -335,82 +335,82 @@ icon = 'icons/mob/human_face.dmi' gender = MALE // barf (unless you're a dorf, dorfs dig chix w/ beards :P) - shaved - name = "Shaved" - icon_state = null - gender = NEUTER +/datum/sprite_accessory/facial_hair/shaved + name = "Shaved" + icon_state = null + gender = NEUTER - watson - name = "Watson Mustache" - icon_state = "facial_watson" +/datum/sprite_accessory/facial_hair/watson + name = "Watson Mustache" + icon_state = "facial_watson" - hogan - name = "Hulk Hogan Mustache" - icon_state = "facial_hogan" //-Neek +/datum/sprite_accessory/facial_hair/hogan + name = "Hulk Hogan Mustache" + icon_state = "facial_hogan" //-Neek - vandyke - name = "Van Dyke Mustache" - icon_state = "facial_vandyke" +/datum/sprite_accessory/facial_hair/vandyke + name = "Van Dyke Mustache" + icon_state = "facial_vandyke" - chaplin - name = "Square Mustache" - icon_state = "facial_chaplin" +/datum/sprite_accessory/facial_hair/chaplin + name = "Square Mustache" + icon_state = "facial_chaplin" - selleck - name = "Selleck Mustache" - icon_state = "facial_selleck" +/datum/sprite_accessory/facial_hair/selleck + name = "Selleck Mustache" + icon_state = "facial_selleck" - neckbeard - name = "Neckbeard" - icon_state = "facial_neckbeard" +/datum/sprite_accessory/facial_hair/neckbeard + name = "Neckbeard" + icon_state = "facial_neckbeard" - fullbeard - name = "Full Beard" - icon_state = "facial_fullbeard" +/datum/sprite_accessory/facial_hair/fullbeard + name = "Full Beard" + icon_state = "facial_fullbeard" - longbeard - name = "Long Beard" - icon_state = "facial_longbeard" +/datum/sprite_accessory/facial_hair/longbeard + name = "Long Beard" + icon_state = "facial_longbeard" - vlongbeard - name = "Very Long Beard" - icon_state = "facial_wise" +/datum/sprite_accessory/facial_hair/vlongbeard + name = "Very Long Beard" + icon_state = "facial_wise" - elvis - name = "Elvis Sideburns" - icon_state = "facial_elvis" +/datum/sprite_accessory/facial_hair/elvis + name = "Elvis Sideburns" + icon_state = "facial_elvis" - abe - name = "Abraham Lincoln Beard" - icon_state = "facial_abe" +/datum/sprite_accessory/facial_hair/abe + name = "Abraham Lincoln Beard" + icon_state = "facial_abe" - chinstrap - name = "Chinstrap" - icon_state = "facial_chin" +/datum/sprite_accessory/facial_hair/chinstrap + name = "Chinstrap" + icon_state = "facial_chin" - hip - name = "Hipster Beard" - icon_state = "facial_hip" +/datum/sprite_accessory/facial_hair/hip + name = "Hipster Beard" + icon_state = "facial_hip" - gt - name = "Goatee" - icon_state = "facial_gt" +/datum/sprite_accessory/facial_hair/gt + name = "Goatee" + icon_state = "facial_gt" - jensen - name = "Adam Jensen Beard" - icon_state = "facial_jensen" +/datum/sprite_accessory/facial_hair/jensen + name = "Adam Jensen Beard" + icon_state = "facial_jensen" - dwarf - name = "Dwarf Beard" - icon_state = "facial_dwarf" +/datum/sprite_accessory/facial_hair/dwarf + name = "Dwarf Beard" + icon_state = "facial_dwarf" - fiveoclock - name = "Five o Clock Shadow" - icon_state = "facial_fiveoclock" +/datum/sprite_accessory/facial_hair/fiveoclock + name = "Five o Clock Shadow" + icon_state = "facial_fiveoclock" - fu - name = "Fu Manchu" - icon_state = "facial_fumanchu" +/datum/sprite_accessory/facial_hair/fu + name = "Fu Manchu" + icon_state = "facial_fumanchu" /////////////////////////// // Underwear Definitions // @@ -418,127 +418,127 @@ /datum/sprite_accessory/underwear icon = 'icons/mob/underwear.dmi' - nude - name = "Nude" - icon_state = null - gender = NEUTER +/datum/sprite_accessory/underwear/nude + name = "Nude" + icon_state = null + gender = NEUTER - male_white - name = "Mens White" - icon_state = "male_white" - gender = MALE +/datum/sprite_accessory/underwear/male_white + name = "Mens White" + icon_state = "male_white" + gender = MALE - male_grey - name = "Mens Grey" - icon_state = "male_grey" - gender = MALE +/datum/sprite_accessory/underwear/male_grey + name = "Mens Grey" + icon_state = "male_grey" + gender = MALE - male_green - name = "Mens Green" - icon_state = "male_green" - gender = MALE +/datum/sprite_accessory/underwear/male_green + name = "Mens Green" + icon_state = "male_green" + gender = MALE - male_blue - name = "Mens Blue" - icon_state = "male_blue" - gender = MALE +/datum/sprite_accessory/underwear/male_blue + name = "Mens Blue" + icon_state = "male_blue" + gender = MALE - male_black - name = "Mens Black" - icon_state = "male_black" - gender = MALE +/datum/sprite_accessory/underwear/male_black + name = "Mens Black" + icon_state = "male_black" + gender = MALE - male_mankini - name = "Mankini" - icon_state = "male_mankini" - gender = MALE +/datum/sprite_accessory/underwear/male_mankini + name = "Mankini" + icon_state = "male_mankini" + gender = MALE - male_hearts - name = "Mens Hearts Boxer" - icon_state = "male_hearts" - gender = MALE +/datum/sprite_accessory/underwear/male_hearts + name = "Mens Hearts Boxer" + icon_state = "male_hearts" + gender = MALE - male_blackalt - name = "Mens Black Boxer" - icon_state = "male_blackalt" - gender = MALE +/datum/sprite_accessory/underwear/male_blackalt + name = "Mens Black Boxer" + icon_state = "male_blackalt" + gender = MALE - male_greyalt - name = "Mens Grey Boxer" - icon_state = "male_greyalt" - gender = MALE +/datum/sprite_accessory/underwear/male_greyalt + name = "Mens Grey Boxer" + icon_state = "male_greyalt" + gender = MALE - male_stripe - name = "Mens Striped Boxer" - icon_state = "male_stripe" - gender = MALE +/datum/sprite_accessory/underwear/male_stripe + name = "Mens Striped Boxer" + icon_state = "male_stripe" + gender = MALE - male_kinky - name = "Mens Kinky" - icon_state = "male_kinky" - gender = MALE +/datum/sprite_accessory/underwear/male_kinky + name = "Mens Kinky" + icon_state = "male_kinky" + gender = MALE - male_red - name = "Mens Red" - icon_state = "male_red" - gender = MALE +/datum/sprite_accessory/underwear/male_red + name = "Mens Red" + icon_state = "male_red" + gender = MALE - female_red - name = "Ladies Red" - icon_state = "female_red" - gender = FEMALE +/datum/sprite_accessory/underwear/female_red + name = "Ladies Red" + icon_state = "female_red" + gender = FEMALE - female_white - name = "Ladies White" - icon_state = "female_white" - gender = FEMALE +/datum/sprite_accessory/underwear/female_white + name = "Ladies White" + icon_state = "female_white" + gender = FEMALE - female_yellow - name = "Ladies Yellow" - icon_state = "female_yellow" - gender = FEMALE +/datum/sprite_accessory/underwear/female_yellow + name = "Ladies Yellow" + icon_state = "female_yellow" + gender = FEMALE - female_blue - name = "Ladies Blue" - icon_state = "female_blue" - gender = FEMALE +/datum/sprite_accessory/underwear/female_blue + name = "Ladies Blue" + icon_state = "female_blue" + gender = FEMALE - female_black - name = "Ladies Black" - icon_state = "female_black" - gender = FEMALE +/datum/sprite_accessory/underwear/female_black + name = "Ladies Black" + icon_state = "female_black" + gender = FEMALE - female_thong - name = "Ladies Thong" - icon_state = "female_thong" - gender = FEMALE +/datum/sprite_accessory/underwear/female_thong + name = "Ladies Thong" + icon_state = "female_thong" + gender = FEMALE - female_babydoll - name = "Babydoll" - icon_state = "female_babydoll" - gender = FEMALE +/datum/sprite_accessory/underwear/female_babydoll + name = "Babydoll" + icon_state = "female_babydoll" + gender = FEMALE - female_babyblue - name = "Ladies Baby-Blue" - icon_state = "female_babyblue" - gender = FEMALE +/datum/sprite_accessory/underwear/female_babyblue + name = "Ladies Baby-Blue" + icon_state = "female_babyblue" + gender = FEMALE - female_green - name = "Ladies Green" - icon_state = "female_green" - gender = FEMALE +/datum/sprite_accessory/underwear/female_green + name = "Ladies Green" + icon_state = "female_green" + gender = FEMALE - female_pink - name = "Ladies Pink" - icon_state = "female_pink" - gender = FEMALE +/datum/sprite_accessory/underwear/female_pink + name = "Ladies Pink" + icon_state = "female_pink" + gender = FEMALE - female_kinky - name = "Ladies Kinky" - icon_state = "female_kinky" - gender = FEMALE +/datum/sprite_accessory/underwear/female_kinky + name = "Ladies Kinky" + icon_state = "female_kinky" + gender = FEMALE - female_tankini - name = "Tankini" - icon_state = "female_tankini" - gender = FEMALE +/datum/sprite_accessory/underwear/female_tankini + name = "Tankini" + icon_state = "female_tankini" + gender = FEMALE