diff --git a/code/_onclick/other_mobs.dm b/code/_onclick/other_mobs.dm index 04612128ef..b84b9f467c 100644 --- a/code/_onclick/other_mobs.dm +++ b/code/_onclick/other_mobs.dm @@ -23,7 +23,7 @@ /mob/living/carbon/human/RangedAttack(var/atom/A) if(!gloves && !mutations.len) return var/obj/item/clothing/gloves/G = gloves - if((LASER in mutations) && a_intent == "harm") + if((LASER in mutations) && a_intent == "hurt") LaserEyes(A) // moved into a proc below else if(istype(G) && G.Touch(A,0)) // for magic gloves diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm index a5c4a631f0..2c2dd2f64b 100644 --- a/code/game/machinery/vending.dm +++ b/code/game/machinery/vending.dm @@ -315,7 +315,8 @@ if (src.product_records.len == 0) dat += "No product loaded!" else - var/list/display_records = src.product_records + var/list/display_records = list() + display_records += src.product_records if(src.extended_inventory) display_records += src.hidden_records diff --git a/code/game/objects/items/devices/suit_cooling.dm b/code/game/objects/items/devices/suit_cooling.dm index 19d146b82c..6355fd26fd 100644 --- a/code/game/objects/items/devices/suit_cooling.dm +++ b/code/game/objects/items/devices/suit_cooling.dm @@ -42,7 +42,7 @@ var/mob/living/carbon/human/H = loc - var/efficiency = H.get_pressure_protection() //you need to have a good seal for effective cooling + var/efficiency = 1 - H.get_pressure_weakness() //you need to have a good seal for effective cooling var/env_temp = get_environment_temperature() //wont save you from a fire var/temp_adj = min(H.bodytemperature - max(thermostat, env_temp), max_cooling) diff --git a/code/game/objects/items/weapons/storage/fancy.dm b/code/game/objects/items/weapons/storage/fancy.dm index 5766fd27e4..2d970f7193 100644 --- a/code/game/objects/items/weapons/storage/fancy.dm +++ b/code/game/objects/items/weapons/storage/fancy.dm @@ -68,6 +68,7 @@ icon_type = "egg" name = "egg box" storage_slots = 12 + max_combined_w_class = 24 can_hold = list("/obj/item/weapon/reagent_containers/food/snacks/egg") /obj/item/weapon/storage/fancy/egg_box/New() diff --git a/code/modules/clothing/shoes/miscellaneous.dm b/code/modules/clothing/shoes/miscellaneous.dm index 766cc96f05..069052fbfc 100644 --- a/code/modules/clothing/shoes/miscellaneous.dm +++ b/code/modules/clothing/shoes/miscellaneous.dm @@ -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 diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 2245411483..106ba57a68 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -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 diff --git a/code/modules/mob/living/carbon/monkey/life.dm b/code/modules/mob/living/carbon/monkey/life.dm index 19cfe31686..ead7444671 100644 --- a/code/modules/mob/living/carbon/monkey/life.dm +++ b/code/modules/mob/living/carbon/monkey/life.dm @@ -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 diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index e3de241980..e0733ce7b4 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -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 diff --git a/code/modules/reagents/Chemistry-Machinery.dm b/code/modules/reagents/Chemistry-Machinery.dm index 9c06be563b..8186c5197b 100644 --- a/code/modules/reagents/Chemistry-Machinery.dm +++ b/code/modules/reagents/Chemistry-Machinery.dm @@ -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 << "[src] is broken. [broken_requirements[broken_requirements[1]]]" - 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 << "You fix [src]." - 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" diff --git a/code/modules/reagents/Chemistry-Reagents.dm b/code/modules/reagents/Chemistry-Reagents.dm index d115faaf97..570f1fb84c 100644 --- a/code/modules/reagents/Chemistry-Reagents.dm +++ b/code/modules/reagents/Chemistry-Reagents.dm @@ -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 Your insides feel uncomfortably hot !" if(2 to 20) if(prob(5)) - H << "\red Your insides feel uncomfortably hot !" + H << "\red Your insides feel uncomfortably hot !" 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) diff --git a/code/modules/reagents/Chemistry-Recipes.dm b/code/modules/reagents/Chemistry-Recipes.dm index fbc3488d91..b0f9427000 100644 --- a/code/modules/reagents/Chemistry-Recipes.dm +++ b/code/modules/reagents/Chemistry-Recipes.dm @@ -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 diff --git a/code/setup.dm b/code/setup.dm index 13974e022e..f26f05780e 100644 --- a/code/setup.dm +++ b/code/setup.dm @@ -66,9 +66,6 @@ #define MAX_HIGH_PRESSURE_DAMAGE 4 //This used to be 20... I got this much random rage for some retarded decision by polymorph?! Polymorph now lies in a pool of blood with a katana jammed in his spleen. ~Errorage --PS: The katana did less than 20 damage to him :( #define LOW_PRESSURE_DAMAGE 2 //The amounb of damage someone takes when in a low pressure area (The pressure threshold is so low that it doesn't make sense to do any calculations, so it just applies this flat value). -#define PRESSURE_SUIT_REDUCTION_COEFFICIENT 0.8 //This is how much (percentual) a suit with the flag STOPSPRESSUREDMAGE reduces pressure. -#define PRESSURE_HEAD_REDUCTION_COEFFICIENT 0.4 //This is how much (percentual) a helmet/hat with the flag STOPSPRESSUREDMAGE reduces pressure. - // Doors! #define DOOR_CRUSH_DAMAGE 10