Merge pull request #7843 from ShadowLarkens/screenalerts

Ported /tg/ style screen alerts, replacing the hunger icon with them
This commit is contained in:
Aronai Sieyes
2020-05-14 09:52:06 -04:00
committed by GitHub
54 changed files with 970 additions and 683 deletions
+28
View File
@@ -55,6 +55,34 @@
..()
/obj/item/clothing/shoes/container_resist(mob/living/micro)
var/mob/living/carbon/human/macro = loc
if(!istype(macro))
to_chat(micro, "<span class='notice'>You start to climb out of [src]!</span>")
if(do_after(micro, 50, src))
to_chat(micro, "<span class='notice'>You climb out of [src]!</span>")
micro.forceMove(loc)
return
var/escape_message_micro = "You start to climb out of [src]!"
var/escape_message_macro = "Something is trying to climb out of your [src]!"
var/escape_time = 60
if(macro.shoes == src)
escape_message_micro = "You start to climb around the larger creature's feet and ankles!"
escape_time = 100
to_chat(micro, "<span class='notice'>[escape_message_micro]</span>")
to_chat(macro, "<span class='danger'>[escape_message_macro]</span>")
if(!do_after(micro, escape_time, macro))
to_chat(micro, "<span class='danger'>You're pinned underfoot!</span>")
to_chat(macro, "<span class='danger'>You pin the escapee underfoot!</span>")
return
to_chat(micro, "<span class='notice'>You manage to escape [src]!</span>")
to_chat(macro, "<span class='danger'>Someone has climbed out of your [src]!</span>")
micro.forceMove(macro.loc)
/obj/item/clothing/gloves
sprite_sheets = list(
SPECIES_TESHARI = 'icons/mob/species/seromi/gloves.dmi',
+11 -1
View File
@@ -827,7 +827,7 @@ mob/observer/dead/MayRespawn(var/feedback = 0)
// Lets a ghost know someone's trying to bring them back, and for them to get into their body.
// Mostly the same as TG's sans the hud element, since we don't have TG huds.
/mob/observer/dead/proc/notify_revive(var/message, var/sound, flashwindow = TRUE)
/mob/observer/dead/proc/notify_revive(var/message, var/sound, flashwindow = TRUE, var/atom/source)
if((last_revive_notification + 2 MINUTES) > world.time)
return
last_revive_notification = world.time
@@ -836,6 +836,16 @@ mob/observer/dead/MayRespawn(var/feedback = 0)
window_flash(client)
if(message)
to_chat(src, "<span class='ghostalert'><font size=4>[message]</font></span>")
if(source)
var/obj/screen/alert/A = throw_alert("\ref[source]_notify_revive", /obj/screen/alert/notify_cloning)
if(A)
if(client && client.prefs && client.prefs.UI_style)
A.icon = ui_style2icon(client.prefs.UI_style)
A.desc = message
var/old_layer = source.layer
source.layer = FLOAT_LAYER
A.overlays += source
source.layer = old_layer
to_chat(src, "<span class='ghostalert'><a href=?src=[REF(src)];reenter=1>(Click to re-enter)</a></span>")
if(sound)
SEND_SOUND(src, sound(sound))
+16
View File
@@ -89,6 +89,22 @@ var/list/holder_mob_icon_cache = list()
else if(H.r_hand == src)
H.update_inv_r_hand()
/obj/item/weapon/holder/container_resist(mob/living/held)
var/mob/M = loc
if(istype(M))
M.drop_from_inventory(src)
to_chat(M, "<span class='warning'>\The [held] wriggles out of your grip!</span>")
to_chat(held, "<span class='warning'>You wiggle out of [M]'s grip!</span>")
else if(istype(loc, /obj/item/clothing/accessory/holster))
var/obj/item/clothing/accessory/holster/holster = loc
if(holster.holstered == src)
holster.clear_holster()
to_chat(held, "<span class='warning'>You extricate yourself from [holster].</span>")
held.forceMove(get_turf(held))
else if(isitem(loc))
to_chat(held, "<span class='warning'>You struggle free of [loc].</span>")
held.forceMove(get_turf(held))
//Mob specific holders.
/obj/item/weapon/holder/diona
origin_tech = list(TECH_MAGNET = 3, TECH_BIO = 5)
+1 -1
View File
@@ -311,7 +311,7 @@
H.handcuffed = new /obj/item/weapon/handcuffs/cable(H) // Better to be cable cuffed than stun-locked
else
H.handcuffed = new /obj/item/weapon/handcuffs(H)
H.update_inv_handcuffed()
H.update_handcuffed()
busy = FALSE
else if(istype(M, /mob/living))
var/mob/living/L = M
+2 -2
View File
@@ -148,11 +148,11 @@
if(environment.temperature > (T0C+66))
adjustFireLoss((environment.temperature - (T0C+66))/5) // Might be too high, check in testing.
if (fire) fire.icon_state = "fire2"
throw_alert("alien_fire", /obj/screen/alert/alien_fire)
if(prob(20))
to_chat(src, "<font color='red'>You feel a searing heat!</font>")
else
if (fire) fire.icon_state = "fire0"
clear_alert("alien_fire")
/mob/living/carbon/alien/handle_fire()
if(..())
+13 -3
View File
@@ -310,7 +310,7 @@
else if (W == handcuffed)
handcuffed = null
update_inv_handcuffed()
update_handcuffed()
if(buckled && buckled.buckle_require_restraints)
buckled.unbuckle_mob()
@@ -318,9 +318,8 @@
legcuffed = null
update_inv_legcuffed()
else
..()
..()
return
//generates realistic-ish pulse output based on preset levels
/mob/living/carbon/proc/get_pulse(var/method) //method 0 is for hands, 1 is for machines, more accurate
@@ -403,3 +402,14 @@
if(does_not_breathe)
return FALSE
return ..()
/mob/living/carbon/proc/update_handcuffed()
if(handcuffed)
drop_l_hand()
drop_r_hand()
stop_pulling()
throw_alert("handcuffed", /obj/screen/alert/restrained/handcuffed, new_master = handcuffed)
else
clear_alert("handcuffed")
update_action_buttons() //some of our action buttons might be unusable when we're handcuffed.
update_inv_handcuffed()
@@ -1679,4 +1679,9 @@
if(istype(loc, /turf/simulated))
var/turf/T = loc
T.add_blood(src)
. = ..()
. = ..()
/mob/living/carbon/human/reduce_cuff_time()
if(istype(gloves, /obj/item/clothing/gloves/gauntlets/rig))
return 2
return ..()
@@ -1,30 +1,7 @@
/mob/living/carbon/human/process_resist()
//drop && roll
if((on_fire || has_modifier_of_type(/datum/modifier/fire)) && !buckled)
adjust_fire_stacks(-1.2)
Weaken(3)
spin(32,2)
visible_message(
"<span class='danger'>[src] rolls on the floor, trying to put themselves out!</span>",
"<span class='notice'>You stop, drop, and roll!</span>"
)
sleep(30)
if(fire_stacks <= 0 && !(has_modifier_of_type(/datum/modifier/fire)))
visible_message(
"<span class='danger'>[src] has successfully extinguished themselves!</span>",
"<span class='notice'>You extinguish yourself.</span>"
)
ExtinguishMob()
return TRUE
if(handcuffed)
spawn() escape_handcuffs()
else if(legcuffed)
spawn() escape_legcuffs()
else if(wear_suit && istype(wear_suit, /obj/item/clothing/suit/straight_jacket))
spawn() escape_straight_jacket()
else
..()
/mob/living/carbon/human/resist_restraints()
if(wear_suit && istype(wear_suit, /obj/item/clothing/suit/straight_jacket))
return escape_straight_jacket()
return ..()
#define RESIST_ATTACK_DEFAULT 0
#define RESIST_ATTACK_CLAWS 1
@@ -172,7 +172,7 @@ This saves us from having to call add_fingerprint() any time something is put in
handcuffed = null
if(buckled && buckled.buckle_require_restraints)
buckled.unbuckle_mob()
update_inv_handcuffed()
update_handcuffed()
else if (W == legcuffed)
legcuffed = null
update_inv_legcuffed()
+77 -108
View File
@@ -25,12 +25,6 @@
#define HUMAN_COMBUSTION_TEMP 524 //524k is the sustained combustion temperature of human fat
/mob/living/carbon/human
var/oxygen_alert = 0
var/phoron_alert = 0
var/co2_alert = 0
var/fire_alert = 0
var/pressure_alert = 0
var/temperature_alert = 0
var/in_stasis = 0
var/heartbeat = 0
@@ -46,7 +40,6 @@
//code. Very ugly. I dont care. Moving this stuff here so its easy
//to find it.
blinded = 0
fire_alert = 0 //Reset this here, because both breathe() and handle_environment() have a chance to set it.
//TODO: seperate this out
// update the current life tick, can be used to e.g. only do something every 4 ticks
@@ -384,8 +377,7 @@
if(suiciding)
failed_last_breath = 1
adjustOxyLoss(2)//If you are suiciding, you should die a little bit faster
oxygen_alert = max(oxygen_alert, 1)
suiciding --
suiciding--
return 0
if(does_not_breathe)
@@ -405,9 +397,10 @@
if(!L.is_bruised() && prob(8))
rupture_lung()
oxygen_alert = max(oxygen_alert, 1)
throw_alert("pressure", /obj/screen/alert/lowpressure)
return 0
else
clear_alert("pressure")
var/safe_pressure_min = species.minimum_breath_pressure // Minimum safe partial pressure of breathable gas in kPa
@@ -466,6 +459,7 @@
var/inhale_pp = (inhaling/breath.total_moles)*breath_pressure
var/toxins_pp = (poison/breath.total_moles)*breath_pressure
// To be clear, this isn't how much they're exhaling -- it's the amount of the species exhale_gas that they just
var/exhaled_pp = (exhaling/breath.total_moles)*breath_pressure
// Not enough to breathe
@@ -478,10 +472,23 @@
adjustOxyLoss(max(HUMAN_MAX_OXYLOSS*(1-ratio), 0))
failed_inhale = 1
oxygen_alert = max(oxygen_alert, 1)
switch(breath_type)
if("oxygen")
throw_alert("oxy", /obj/screen/alert/not_enough_oxy)
if("phoron")
throw_alert("oxy", /obj/screen/alert/not_enough_tox)
if("nitrogen")
throw_alert("oxy", /obj/screen/alert/not_enough_nitro)
if("carbon_dioxide")
throw_alert("oxy", /obj/screen/alert/not_enough_co2)
if("volatile_fuel")
throw_alert("oxy", /obj/screen/alert/not_enough_fuel)
if("sleeping_agent")
throw_alert("oxy", /obj/screen/alert/not_enough_n2o)
else
// We're in safe limits
oxygen_alert = 0
clear_alert("oxy")
inhaled_gas_used = inhaling/6
@@ -492,16 +499,15 @@
// Too much exhaled gas in the air
if(exhaled_pp > safe_exhaled_max)
if (!co2_alert|| prob(15))
if (prob(15))
var/word = pick("extremely dizzy","short of breath","faint","confused")
to_chat(src, "<span class='danger'>You feel [word].</span>")
adjustOxyLoss(HUMAN_MAX_OXYLOSS)
co2_alert = 1
failed_exhale = 1
else if(exhaled_pp > safe_exhaled_max * 0.7)
if (!co2_alert || prob(1))
if (!prob(1))
var/word = pick("dizzy","short of breath","faint","momentarily confused")
to_chat(src, "<span class='warning'>You feel [word].</span>")
@@ -511,26 +517,22 @@
//give them some oxyloss, up to the limit - we don't want people falling unconcious due to CO2 alone until they're pretty close to safe_exhaled_max.
if (getOxyLoss() < 50*ratio)
adjustOxyLoss(HUMAN_MAX_OXYLOSS)
co2_alert = 1
failed_exhale = 1
else if(exhaled_pp > safe_exhaled_max * 0.6)
if (prob(0.3))
if(prob(0.3))
var/word = pick("a little dizzy","short of breath")
to_chat(src, "<span class='warning'>You feel [word].</span>")
else
co2_alert = 0
// Too much poison in the air.
if(toxins_pp > safe_toxins_max)
var/ratio = (poison/safe_toxins_max) * 10
if(reagents)
reagents.add_reagent("toxin", CLAMP(ratio, MIN_TOXIN_DAMAGE, MAX_TOXIN_DAMAGE))
breath.adjust_gas(poison_type, -poison/6, update = 0) //update after
phoron_alert = max(phoron_alert, 1)
throw_alert("tox_in_air", /obj/screen/alert/tox_in_air)
else
phoron_alert = 0
clear_alert("tox_in_air")
// If there's some other shit in the air lets deal with it here.
if(breath.gas["sleeping_agent"])
@@ -573,25 +575,24 @@
if(breath.temperature >= species.breath_heat_level_1)
if(breath.temperature < species.breath_heat_level_2)
apply_damage(HEAT_GAS_DAMAGE_LEVEL_1, BURN, BP_HEAD, used_weapon = "Excessive Heat")
fire_alert = max(fire_alert, 2)
throw_alert("temp", /obj/screen/alert/hot, 1)
else if(breath.temperature < species.breath_heat_level_3)
apply_damage(HEAT_GAS_DAMAGE_LEVEL_2, BURN, BP_HEAD, used_weapon = "Excessive Heat")
fire_alert = max(fire_alert, 2)
throw_alert("temp", /obj/screen/alert/hot, 2)
else
apply_damage(HEAT_GAS_DAMAGE_LEVEL_3, BURN, BP_HEAD, used_weapon = "Excessive Heat")
fire_alert = max(fire_alert, 2)
throw_alert("temp", /obj/screen/alert/hot, 3)
else if(breath.temperature <= species.breath_cold_level_1)
if(breath.temperature > species.breath_cold_level_2)
apply_damage(COLD_GAS_DAMAGE_LEVEL_1, BURN, BP_HEAD, used_weapon = "Excessive Cold")
fire_alert = max(fire_alert, 1)
throw_alert("temp", /obj/screen/alert/cold, 1)
else if(breath.temperature > species.breath_cold_level_3)
apply_damage(COLD_GAS_DAMAGE_LEVEL_2, BURN, BP_HEAD, used_weapon = "Excessive Cold")
fire_alert = max(fire_alert, 1)
throw_alert("temp", /obj/screen/alert/cold, 2)
else
apply_damage(COLD_GAS_DAMAGE_LEVEL_3, BURN, BP_HEAD, used_weapon = "Excessive Cold")
fire_alert = max(fire_alert, 1)
throw_alert("temp", /obj/screen/alert/cold, 3)
//breathing in hot/cold air also heats/cools you a bit
var/temp_adj = breath.temperature - bodytemperature
@@ -613,6 +614,9 @@
else if(breath.temperature <= species.cold_discomfort_level)
species.get_environment_discomfort(src,"cold")
else
clear_alert("temp")
breath.update_values()
return 1
@@ -653,7 +657,7 @@
loc_temp = environment.temperature
if(adjusted_pressure < species.warning_high_pressure && adjusted_pressure > species.warning_low_pressure && abs(loc_temp - bodytemperature) < 20 && bodytemperature < species.heat_level_1 && bodytemperature > species.cold_level_1)
pressure_alert = 0
clear_alert("pressure")
return // Temperatures are within normal ranges, fuck all this processing. ~Ccomp
//Body temperature adjusts depending on surrounding atmosphere based on your thermal protection (convection)
@@ -674,7 +678,6 @@
// +/- 50 degrees from 310.15K is the 'safe' zone, where no damage is dealt.
if(bodytemperature >= species.heat_level_1)
//Body temperature is too hot.
fire_alert = max(fire_alert, 1)
if(status_flags & GODMODE)
return 1 //godmode
@@ -691,11 +694,9 @@
burn_dam = HEAT_DAMAGE_LEVEL_1
take_overall_damage(burn=burn_dam, used_weapon = "High Body Temperature")
fire_alert = max(fire_alert, 2)
else if(bodytemperature <= species.cold_level_1)
//Body temperature is too cold.
fire_alert = max(fire_alert, 1)
if(status_flags & GODMODE)
return 1 //godmode
@@ -713,7 +714,6 @@
cold_dam = COLD_DAMAGE_LEVEL_1
take_overall_damage(burn=cold_dam, used_weapon = "Low Body Temperature")
fire_alert = max(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!
@@ -723,13 +723,13 @@
if(adjusted_pressure >= species.hazard_high_pressure)
var/pressure_damage = min( ( (adjusted_pressure / species.hazard_high_pressure) -1 )*PRESSURE_DAMAGE_COEFFICIENT , MAX_HIGH_PRESSURE_DAMAGE)
take_overall_damage(brute=pressure_damage, used_weapon = "High Pressure")
pressure_alert = 2
throw_alert("pressure", /obj/screen/alert/highpressure, 2)
else if(adjusted_pressure >= species.warning_high_pressure)
pressure_alert = 1
throw_alert("pressure", /obj/screen/alert/highpressure, 1)
else if(adjusted_pressure >= species.warning_low_pressure)
pressure_alert = 0
clear_alert("pressure")
else if(adjusted_pressure >= species.hazard_low_pressure)
pressure_alert = -1
throw_alert("pressure", /obj/screen/alert/lowpressure, 1)
else
if( !(COLD_RESISTANCE in mutations))
if(!isSynthetic() || !nif || !nif.flag_check(NIF_O_PRESSURESEAL,NIF_FLAGS_OTHER)) //VOREStation Edit - NIF pressure seals
@@ -747,9 +747,9 @@
// Firesuits (Min protection = 0.2 atmospheres) decrease oxyloss to 1/5
adjustOxyLoss(pressure_dam)
pressure_alert = -2
throw_alert("pressure", /obj/screen/alert/lowpressure, 2)
else
pressure_alert = -1
clear_alert("pressure")
return
@@ -1009,12 +1009,14 @@
//Are they SSD? If so we'll keep them asleep but work off some of that sleep var in case of stoxin or similar.
if(client || sleeping > 3)
AdjustSleeping(-1)
throw_alert("asleep", /obj/screen/alert/asleep)
if( prob(2) && health && !hal_crit )
spawn(0)
emote("snore")
//CONSCIOUS
else
set_stat(CONSCIOUS)
clear_alert("asleep")
//Periodically double-check embedded_flag
if(embedded_flag && !(life_tick % 10))
@@ -1046,19 +1048,24 @@
SetBlinded(0)
blinded = 0
eye_blurry = 0
clear_alert("blind")
else if(!vision || vision.is_broken()) // Vision organs cut out or broken? Permablind.
SetBlinded(1)
blinded = 1
eye_blurry = 1
throw_alert("blind", /obj/screen/alert/blind)
else //You have the requisite organs
if(sdisabilities & BLIND) // Disabled-blind, doesn't get better on its own
blinded = 1
throw_alert("blind", /obj/screen/alert/blind)
else if(eye_blind) // Blindness, heals slowly over time
AdjustBlinded(-1)
blinded = 1
throw_alert("blind", /obj/screen/alert/blind)
else if(istype(glasses, /obj/item/clothing/glasses/sunglasses/blindfold)) //resting your eyes with a blindfold heals blurry eyes faster
eye_blurry = max(eye_blurry-3, 0)
blinded = 1
throw_alert("blind", /obj/screen/alert/blind)
//blurry sight
if(vision.is_bruised()) // Vision organs impaired? Permablurry.
@@ -1213,83 +1220,41 @@
healths_ma.overlays += health_images
healths.appearance = healths_ma
if(nutrition_icon)
var/prefix = isSynthetic() ? "c" : null
switch(nutrition)
if(450 to INFINITY) nutrition_icon.icon_state = "[prefix]nutrition0"
if(350 to 450) nutrition_icon.icon_state = "[prefix]nutrition1"
if(250 to 350) nutrition_icon.icon_state = "[prefix]nutrition2"
if(150 to 250) nutrition_icon.icon_state = "[prefix]nutrition3"
else nutrition_icon.icon_state = "[prefix]nutrition4"
if(pressure)
pressure.icon_state = "pressure[pressure_alert]"
var/fat_alert = /obj/screen/alert/fat
var/hungry_alert = /obj/screen/alert/hungry
var/starving_alert = /obj/screen/alert/starving
// if(rest) //Not used with new UI
// if(resting || lying || sleeping) rest.icon_state = "rest1"
// else rest.icon_state = "rest0"
if(toxin)
if(hal_screwyhud == 4 || (phoron_alert && !does_not_breathe)) toxin.icon_state = "tox1"
else toxin.icon_state = "tox0"
if(oxygen)
if(hal_screwyhud == 3 || (oxygen_alert && !does_not_breathe)) oxygen.icon_state = "oxy1"
else oxygen.icon_state = "oxy0"
if(fire)
if(fire_alert) fire.icon_state = "fire[fire_alert]" //fire_alert is either 0 if no alert, 1 for cold and 2 for heat.
else fire.icon_state = "fire0"
if(get_species() == SPECIES_CUSTOM)
var/datum/species/custom/C = species
if(/datum/trait/bloodsucker in C.traits)
fat_alert = /obj/screen/alert/fat/vampire
hungry_alert = /obj/screen/alert/hungry/vampire
starving_alert = /obj/screen/alert/starving/vampire
else if(isSynthetic())
fat_alert = /obj/screen/alert/fat/synth
hungry_alert = /obj/screen/alert/hungry/synth
starving_alert = /obj/screen/alert/starving/synth
if(bodytemp)
if (!species)
switch(bodytemperature) //310.055 optimal body temp
if(370 to INFINITY) bodytemp.icon_state = "temp4"
if(350 to 370) bodytemp.icon_state = "temp3"
if(335 to 350) bodytemp.icon_state = "temp2"
if(320 to 335) bodytemp.icon_state = "temp1"
if(300 to 320) 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"
switch(nutrition)
if(450 to INFINITY)
throw_alert("nutrition", fat_alert)
// if(350 to 450)
// if(250 to 350) // Alternative more-detailed tiers, not used.
if(250 to 450)
clear_alert("nutrition")
if(150 to 250)
throw_alert("nutrition", hungry_alert)
else
//TODO: precalculate all of this stuff when the species datum is created
var/base_temperature = species.body_temperature
if(base_temperature == null) //some species don't have a set metabolic temperature
base_temperature = (species.heat_level_1 + species.cold_level_1)/2
var/temp_step
if (bodytemperature >= base_temperature)
temp_step = (species.heat_level_1 - base_temperature)/4
if (bodytemperature >= species.heat_level_1)
bodytemp.icon_state = "temp4"
else if (bodytemperature >= base_temperature + temp_step*3)
bodytemp.icon_state = "temp3"
else if (bodytemperature >= base_temperature + temp_step*2)
bodytemp.icon_state = "temp2"
else if (bodytemperature >= base_temperature + temp_step*1)
bodytemp.icon_state = "temp1"
else
bodytemp.icon_state = "temp0"
else if (bodytemperature < base_temperature)
temp_step = (base_temperature - species.cold_level_1)/4
if (bodytemperature <= species.cold_level_1)
bodytemp.icon_state = "temp-4"
else if (bodytemperature <= base_temperature - temp_step*3)
bodytemp.icon_state = "temp-3"
else if (bodytemperature <= base_temperature - temp_step*2)
bodytemp.icon_state = "temp-2"
else if (bodytemperature <= base_temperature - temp_step*1)
bodytemp.icon_state = "temp-1"
else
bodytemp.icon_state = "temp0"
throw_alert("nutrition", starving_alert)
if(blinded)
overlay_fullscreen("blind", /obj/screen/fullscreen/blind)
throw_alert("blind", /obj/screen/alert/blind)
else if(!machine)
clear_fullscreens()
clear_alert("blind")
if(disabilities & NEARSIGHTED) //this looks meh but saves a lot of memory by not requiring to add var/prescription
if(glasses) //to every /obj/item
@@ -1301,6 +1266,10 @@
set_fullscreen(eye_blurry, "blurry", /obj/screen/fullscreen/blurry)
set_fullscreen(druggy, "high", /obj/screen/fullscreen/high)
if(druggy)
throw_alert("high", /obj/screen/alert/high)
else
clear_alert("high")
if(config.welder_vision)
var/found_welder
@@ -146,9 +146,11 @@
else
H.adjustOxyLoss(ALRAUNE_CRIT_MAX_OXYLOSS)
H.oxygen_alert = max(H.oxygen_alert, 1)
H.throw_alert("pressure", /obj/screen/alert/lowpressure)
return // skip air processing if there's no air
else
H.clear_alert("pressure")
// now into the good stuff
@@ -188,10 +190,10 @@
H.adjustOxyLoss(max(ALRAUNE_MAX_OXYLOSS*(1-ratio), 0))
failed_inhale = 1
H.oxygen_alert = max(H.oxygen_alert, 1)
H.throw_alert("oxy", /obj/screen/alert/not_enough_co2)
else
// We're in safe limits
H.oxygen_alert = 0
H.clear_alert("oxy")
inhaled_gas_used = inhaling/6
breath.adjust_gas("carbon_dioxide", -inhaled_gas_used, update = 0) //update afterwards
@@ -199,10 +201,9 @@
//Now we handle CO2.
if(inhale_pp > safe_exhaled_max * 0.7) // For a human, this would be too much exhaled gas in the air. But plants don't care.
H.co2_alert = 1 // Give them the alert on the HUD. They'll be aware when the good stuff is present.
H.throw_alert("co2", /obj/screen/alert/too_much_co2/plant) // Give them the alert on the HUD. They'll be aware when the good stuff is present.
else
H.co2_alert = 0
H.clear_alert("co2")
//do the CO2 buff stuff here
@@ -225,9 +226,9 @@
if(H.reagents)
H.reagents.add_reagent("toxin", CLAMP(ratio, MIN_TOXIN_DAMAGE, MAX_TOXIN_DAMAGE))
breath.adjust_gas(poison_type, -poison/6, update = 0) //update after
H.phoron_alert = max(H.phoron_alert, 1)
H.throw_alert("tox_in_air", /obj/screen/alert/tox_in_air)
else
H.phoron_alert = 0
H.clear_alert("tox_in_air")
// If there's some other shit in the air lets deal with it here.
if(breath.gas["sleeping_agent"])
@@ -271,24 +272,18 @@
if(breath.temperature >= breath_heat_level_1)
if(breath.temperature < breath_heat_level_2)
H.apply_damage(HEAT_GAS_DAMAGE_LEVEL_1, BURN, bodypart, used_weapon = "Excessive Heat")
H.fire_alert = max(H.fire_alert, 2)
else if(breath.temperature < breath_heat_level_3)
H.apply_damage(HEAT_GAS_DAMAGE_LEVEL_2, BURN, bodypart, used_weapon = "Excessive Heat")
H.fire_alert = max(H.fire_alert, 2)
else
H.apply_damage(HEAT_GAS_DAMAGE_LEVEL_3, BURN, bodypart, used_weapon = "Excessive Heat")
H.fire_alert = max(H.fire_alert, 2)
else if(breath.temperature <= breath_cold_level_1)
if(breath.temperature > breath_cold_level_2)
H.apply_damage(COLD_GAS_DAMAGE_LEVEL_1, BURN, bodypart, used_weapon = "Excessive Cold")
H.fire_alert = max(H.fire_alert, 1)
else if(breath.temperature > breath_cold_level_3)
H.apply_damage(COLD_GAS_DAMAGE_LEVEL_2, BURN, bodypart, used_weapon = "Excessive Cold")
H.fire_alert = max(H.fire_alert, 1)
else
H.apply_damage(COLD_GAS_DAMAGE_LEVEL_3, BURN, bodypart, used_weapon = "Excessive Cold")
H.fire_alert = max(H.fire_alert, 1)
//breathing in hot/cold air also heats/cools you a bit
@@ -68,9 +68,6 @@
/datum/trait/bloodsucker/apply(var/datum/species/S,var/mob/living/carbon/human/H)
..(S,H)
H.verbs |= /mob/living/carbon/human/proc/bloodsuck
spawn(10 SECONDS) // Ugh!
if(H?.nutrition_icon)
H.nutrition_icon.icon = 'icons/mob/screen/vamp_hunger_vr.dmi'
/datum/trait/succubus_drain
name = "Succubus Drain"
@@ -855,11 +855,14 @@ var/global/list/damage_icon_parts = list() //see UpdateDamageIcon()
if(QDESTROYING(src))
return
clear_alert("legcuffed")
remove_layer(LEGCUFF_LAYER)
if(!legcuffed)
return //Not legcuffed, why bother.
throw_alert("legcuffed", /obj/screen/alert/restrained/legcuffed, new_master = legcuffed)
overlays_standing[LEGCUFF_LAYER] = legcuffed.make_worn_icon(body_type = species.get_bodytype(src), slot_name = slot_legcuffed_str, default_icon = INV_LCUFF_DEF_ICON, default_layer = LEGCUFF_LAYER)
apply_layer(LEGCUFF_LAYER)
+79 -153
View File
@@ -1,173 +1,99 @@
/mob/living/carbon/process_resist()
//drop && roll
if(on_fire && !buckled)
adjust_fire_stacks(-1.2)
Weaken(3)
spin(32,2)
/mob/living/carbon/resist_fire()
adjust_fire_stacks(-1.2)
Weaken(3)
spin(32,2)
visible_message(
"<span class='danger'>[src] rolls on the floor, trying to put themselves out!</span>",
"<span class='notice'>You stop, drop, and roll!</span>"
)
sleep(30)
if(fire_stacks <= 0)
visible_message(
"<span class='danger'>[src] rolls on the floor, trying to put themselves out!</span>",
"<span class='notice'>You stop, drop, and roll!</span>"
"<span class='danger'>[src] has successfully extinguished themselves!</span>",
"<span class='notice'>You extinguish yourself.</span>"
)
sleep(30)
if(fire_stacks <= 0)
visible_message(
"<span class='danger'>[src] has successfully extinguished themselves!</span>",
"<span class='notice'>You extinguish yourself.</span>"
)
ExtinguishMob()
return TRUE
ExtinguishMob()
return TRUE
/mob/living/carbon/resist_restraints()
var/obj/item/I = null
if(handcuffed)
spawn() escape_handcuffs()
I = handcuffed
else if(legcuffed)
spawn() escape_legcuffs()
else
..()
I = legcuffed
if(I)
setClickCooldown(100)
cuff_resist(I, cuff_break = can_break_cuffs())
/mob/living/carbon/proc/escape_handcuffs()
//if(!(last_special <= world.time)) return
/mob/living/carbon/proc/reduce_cuff_time()
return FALSE
//This line represent a significant buff to grabs...
// We don't have to check the click cooldown because /mob/living/verb/resist() has done it for us, we can simply set the delay
setClickCooldown(100)
/mob/living/carbon/proc/cuff_resist(obj/item/weapon/handcuffs/I, breakouttime = 1200, cuff_break = 0)
if(istype(I))
breakouttime = I.breakouttime
if(can_break_cuffs()) //Don't want to do a lot of logic gating here.
break_handcuffs()
var/displaytime = breakouttime / 10
var/reduceCuffTime = reduce_cuff_time()
if(reduceCuffTime)
breakouttime /= reduceCuffTime
displaytime /= reduceCuffTime
if(cuff_break)
visible_message("<span class='danger'>[src] is trying to break [I]!</span>",
"<span class='warning'>You attempt to break your [I]. (This will take around 5 seconds and you need to stand still)</span>")
if(do_after(src, 5 SECONDS, target = src, incapacitation_flags = INCAPACITATION_DEFAULT & ~INCAPACITATION_RESTRAINED))
if(!I || buckled)
return
visible_message("<span class='danger'>[src] manages to break [I]!</span>",
"<span class='warning'>You successfully break your [I].</span>")
say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" ))
if(I == handcuffed)
handcuffed = null
update_handcuffed()
else if(I == legcuffed)
legcuffed = null
update_inv_legcuffed()
if(buckled && buckled.buckle_require_restraints)
buckled.unbuckle_mob()
qdel(I)
else
to_chat(src, "<span class='warning'>You fail to break [I].</span>")
return
visible_message("<span class='danger'>[src] attempts to remove [I]!</span>",
"<span class='warning'>You attempt to remove [I]. (This will take around [displaytime] seconds and you need to stand still)</span>")
if(do_after(src, breakouttime, target = src, incapacitation_flags = INCAPACITATION_DISABLED & INCAPACITATION_KNOCKDOWN))
visible_message("<span class='danger'>[src] manages to remove [I]!</span>",
"<span class='notice'>You successfully remove [I].</span>")
drop_from_inventory(I)
/mob/living/carbon/resist_buckle()
if(!buckled)
return
var/obj/item/weapon/handcuffs/HC = handcuffed
if(!restrained())
return ..()
//A default in case you are somehow handcuffed with something that isn't an obj/item/weapon/handcuffs type
var/breakouttime = 1200
var/displaytime = 2 //Minutes to display in the "this will take X minutes."
//If you are handcuffed with actual handcuffs... Well what do I know, maybe someone will want to handcuff you with toilet paper in the future...
if(istype(HC))
breakouttime = HC.breakouttime
displaytime = breakouttime / 600 //Minutes
var/mob/living/carbon/human/H = src
if(istype(H) && H.gloves && istype(H.gloves,/obj/item/clothing/gloves/gauntlets/rig))
breakouttime /= 2
displaytime /= 2
visible_message(
"<span class='danger'>\The [src] attempts to remove \the [HC]!</span>",
"<span class='warning'>You attempt to remove \the [HC]. (This will take around [displaytime] minutes and you need to stand still)</span>"
)
if(do_after(src, breakouttime, incapacitation_flags = INCAPACITATION_DISABLED & INCAPACITATION_KNOCKDOWN))
if(!handcuffed)
return
visible_message(
"<span class='danger'>\The [src] manages to remove \the [handcuffed]!</span>",
"<span class='notice'>You successfully remove \the [handcuffed].</span>"
)
drop_from_inventory(handcuffed)
/mob/living/carbon/proc/escape_legcuffs()
//if(!(last_special <= world.time)) return
//This line represent a significant buff to grabs...
// We don't have to check the click cooldown because /mob/living/verb/resist() has done it for us, we can simply set the delay
setClickCooldown(100)
if(can_break_cuffs()) //Don't want to do a lot of logic gating here.
break_legcuffs()
return
var/obj/item/weapon/handcuffs/legcuffs/LC = legcuffed
//A default in case you are somehow legcuffed with something that isn't an obj/item/weapon/handcuffs/legcuffs type
var/breakouttime = 1200
var/displaytime = 2 //Minutes to display in the "this will take X minutes."
//If you are legcuffed with actual legcuffs... Well what do I know, maybe someone will want to handcuff you with toilet paper in the future...
if(istype(LC))
breakouttime = LC.breakouttime
displaytime = breakouttime / 600 //Minutes
var/mob/living/carbon/human/H = src
if(istype(H) && H.shoes && istype(H.shoes,/obj/item/clothing/shoes/magboots/rig))
breakouttime /= 2
displaytime /= 2
visible_message(
"<span class='danger'>\The [src] attempts to remove \the [LC]!</span>",
"<span class='warning'>You attempt to remove \the [LC]. (This will take around [displaytime] minutes and you need to stand still)</span>"
"<span class='danger'>[src] attempts to unbuckle themself!</span>",
"<span class='warning'>You attempt to unbuckle yourself. (This will take around 2 minutes and you need to stand still)</span>"
)
if(do_after(src, breakouttime, incapacitation_flags = INCAPACITATION_DISABLED & INCAPACITATION_KNOCKDOWN))
if(!legcuffed)
if(do_after(src, 2 MINUTES, incapacitation_flags = INCAPACITATION_DEFAULT & ~(INCAPACITATION_RESTRAINED | INCAPACITATION_BUCKLED_FULLY)))
if(!buckled)
return
visible_message(
"<span class='danger'>\The [src] manages to remove \the [legcuffed]!</span>",
"<span class='notice'>You successfully remove \the [legcuffed].</span>"
)
drop_from_inventory(legcuffed)
legcuffed = null
update_inv_legcuffed()
visible_message("<span class='danger'>[src] manages to unbuckle themself!</span>",
"<span class='notice'>You successfully unbuckle yourself.</span>")
buckled.user_unbuckle_mob(src, src)
/mob/living/carbon/proc/can_break_cuffs()
if(HULK in mutations)
return 1
/mob/living/carbon/proc/break_handcuffs()
visible_message(
"<span class='danger'>[src] is trying to break \the [handcuffed]!</span>",
"<span class='warning'>You attempt to break your [handcuffed.name]. (This will take around 5 seconds and you need to stand still)</span>"
)
if(do_after(src, 5 SECONDS, incapacitation_flags = INCAPACITATION_DEFAULT & ~INCAPACITATION_RESTRAINED))
if(!handcuffed || buckled)
return
visible_message(
"<span class='danger'>[src] manages to break \the [handcuffed]!</span>",
"<span class='warning'>You successfully break your [handcuffed.name].</span>"
)
say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" ))
qdel(handcuffed)
handcuffed = null
if(buckled && buckled.buckle_require_restraints)
buckled.unbuckle_mob()
update_inv_handcuffed()
/mob/living/carbon/proc/break_legcuffs()
to_chat(src, "<span class='warning'>You attempt to break your legcuffs. (This will take around 5 seconds and you need to stand still)</span>")
visible_message("<span class='danger'>[src] is trying to break the legcuffs!</span>")
if(do_after(src, 5 SECONDS, incapacitation_flags = INCAPACITATION_DEFAULT & ~INCAPACITATION_RESTRAINED))
if(!legcuffed || buckled)
return
visible_message(
"<span class='danger'>[src] manages to break the legcuffs!</span>",
"<span class='warning'>You successfully break your legcuffs.</span>"
)
say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" ))
qdel(legcuffed)
legcuffed = null
update_inv_legcuffed()
/mob/living/carbon/escape_buckle()
if(!buckled) return
if(!restrained())
..()
else
setClickCooldown(100)
visible_message(
"<span class='danger'>[usr] attempts to unbuckle themself!</span>",
"<span class='warning'>You attempt to unbuckle yourself. (This will take around 2 minutes and you need to stand still)</span>"
)
if(do_after(usr, 2 MINUTES, incapacitation_flags = INCAPACITATION_DEFAULT & ~(INCAPACITATION_RESTRAINED | INCAPACITATION_BUCKLED_FULLY)))
if(!buckled)
return
visible_message("<span class='danger'>[usr] manages to unbuckle themself!</span>",
"<span class='notice'>You successfully unbuckle yourself.</span>")
buckled.user_unbuckle_mob(src, src)
+6 -1
View File
@@ -160,9 +160,14 @@
//Eyes
if(sdisabilities & BLIND || stat) //blindness from disability or unconsciousness doesn't get better on its own
SetBlinded(1)
throw_alert("blind", /obj/screen/alert/blind)
else if(eye_blind) //blindness, heals slowly over time
AdjustBlinded(-1)
else if(eye_blurry) //blurry eyes heal slowly
throw_alert("blind", /obj/screen/alert/blind)
else
clear_alert("blind")
if(eye_blurry) //blurry eyes heal slowly
eye_blurry = max(eye_blurry-1, 0)
//Ears
+24 -38
View File
@@ -860,53 +860,25 @@ default behaviour is:
process_resist()
/mob/living/proc/process_resist()
//Getting out of someone's inventory.
if(istype(src.loc, /obj/item/weapon/holder))
escape_inventory(src.loc)
return
//unbuckling yourself
if(buckled)
spawn() escape_buckle()
resist_buckle()
return TRUE
//Breaking out of a locker?
if( src.loc && (istype(src.loc, /obj/structure/closet)) )
var/obj/structure/closet/C = loc
spawn() C.mob_breakout(src)
if(isobj(loc))
var/obj/C = loc
C.container_resist(src)
return TRUE
if(istype(loc,/obj/item/clothing))
spawn() escape_clothes(loc)
else if(canmove)
if(on_fire)
resist_fire() //stop, drop, and roll
else
resist_restraints()
if(attempt_vr(src,"vore_process_resist",args)) return TRUE //VOREStation Code
/mob/living/proc/escape_inventory(obj/item/weapon/holder/H)
if(H != src.loc) return
var/mob/M = H.loc //Get our mob holder (if any).
if(istype(M))
M.drop_from_inventory(H)
to_chat(M, "<span class='warning'>\The [H] wriggles out of your grip!</span>")
to_chat(src, "<span class='warning'>You wriggle out of \the [M]'s grip!</span>")
// Update whether or not this mob needs to pass emotes to contents.
for(var/atom/A in M.contents)
if(istype(A,/mob/living/simple_mob/animal/borer) || istype(A,/obj/item/weapon/holder))
return
else if(istype(H.loc,/obj/item/clothing/accessory/holster))
var/obj/item/clothing/accessory/holster/holster = H.loc
if(holster.holstered == H)
holster.clear_holster()
to_chat(src, "<span class='warning'>You extricate yourself from \the [holster].</span>")
H.forceMove(get_turf(H))
else if(istype(H.loc,/obj/item))
to_chat(src, "<span class='warning'>You struggle free of \the [H.loc].</span>")
H.forceMove(get_turf(H))
/mob/living/proc/escape_buckle()
/mob/living/proc/resist_buckle()
if(buckled)
if(istype(buckled, /obj/vehicle))
var/obj/vehicle/vehicle = buckled
@@ -922,6 +894,12 @@ default behaviour is:
if(resisting)
visible_message("<span class='danger'>[src] resists!</span>")
/mob/living/proc/resist_fire()
return
/mob/living/proc/resist_restraints()
return
/mob/living/verb/lay_down()
set name = "Rest"
set category = "IC"
@@ -1335,3 +1313,11 @@ default behaviour is:
BRAIN:<a href='?_src_=vars;mobToDamage=\ref[src];adjustDamage=brain'>[getBrainLoss()]</a>
</font>
"}
/mob/living/update_gravity(has_gravity)
if(!ticker)
return
if(has_gravity)
clear_alert("weightless")
else
throw_alert("weightless", /obj/screen/alert/weightless)
@@ -328,6 +328,7 @@
O.loc = src
src.embedded += O
src.verbs += /mob/proc/yank_out_object
throw_alert("embeddedobject", /obj/screen/alert/embeddedobject)
//This is called when the mob is thrown into a dense turf
/mob/living/proc/turf_collision(var/turf/T, var/speed)
@@ -366,6 +367,7 @@
if(fire_stacks > 0 && !on_fire)
on_fire = 1
handle_light()
throw_alert("fire", /obj/screen/alert/fire)
update_fire()
/mob/living/proc/ExtinguishMob()
@@ -373,6 +375,7 @@
on_fire = 0
fire_stacks = 0
handle_light()
clear_alert("fire")
update_fire()
if(has_modifier_of_type(/datum/modifier/fire))
+2
View File
@@ -11,6 +11,7 @@
return laws.zeroth_law != null
/mob/living/silicon/proc/set_zeroth_law(var/law, var/law_borg, notify = TRUE)
throw_alert("newlaw", /obj/screen/alert/newlaw)
laws_sanity_check()
laws.set_zeroth_law(law, law_borg)
if(notify)
@@ -76,6 +77,7 @@
log_and_message_admins("cleared the supplied laws of [src]")
/mob/living/silicon/proc/notify_of_law_change(message)
throw_alert("newlaw", /obj/screen/alert/newlaw)
if((last_law_notification + 1 SECOND) > world.time)
return
last_law_notification = world.time
+47 -37
View File
@@ -248,35 +248,22 @@
src.mind.special_role = "traitor"
traitors.current_antagonists |= src.mind
if (src.cells)
if (src.cell)
var/cellcharge = src.cell.charge/src.cell.maxcharge
switch(cellcharge)
if(0.75 to INFINITY)
src.cells.icon_state = "charge4"
if(0.5 to 0.75)
src.cells.icon_state = "charge3"
if(0.25 to 0.5)
src.cells.icon_state = "charge2"
if(0 to 0.25)
src.cells.icon_state = "charge1"
else
src.cells.icon_state = "charge0"
else
src.cells.icon_state = "charge-empty"
update_cell()
if(bodytemp)
switch(src.bodytemperature) //310.055 optimal body temp
if(335 to INFINITY)
src.bodytemp.icon_state = "temp2"
if(320 to 335)
src.bodytemp.icon_state = "temp1"
if(300 to 320)
src.bodytemp.icon_state = "temp0"
if(260 to 300)
src.bodytemp.icon_state = "temp-1"
var/turf/T = get_turf(src)
var/datum/gas_mixture/environment = T.return_air()
if(environment)
switch(environment.temperature) //310.055 optimal body temp
if(400 to INFINITY)
throw_alert("temp", /obj/screen/alert/hot/robot, 2)
if(360 to 400)
throw_alert("temp", /obj/screen/alert/hot/robot, 1)
if(260 to 360)
clear_alert("temp")
if(200 to 260)
throw_alert("temp", /obj/screen/alert/cold/robot, 1)
else
src.bodytemp.icon_state = "temp-2"
throw_alert("temp", /obj/screen/alert/cold/robot, 2)
//Oxygen and fire does nothing yet!!
// if (src.oxygen) src.oxygen.icon_state = "oxy[src.oxygen_alert ? 1 : 0]"
@@ -298,20 +285,43 @@
if(client && !client.adminobs)
reset_view(null)
if(emagged)
throw_alert("hacked", /obj/screen/alert/hacked)
else
clear_alert("hacked")
return 1
/mob/living/silicon/robot/proc/update_cell()
if(cell)
var/cellcharge = cell.charge/cell.maxcharge
switch(cellcharge)
if(0.75 to INFINITY)
clear_alert("charge")
if(0.5 to 0.75)
throw_alert("charge", /obj/screen/alert/lowcell, 1)
if(0.25 to 0.5)
throw_alert("charge", /obj/screen/alert/lowcell, 2)
if(0.01 to 0.25)
throw_alert("charge", /obj/screen/alert/lowcell, 3)
else
throw_alert("charge", /obj/screen/alert/emptycell)
else
throw_alert("charge", /obj/screen/alert/nocell)
/mob/living/silicon/robot/proc/update_items()
if (src.client)
src.client.screen -= src.contents
for(var/obj/I in src.contents)
if(client)
client.screen -= contents
for(var/obj/I in contents)
if(I && !(istype(I,/obj/item/weapon/cell) || istype(I,/obj/item/device/radio) || istype(I,/obj/machinery/camera) || istype(I,/obj/item/device/mmi)))
src.client.screen += I
if(src.module_state_1)
src.module_state_1:screen_loc = ui_inv1
if(src.module_state_2)
src.module_state_2:screen_loc = ui_inv2
if(src.module_state_3)
src.module_state_3:screen_loc = ui_inv3
client.screen += I
if(module_state_1)
module_state_1:screen_loc = ui_inv1
if(module_state_2)
module_state_2:screen_loc = ui_inv2
if(module_state_3)
module_state_3:screen_loc = ui_inv3
updateicon()
/mob/living/silicon/robot/proc/process_killswitch()
@@ -34,7 +34,6 @@
//Hud stuff
var/obj/screen/cells = null
var/obj/screen/inv1 = null
var/obj/screen/inv2 = null
var/obj/screen/inv3 = null
@@ -935,6 +934,10 @@
// They stay locked down if their wire is cut.
if(wires.LockedCut())
state = 1
if(state)
throw_alert("locked", /obj/screen/alert/locked)
else
clear_alert("locked")
lockdown = state
lockcharge = state
update_canmove()
+47 -51
View File
@@ -52,19 +52,14 @@
healths.icon_state = "health7"
//Updates the nutrition while we're here
if(nutrition_icon)
var/food_per = (nutrition / initial(nutrition)) * 100
switch(food_per)
if(90 to INFINITY)
nutrition_icon.icon_state = "nutrition0"
if(75 to 90)
nutrition_icon.icon_state = "nutrition1"
if(50 to 75)
nutrition_icon.icon_state = "nutrition2"
if(25 to 50)
nutrition_icon.icon_state = "nutrition3"
if(0 to 25)
nutrition_icon.icon_state = "nutrition4"
var/food_per = (nutrition / initial(nutrition)) * 100
switch(food_per)
if(90 to INFINITY)
clear_alert("nutrition")
if(50 to 90)
throw_alert("nutrition", /obj/screen/alert/hungry)
if(-INFINITY to 50)
throw_alert("nutrition", /obj/screen/alert/starving)
// Override for special bullshit.
/mob/living/simple_mob/proc/handle_special()
@@ -91,54 +86,55 @@
if( abs(Environment.temperature - bodytemperature) > temperature_range ) //VOREStation Edit: heating adjustments
bodytemperature += ((Environment.temperature - bodytemperature) / 5)
if(min_oxy)
if(Environment.gas["oxygen"] < min_oxy)
atmos_unsuitable = 1
if(max_oxy)
if(Environment.gas["oxygen"] > max_oxy)
atmos_unsuitable = 1
if(min_tox)
if(Environment.gas["phoron"] < min_tox)
atmos_unsuitable = 2
if(max_tox)
if(Environment.gas["phoron"] > max_tox)
atmos_unsuitable = 2
if(min_n2)
if(Environment.gas["nitrogen"] < min_n2)
atmos_unsuitable = 1
if(max_n2)
if(Environment.gas["nitrogen"] > max_n2)
atmos_unsuitable = 1
if(min_co2)
if(Environment.gas["carbon_dioxide"] < min_co2)
atmos_unsuitable = 1
if(max_co2)
if(Environment.gas["carbon_dioxide"] > max_co2)
atmos_unsuitable = 1
if(min_oxy && Environment.gas["oxygen"] < min_oxy)
atmos_unsuitable = 1
throw_alert("oxy", /obj/screen/alert/not_enough_oxy)
else if(max_oxy && Environment.gas["oxygen"] > max_oxy)
atmos_unsuitable = 1
throw_alert("oxy", /obj/screen/alert/too_much_oxy)
else
clear_alert("oxy")
if(min_tox && Environment.gas["phoron"] < min_tox)
atmos_unsuitable = 2
throw_alert("tox_in_air", /obj/screen/alert/not_enough_tox)
else if(max_tox && Environment.gas["phoron"] > max_tox)
atmos_unsuitable = 2
throw_alert("tox_in_air", /obj/screen/alert/tox_in_air)
else
clear_alert("tox_in_air")
if(min_n2 && Environment.gas["nitrogen"] < min_n2)
atmos_unsuitable = 1
throw_alert("n2o", /obj/screen/alert/not_enough_nitro)
else if(max_n2 && Environment.gas["nitrogen"] > max_n2)
atmos_unsuitable = 1
throw_alert("n2o", /obj/screen/alert/too_much_nitro)
else
clear_alert("n2o")
if(min_co2 && Environment.gas["carbon_dioxide"] < min_co2)
atmos_unsuitable = 1
throw_alert("co2", /obj/screen/alert/not_enough_co2)
else if(max_co2 && Environment.gas["carbon_dioxide"] > max_co2)
atmos_unsuitable = 1
throw_alert("co2", /obj/screen/alert/too_much_co2)
else
clear_alert("co2")
//Atmos effect
if(bodytemperature < minbodytemp)
fire_alert = 2
adjustFireLoss(cold_damage_per_tick)
if(fire)
fire.icon_state = "fire1"
throw_alert("temp", /obj/screen/alert/cold, 3)
else if(bodytemperature > maxbodytemp)
fire_alert = 1
adjustFireLoss(heat_damage_per_tick)
if(fire)
fire.icon_state = "fire2"
throw_alert("temp", /obj/screen/alert/hot, 3)
else
fire_alert = 0
if(fire)
fire.icon_state = "fire0"
clear_alert("temp")
if(atmos_unsuitable)
adjustOxyLoss(unsuitable_atoms_damage)
if(oxygen)
oxygen.icon_state = "oxy1"
else if(oxygen)
if(oxygen)
oxygen.icon_state = "oxy0"
else
adjustOxyLoss(-unsuitable_atoms_damage)
@@ -159,53 +159,7 @@
healths.screen_loc = ui_health
hud_elements |= healths
//Oxygen dep icon
oxygen = new /obj/screen()
oxygen.icon = ui_style
oxygen.icon_state = "oxy0"
oxygen.name = "oxygen"
oxygen.screen_loc = ui_oxygen
hud_elements |= oxygen
//Toxins present icon
toxin = new /obj/screen()
toxin.icon = ui_style
toxin.icon_state = "tox0"
toxin.name = "toxin"
toxin.screen_loc = ui_toxin
hud_elements |= toxin
//Fire warning
fire = new /obj/screen()
fire.icon = ui_style
fire.icon_state = "fire0"
fire.name = "fire"
fire.screen_loc = ui_fire
hud_elements |= fire
//Pressure warning
pressure = new /obj/screen()
pressure.icon = ui_style
pressure.icon_state = "pressure0"
pressure.name = "pressure"
pressure.screen_loc = ui_pressure
hud_elements |= pressure
//Body temp warning
bodytemp = new /obj/screen()
bodytemp.icon = ui_style
bodytemp.icon_state = "temp0"
bodytemp.name = "body temperature"
bodytemp.screen_loc = ui_temp
hud_elements |= bodytemp
//Nutrition status
nutrition_icon = new /obj/screen()
nutrition_icon.icon = ui_style
nutrition_icon.icon_state = "nutrition0"
nutrition_icon.name = "nutrition"
nutrition_icon.screen_loc = ui_nutrition
hud_elements |= nutrition_icon
pain = new /obj/screen( null )
@@ -67,7 +67,6 @@
var/maxbodytemp = 350 // Maximum of above
var/heat_damage_per_tick = 3 // Amount of damage applied if animal's body temperature is higher than maxbodytemp
var/cold_damage_per_tick = 2 // Same as heat_damage_per_tick, only if the bodytemperature it's lower than minbodytemp
var/fire_alert = 0 // 0 = fine, 1 = hot, 2 = cold
var/min_oxy = 5 // Oxygen in moles, minimum, 0 is 'no minimum'
var/max_oxy = 0 // Oxygen in moles, maximum, 0 is 'no maximum'
-1
View File
@@ -51,7 +51,6 @@
else
client.eye = src
client.perspective = MOB_PERSPECTIVE
reload_fullscreen() // Reload any fullscreen overlays this mob has.
add_click_catcher()
update_client_color()
+9 -6
View File
@@ -22,16 +22,10 @@
pullin = null
purged = null
internals = null
oxygen = null
i_select = null
m_select = null
toxin = null
fire = null
bodytemp = null
healths = null
throw_icon = null
nutrition_icon = null
pressure = null
pain = null
item_use_icon = null
gun_move_icon = null
@@ -962,6 +956,7 @@ mob/proc/yank_out_object()
valid_objects = get_visible_implants(0)
if(valid_objects.len == 1) //Yanking out last object - removing verb.
src.verbs -= /mob/proc/yank_out_object
clear_alert("embeddedobject")
if(ishuman(src))
var/mob/living/carbon/human/H = src
@@ -1233,3 +1228,11 @@ mob/proc/yank_out_object()
/mob/proc/GetAltName()
return ""
/mob/proc/get_ghost(even_if_they_cant_reenter = 0)
if(mind)
return mind.get_ghost(even_if_they_cant_reenter)
/mob/proc/grab_ghost(force)
if(mind)
return mind.grab_ghost(force = force)
-6
View File
@@ -16,16 +16,10 @@
var/obj/screen/pullin = null
var/obj/screen/purged = null
var/obj/screen/internals = null
var/obj/screen/oxygen = null
var/obj/screen/i_select = null
var/obj/screen/m_select = null
var/obj/screen/toxin = null
var/obj/screen/fire = null
var/obj/screen/bodytemp = null
var/obj/screen/healths = null
var/obj/screen/throw_icon = null
var/obj/screen/nutrition_icon = null
var/obj/screen/pressure = null
var/obj/screen/pain = null
var/obj/screen/gun/item/item_use_icon = null
var/obj/screen/gun/radio/radio_use_icon = null
+11 -1
View File
@@ -469,6 +469,8 @@ This function completely restores a damaged organ to perfect condition.
if(!istype(implanted_object,/obj/item/weapon/implant) && !istype(implanted_object,/obj/item/device/nif)) // We don't want to remove REAL implants. Just shrapnel etc. //VOREStation Edit - NIFs pls
implanted_object.loc = get_turf(src)
implants -= implanted_object
if(!owner.has_embedded_objects())
owner.clear_alert("embeddedobject")
if(owner && !ignore_prosthetic_prefs)
if(owner.client && owner.client.prefs && owner.client.prefs.real_name == owner.real_name)
@@ -1184,6 +1186,7 @@ Note that amputating the affected organ does in fact remove the infection from t
implants += W
owner.embedded_flag = 1
owner.verbs += /mob/proc/yank_out_object
owner.throw_alert("embeddedobject", /obj/screen/alert/embeddedobject)
W.add_blood(owner)
if(ismob(W.loc))
var/mob/living/H = W.loc
@@ -1372,4 +1375,11 @@ Note that amputating the affected organ does in fact remove the infection from t
if(bling.body_parts_covered & src.body_part)
covering_clothing |= bling
return covering_clothing
return covering_clothing
/mob/living/carbon/human/proc/has_embedded_objects()
. = 0
for(var/obj/item/organ/external/L in organs)
for(var/obj/item/I in L.implants)
if(!istype(I,/obj/item/weapon/implant) && !istype(I,/obj/item/device/nif))
return 1
+2
View File
@@ -206,6 +206,8 @@
user.visible_message("<span class='notice'>[user] takes something out of incision on [target]'s [affected.name] with \the [tool]!</span>", \
"<span class='notice'>You take [obj] out of incision on [target]'s [affected.name]s with \the [tool]!</span>" )
affected.implants -= obj
if(!target.has_embedded_objects())
target.clear_alert("embeddedobject")
BITSET(target.hud_updateflag, IMPLOYAL_HUD)
+3
View File
@@ -720,3 +720,6 @@
dupe.emote_lists[K] += I
return dupe
/obj/belly/container_resist(mob/M)
return relay_resist(M)
+5 -49
View File
@@ -185,10 +185,11 @@
//
/mob/living/proc/vore_process_resist()
//Are we resisting from inside a belly?
if(isbelly(loc))
var/obj/belly/B = loc
B.relay_resist(src)
return TRUE //resist() on living does this TRUE thing.
// if(isbelly(loc))
// var/obj/belly/B = loc
// B.relay_resist(src)
// return TRUE //resist() on living does this TRUE thing.
// Note: This is no longer required, as the refactors to resisting allow bellies to just define container_resist
//Other overridden resists go here
return FALSE
@@ -509,51 +510,6 @@
"oxygen" = 21,
"nitrogen" = 79)
// Procs for micros stuffed into boots and the like to escape from them
/mob/living/proc/escape_clothes(obj/item/clothing/C)
ASSERT(loc == C)
if(ishuman(C.loc)) //In a /mob/living/carbon/human
var/mob/living/carbon/human/H = C.loc
if(H.shoes == C) //Being worn
to_chat(src,"<font color='blue'> You start to climb around the larger creature's feet and ankles!</font>")
to_chat(H,"<font color='red'>Something is trying to climb out of your [C]!</font>")
var/original_loc = H.loc
for(var/escape_time = 100,escape_time > 0,escape_time--)
if(H.loc != original_loc)
to_chat(src,"<font color='red'>You're pinned back underfoot!</font>")
to_chat(H,"<font color='blue'>You pin the escapee back underfoot!</font>")
return
if(loc != C)
return
sleep(1)
to_chat(src,"<font color='blue'>You manage to escape \the [C]!</font>")
to_chat(H,"<font color='red'>Somone has climbed out of your [C]!</font>")
forceMove(H.loc)
else //Being held by a human
to_chat(src,"<font color='blue'>You start to climb out of \the [C]!</font>")
to_chat(H,"<font color='red'>Something is trying to climb out of your [C]!</font>")
for(var/escape_time = 60,escape_time > 0,escape_time--)
if(H.shoes == C)
to_chat(src,"<font color='red'>You're pinned underfoot!</font>")
to_chat(H,"<font color='blue'>You pin the escapee underfoot!</font>")
return
if(loc != C)
return
sleep(1)
to_chat(src,"<font color='blue'>You manage to escape \the [C]!</font>")
to_chat(H,"<font color='red'>Somone has climbed out of your [C]!</font>")
forceMove(H.loc)
to_chat(src,"<font color='blue'>You start to climb out of \the [C]!</font>")
sleep(50)
if(loc == C)
to_chat(src,"<font color='blue'>You climb out of \the [C]!</font>")
forceMove(C.loc)
return
/mob/living/proc/feed_grabbed_to_self_falling_nom(var/mob/living/user, var/mob/living/prey)
var/belly = user.vore_selected
return perform_the_nom(user, prey, user, belly, delay = 1) //1/10th of a second is probably fine.