mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-19 02:56:14 +01:00
Merge branch 'master' of https://github.com/Baystation12/Baystation12
This commit is contained in:
@@ -131,7 +131,7 @@
|
||||
/obj/item/clothing/shoes/swimmingfins
|
||||
desc = "Help you swim good."
|
||||
name = "swimming fins"
|
||||
icon_state = "flipperfeet"
|
||||
icon_state = "flippers"
|
||||
flags = NOSLIP
|
||||
slowdown = SHOES_SLOWDOWN+1
|
||||
species_restricted = null
|
||||
|
||||
@@ -33,6 +33,8 @@
|
||||
|
||||
|
||||
/mob/living/carbon/human/Life()
|
||||
|
||||
|
||||
set invisibility = 0
|
||||
set background = 1
|
||||
|
||||
@@ -128,38 +130,52 @@
|
||||
for(var/obj/item/weapon/grab/G in src)
|
||||
G.process()
|
||||
|
||||
// Calculate how vulnerable the human is to under- and overpressure.
|
||||
// Returns 0 (equals 0 %) if sealed in an undamaged suit, 1 if unprotected (equals 100%).
|
||||
// Suitdamage can modifiy this in 10% steps.
|
||||
/mob/living/carbon/human/proc/get_pressure_weakness()
|
||||
|
||||
//Much like get_heat_protection(), 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.
|
||||
/mob/living/carbon/human/proc/get_pressure_protection()
|
||||
var/pressure_adjustment_coefficient = 1 //Determins how much the clothing you are wearing protects you in percent.
|
||||
var/pressure_adjustment_coefficient = 1 // Assume no protection at first.
|
||||
|
||||
if(head && (head.flags & STOPSPRESSUREDMAGE))
|
||||
pressure_adjustment_coefficient -= PRESSURE_HEAD_REDUCTION_COEFFICIENT
|
||||
if(wear_suit && (wear_suit.flags & STOPSPRESSUREDMAGE) && head && (head.flags & STOPSPRESSUREDMAGE)) // Complete set of pressure-proof suit worn, assume fully sealed.
|
||||
pressure_adjustment_coefficient = 0
|
||||
|
||||
if(wear_suit && (wear_suit.flags & STOPSPRESSUREDMAGE))
|
||||
pressure_adjustment_coefficient -= PRESSURE_SUIT_REDUCTION_COEFFICIENT
|
||||
|
||||
//Handles breaches in your space suit. 10 suit damage equals a 100% loss of pressure reduction.
|
||||
// Handles breaches in your space suit. 10 suit damage equals a 100% loss of pressure protection.
|
||||
if(istype(wear_suit,/obj/item/clothing/suit/space))
|
||||
var/obj/item/clothing/suit/space/S = wear_suit
|
||||
if(S.can_breach && S.damage)
|
||||
var/pressure_loss = S.damage * 0.1
|
||||
pressure_adjustment_coefficient += pressure_loss
|
||||
pressure_adjustment_coefficient += S.damage * 0.1
|
||||
|
||||
pressure_adjustment_coefficient = min(1,max(pressure_adjustment_coefficient,0)) //So it isn't less than 0 or larger than 1.
|
||||
pressure_adjustment_coefficient = min(1,max(pressure_adjustment_coefficient,0)) // So it isn't less than 0 or larger than 1.
|
||||
|
||||
return 1 - pressure_adjustment_coefficient //want 0 to be bad protection, 1 to be good protection
|
||||
return pressure_adjustment_coefficient
|
||||
|
||||
// Calculate how much of the enviroment pressure-difference affects the human.
|
||||
/mob/living/carbon/human/calculate_affecting_pressure(var/pressure)
|
||||
..()
|
||||
var/pressure_difference = abs( pressure - ONE_ATMOSPHERE )
|
||||
var/pressure_difference
|
||||
|
||||
pressure_difference = pressure_difference * (1 - get_pressure_protection())
|
||||
// First get the absolute pressure difference.
|
||||
if(pressure < ONE_ATMOSPHERE) // We are in an underpressure.
|
||||
pressure_difference = ONE_ATMOSPHERE - pressure
|
||||
|
||||
else //We are in an overpressure or standard atmosphere.
|
||||
pressure_difference = pressure - ONE_ATMOSPHERE
|
||||
|
||||
if(pressure_difference < 5) // If the difference is small, don't bother calculating the fraction.
|
||||
pressure_difference = 0
|
||||
|
||||
if(pressure > ONE_ATMOSPHERE)
|
||||
return ONE_ATMOSPHERE + pressure_difference
|
||||
else
|
||||
// Otherwise calculate how much of that absolute pressure difference affects us, can be 0 to 1 (equals 0% to 100%).
|
||||
// This is our relative difference.
|
||||
pressure_difference *= get_pressure_weakness()
|
||||
|
||||
// The difference is always positive to avoid extra calculations.
|
||||
// Apply the relative difference on a standard atmosphere to get the final result.
|
||||
// The return value will be the adjusted_pressure of the human that is the basis of pressure warnings and damage.
|
||||
if(pressure < ONE_ATMOSPHERE)
|
||||
return ONE_ATMOSPHERE - pressure_difference
|
||||
else
|
||||
return ONE_ATMOSPHERE + pressure_difference
|
||||
|
||||
/mob/living/carbon/human
|
||||
proc/handle_disabilities()
|
||||
@@ -1686,26 +1702,19 @@
|
||||
if(status_flags & FAKEDEATH)
|
||||
temp = PULSE_NONE //pretend that we're dead. unlike actual death, can be inflienced by meds
|
||||
|
||||
//handles different chems' influence on pulse
|
||||
for(var/datum/reagent/R in reagents.reagent_list)
|
||||
if(R.id in bradycardics)
|
||||
if(temp <= PULSE_THREADY && temp >= PULSE_NORM)
|
||||
temp--
|
||||
break //one reagent is enough
|
||||
//comment out the breaks to make med effects stack
|
||||
for(var/datum/reagent/R in reagents.reagent_list) //handles different chems' influence on pulse
|
||||
if(R.id in tachycardics)
|
||||
if(temp <= PULSE_FAST && temp >= PULSE_NONE)
|
||||
temp++
|
||||
break
|
||||
for(var/datum/reagent/R in reagents.reagent_list) //To avoid using fakedeath
|
||||
if(R.id in heartstopper)
|
||||
if(R.id in heartstopper) //To avoid using fakedeath
|
||||
temp = PULSE_NONE
|
||||
break
|
||||
for(var/datum/reagent/R in reagents.reagent_list) //Conditional heart-stoppage
|
||||
if(R.id in cheartstopper)
|
||||
if(R.id in cheartstopper) //Conditional heart-stoppage
|
||||
if(R.volume >= R.overdose)
|
||||
temp = PULSE_NONE
|
||||
break
|
||||
|
||||
return temp
|
||||
|
||||
|
||||
@@ -80,11 +80,6 @@
|
||||
emote(pick("scratch","jump","roll","tail"))
|
||||
updatehealth()
|
||||
|
||||
|
||||
/mob/living/carbon/monkey/calculate_affecting_pressure(var/pressure)
|
||||
..()
|
||||
return pressure
|
||||
|
||||
/mob/living/carbon/monkey
|
||||
|
||||
proc/handle_disabilities()
|
||||
@@ -401,9 +396,7 @@
|
||||
|
||||
//Moved these vars here for use in the fuck-it-skip-processing check.
|
||||
var/pressure = environment.return_pressure()
|
||||
var/adjusted_pressure = calculate_affecting_pressure(pressure) //Returns how much pressure actually affects the mob.
|
||||
|
||||
if(adjusted_pressure < WARNING_HIGH_PRESSURE && adjusted_pressure > WARNING_LOW_PRESSURE && abs(environment.temperature - 293.15) < 20 && abs(bodytemperature - 310.14) < 0.5 && environment.phoron < MOLES_PHORON_VISIBLE)
|
||||
if(pressure < WARNING_HIGH_PRESSURE && pressure > WARNING_LOW_PRESSURE && abs(environment.temperature - 293.15) < 20 && abs(bodytemperature - 310.14) < 0.5 && environment.phoron < MOLES_PHORON_VISIBLE)
|
||||
|
||||
//Hopefully should fix the walk-inside-still-pressure-warning issue.
|
||||
if(pressure_alert)
|
||||
@@ -425,9 +418,9 @@
|
||||
bodytemperature += 0.1*(environment.temperature - bodytemperature)*environment_heat_capacity/(environment_heat_capacity + 270000)
|
||||
|
||||
//Account for massive pressure differences
|
||||
switch(adjusted_pressure)
|
||||
switch(pressure)
|
||||
if(HAZARD_HIGH_PRESSURE to INFINITY)
|
||||
adjustBruteLoss( min( ( (adjusted_pressure / HAZARD_HIGH_PRESSURE) -1 )*PRESSURE_DAMAGE_COEFFICIENT , MAX_HIGH_PRESSURE_DAMAGE) )
|
||||
adjustBruteLoss( min( ( (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
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
//This proc is used for mobs which are affected by pressure to calculate the amount of pressure that actually
|
||||
//affects them once clothing is factored in. ~Errorage
|
||||
/mob/living/proc/calculate_affecting_pressure(var/pressure)
|
||||
return 0
|
||||
return
|
||||
|
||||
|
||||
//sort of a legacy burn method for /electrocute, /shock, and the e_chair
|
||||
|
||||
@@ -14,15 +14,13 @@
|
||||
var/energy = 100
|
||||
var/max_energy = 100
|
||||
var/amount = 30
|
||||
var/accept_glass = 0
|
||||
var/accept_glass = 0 //At 0 ONLY accepts glass containers. Kinda misleading varname.
|
||||
var/beaker = null
|
||||
var/recharged = 0
|
||||
var/hackedcheck = 0
|
||||
var/list/dispensable_reagents = list("hydrogen","lithium","carbon","nitrogen","oxygen","fluorine",
|
||||
"sodium","aluminum","silicon","phosphorus","sulfur","chlorine","potassium","iron",
|
||||
"copper","mercury","radium","water","ethanol","sugar","sacid","tungsten")
|
||||
var/list/broken_requirements = list()
|
||||
var/broken_on_spawn = 0
|
||||
|
||||
/obj/machinery/chem_dispenser/proc/recharge()
|
||||
if(stat & (BROKEN|NOPOWER)) return
|
||||
@@ -42,7 +40,6 @@
|
||||
nanomanager.update_uis(src) // update all UIs attached to src
|
||||
|
||||
/obj/machinery/chem_dispenser/process()
|
||||
|
||||
if(recharged <= 0)
|
||||
recharge()
|
||||
recharged = 15
|
||||
@@ -54,27 +51,6 @@
|
||||
recharge()
|
||||
dispensable_reagents = sortList(dispensable_reagents)
|
||||
|
||||
if(broken_on_spawn)
|
||||
var/amount = pick(1,2,2,3,4)
|
||||
var/list/options = list()
|
||||
options[/obj/item/weapon/stock_parts/capacitor/adv] = "Add an advanced capacitor to fix it."
|
||||
options[/obj/item/weapon/stock_parts/console_screen] = "Replace the console screen to fix it."
|
||||
options[/obj/item/weapon/stock_parts/manipulator/pico] = "Upgrade to a pico manipulator to fix it."
|
||||
options[/obj/item/weapon/stock_parts/matter_bin/adv] = "Give it an advanced matter bin to fix it."
|
||||
options[/obj/item/stack/sheet/mineral/diamond] = "Line up a cut diamond with the nozzle to fix it."
|
||||
options[/obj/item/stack/sheet/mineral/uranium] = "Position a uranium sheet inside to fix it."
|
||||
options[/obj/item/stack/sheet/mineral/phoron] = "Enter a block of phoron to fix it."
|
||||
options[/obj/item/stack/sheet/mineral/silver] = "Cover the internals with a silver lining to fix it."
|
||||
options[/obj/item/stack/sheet/mineral/gold] = "Wire a golden filament to fix it."
|
||||
options[/obj/item/stack/sheet/plasteel] = "Surround the outside with a plasteel cover to fix it."
|
||||
options[/obj/item/stack/sheet/rglass] = "Insert a pane of reinforced glass to fix it."
|
||||
stat |= BROKEN
|
||||
while(amount > 0)
|
||||
amount -= 1
|
||||
|
||||
var/index = pick(options)
|
||||
broken_requirements[index] = options[index]
|
||||
options -= index
|
||||
|
||||
/obj/machinery/chem_dispenser/ex_act(severity)
|
||||
switch(severity)
|
||||
@@ -105,9 +81,6 @@
|
||||
* @return nothing
|
||||
*/
|
||||
/obj/machinery/chem_dispenser/ui_interact(mob/user, ui_key = "main",var/datum/nanoui/ui = null)
|
||||
if(broken_requirements.len)
|
||||
user << "<span class='warning'>[src] is broken. [broken_requirements[broken_requirements[1]]]</span>"
|
||||
return
|
||||
if(stat & (BROKEN|NOPOWER)) return
|
||||
if(user.stat || user.restrained()) return
|
||||
|
||||
@@ -183,19 +156,6 @@
|
||||
/obj/machinery/chem_dispenser/attackby(var/obj/item/weapon/reagent_containers/B as obj, var/mob/user as mob)
|
||||
if(isrobot(user))
|
||||
return
|
||||
|
||||
if(broken_requirements.len && B.type == broken_requirements[1])
|
||||
broken_requirements -= broken_requirements[1]
|
||||
user << "<span class='notice'>You fix [src].</span>"
|
||||
if(istype(B,/obj/item/stack))
|
||||
var/obj/item/stack/S = B
|
||||
S.use(1)
|
||||
else
|
||||
user.drop_item()
|
||||
del(B)
|
||||
if(broken_requirements.len==0)
|
||||
stat ^= BROKEN
|
||||
return
|
||||
if(src.beaker)
|
||||
user << "Something is already loaded into the machine."
|
||||
return
|
||||
@@ -218,7 +178,6 @@
|
||||
/obj/machinery/chem_dispenser/attack_hand(mob/user as mob)
|
||||
if(stat & BROKEN)
|
||||
return
|
||||
|
||||
ui_interact(user)
|
||||
|
||||
/obj/machinery/chem_dispenser/soda
|
||||
@@ -245,6 +204,7 @@
|
||||
dispensable_reagents -= list("thirteenloko")
|
||||
hackedcheck = 0
|
||||
return
|
||||
|
||||
/obj/machinery/chem_dispenser/beer
|
||||
icon_state = "booze_dispenser"
|
||||
name = "booze dispenser"
|
||||
|
||||
@@ -2064,7 +2064,7 @@ datum
|
||||
description = "This is what makes chilis hot."
|
||||
reagent_state = LIQUID
|
||||
color = "#B31008" // rgb: 179, 16, 8
|
||||
|
||||
|
||||
on_mob_life(var/mob/living/M as mob)
|
||||
if(!M)
|
||||
M = holder.my_atom
|
||||
@@ -2078,7 +2078,7 @@ datum
|
||||
H << "\red <b>Your insides feel uncomfortably hot !</b>"
|
||||
if(2 to 20)
|
||||
if(prob(5))
|
||||
H << "\red <b>Your insides feel uncomfortably hot !</b>"
|
||||
H << "\red <b>Your insides feel uncomfortably hot !</b>"
|
||||
if(20 to INFINITY)
|
||||
H.apply_effect(2,AGONY,0)
|
||||
if(prob(5))
|
||||
@@ -2186,10 +2186,10 @@ datum
|
||||
|
||||
on_mob_life(var/mob/living/M as mob)
|
||||
if(!M)
|
||||
M = holder.my_atom
|
||||
M.bodytemperature = max(M.bodytemperature - 10 * TEMPERATURE_DAMAGE_COEFFICIENT, 0)
|
||||
M = holder.my_atom
|
||||
M.bodytemperature = max(M.bodytemperature - 10 * TEMPERATURE_DAMAGE_COEFFICIENT, 0)
|
||||
if(prob(1))
|
||||
M.emote("shiver")
|
||||
M.emote("shiver")
|
||||
if(istype(M, /mob/living/carbon/slime))
|
||||
M.bodytemperature = max(M.bodytemperature - rand(10,20), 0)
|
||||
holder.remove_reagent("capsaicin", 5)
|
||||
|
||||
@@ -130,7 +130,7 @@ datum
|
||||
water //I can't believe we never had this.
|
||||
name = "Water"
|
||||
id = "water"
|
||||
result = null
|
||||
result = "water"
|
||||
required_reagents = list("oxygen" = 2, "hydrogen" = 1)
|
||||
result_amount = 1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user