Merge remote-tracking branch 'upstream/master' into dev-freeze

Conflicts:
	code/game/objects/items/devices/flashlight.dm
This commit is contained in:
PsiOmegaDelta
2015-08-25 08:04:07 +02:00
6 changed files with 62 additions and 55 deletions

View File

@@ -16,14 +16,9 @@
/obj/item/device/flashlight/initialize()
..()
if(on)
icon_state = "[initial(icon_state)]-on"
set_light(brightness_on)
else
icon_state = "[initial(icon_state)]"
set_light(0)
update_icon()
/obj/item/device/flashlight/proc/update_brightness(var/mob/user = null)
/obj/item/device/flashlight/update_icon()
if(on)
icon_state = "[initial(icon_state)]-on"
set_light(brightness_on)
@@ -36,7 +31,7 @@
user << "You cannot turn the light on while in this [user.loc]." //To prevent some lighting anomalities.
return 0
on = !on
update_brightness(user)
update_icon()
user.update_action_buttons()
return 1
@@ -171,11 +166,7 @@
on = 0
src.force = initial(src.force)
src.damtype = initial(src.damtype)
if(ismob(loc))
var/mob/U = loc
update_brightness(U)
else
update_brightness(null)
update_icon()
/obj/item/device/flashlight/flare/attack_self(mob/user)
@@ -206,10 +197,11 @@
on = 1 //Bio-luminesence has one setting, on.
/obj/item/device/flashlight/slime/New()
..()
set_light(brightness_on)
spawn(1) //Might be sloppy, but seems to be necessary to prevent further runtimes and make these work as intended... don't judge me!
update_brightness()
icon_state = initial(icon_state)
/obj/item/device/flashlight/slime/update_icon()
return
/obj/item/device/flashlight/slime/attack_self(mob/user)
return //Bio-luminescence does not toggle.

View File

@@ -129,6 +129,7 @@
var/watertemp = "normal" //freezing, normal, or boiling
var/mobpresent = 0 //true if there is a mob on the shower's loc, this is to ease process()
var/is_washing = 0
var/list/temperature_settings = list("normal" = 310, "boiling" = T0C+100, "freezing" = T0C)
/obj/machinery/shower/New()
..()
@@ -150,7 +151,7 @@
if(on)
if (M.loc == loc)
wash(M)
check_heat(M)
process_heat(M)
for (var/atom/movable/G in src.loc)
G.clean_blood()
@@ -158,15 +159,11 @@
if(I.type == /obj/item/device/analyzer)
user << "<span class='notice'>The water temperature seems to be [watertemp].</span>"
if(istype(I, /obj/item/weapon/wrench))
var/newtemp = input(user, "What setting would you like to set the temperature valve to?", "Water Temperature Valve") in temperature_settings
user << "<span class='notice'>You begin to adjust the temperature valve with \the [I].</span>"
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
if(do_after(user, 50))
switch(watertemp)
if("normal")
watertemp = "freezing"
if("freezing")
watertemp = "boiling"
if("boiling")
watertemp = "normal"
watertemp = newtemp
user.visible_message("<span class='notice'>[user] adjusts the shower with \the [I].</span>", "<span class='notice'>You adjust the shower with \the [I].</span>")
add_fingerprint(user)
@@ -177,8 +174,8 @@
if(on)
overlays += image('icons/obj/watercloset.dmi', src, "water", MOB_LAYER + 1, dir)
if(watertemp == "freezing")
return
if(temperature_settings[watertemp] < T20C)
return //no mist for cold water
if(!ismist)
spawn(50)
if(src && on)
@@ -200,7 +197,7 @@
wash(O)
if(ismob(O))
mobpresent += 1
check_heat(O)
process_heat(O)
/obj/machinery/shower/Uncrossed(atom/movable/O)
if(ismob(O))
@@ -304,8 +301,8 @@
if(!on) return
wash_floor()
if(!mobpresent) return
for(var/mob/living/carbon/C in loc)
check_heat(C)
for(var/mob/living/L in loc)
process_heat(L)
/obj/machinery/shower/proc/wash_floor()
if(!ismist && is_washing)
@@ -317,22 +314,19 @@
spawn(100)
is_washing = 0
/obj/machinery/shower/proc/check_heat(mob/M as mob)
if(!on || watertemp == "normal") return
if(iscarbon(M))
var/mob/living/carbon/C = M
if(watertemp == "freezing")
C.bodytemperature = max(80, C.bodytemperature - 80)
C << "<span class='warning'>The water is freezing!</span>"
return
if(watertemp == "boiling")
C.bodytemperature = min(500, C.bodytemperature + 35)
C.adjustFireLoss(5)
C << "<span class='danger'>The water is searing!</span>"
return
/obj/machinery/shower/proc/process_heat(mob/living/M)
if(!on || !istype(M)) return
var/temperature = temperature_settings[watertemp]
var/temp_adj = between(BODYTEMP_COOLING_MAX, temperature - M.bodytemperature, BODYTEMP_HEATING_MAX)
M.bodytemperature += temp_adj
if(ishuman(M))
var/mob/living/carbon/human/H = M
if(temperature >= H.species.heat_level_1)
H << "<span class='danger'>The water is searing hot!</span>"
else if(temperature <= H.species.cold_level_1)
H << "<span class='warning'>The water is freezing cold!</span>"
/obj/item/weapon/bikehorn/rubberducky
name = "rubber ducky"

View File

@@ -659,6 +659,26 @@ default behaviour is:
resting = !resting
src << "\blue You are now [resting ? "resting" : "getting up"]"
/mob/living/proc/is_allowed_vent_crawl_item(var/obj/item/carried_item)
if(istype(carried_item, /obj/item/weapon/implant))
return 1
if(istype(carried_item, /obj/item/clothing/mask/facehugger))
return 1
return 0
/mob/living/carbon/is_allowed_vent_crawl_item(var/obj/item/carried_item)
if(carried_item in internal_organs)
return 1
return ..()
/mob/living/carbon/human/is_allowed_vent_crawl_item(var/obj/item/carried_item)
if(carried_item in organs)
return 1
return ..()
/mob/living/simple_animal/spiderbot/is_allowed_vent_crawl_item(var/obj/item/carried_item)
return carried_item != held_item
/mob/living/proc/handle_ventcrawl(var/obj/machinery/atmospherics/unary/vent_pump/vent_found = null, var/ignore_items = 0) // -- TLE -- Merged by Carn
if(stat)
src << "You must be conscious to do this!"
@@ -721,9 +741,10 @@ default behaviour is:
if(!ignore_items)
for(var/obj/item/carried_item in contents)//If the monkey got on objects.
if( !istype(carried_item, /obj/item/weapon/implant) && !istype(carried_item, /obj/item/clothing/mask/facehugger) )//If it's not an implant or a facehugger
src << "\red You can't be carrying items or have items equipped when vent crawling!"
return
if(is_allowed_vent_crawl_item(carried_item))
continue
src << "<span class='warning'>You can't be carrying items or have items equipped when vent crawling!</span>"
return
if(isslime(src))
var/mob/living/carbon/slime/S = src

View File

@@ -144,7 +144,7 @@
/datum/reagent/cryoxadone/affect_blood(var/mob/living/carbon/M, var/alien, var/removed)
if(M.bodytemperature < 170)
M.adjustCloneLoss(-30 * removed)
M.adjustOxyLoss(-3 * removed)
M.adjustOxyLoss(-30 * removed)
M.heal_organ_damage(30 * removed, 30 * removed)
M.adjustToxLoss(-30 * removed)

View File

@@ -97,15 +97,15 @@
/datum/gas_mixture/proc/equalize(datum/gas_mixture/sharer)
for(var/g in sharer.gas)
var/our_heatcap = heat_capacity()
var/share_heatcap = sharer.heat_capacity()
for(var/g in gas|sharer.gas)
var/comb = gas[g] + sharer.gas[g]
comb /= volume + sharer.volume
gas[g] = comb * volume
sharer.gas[g] = comb * sharer.volume
var/our_heatcap = heat_capacity()
var/share_heatcap = sharer.heat_capacity()
if(our_heatcap + share_heatcap)
temperature = ((temperature * our_heatcap) + (sharer.temperature * share_heatcap)) / (our_heatcap + share_heatcap)
sharer.temperature = temperature

View File

@@ -5101,7 +5101,7 @@
"bUe" = (/obj/machinery/light{dir = 1},/obj/machinery/door/firedoor,/turf/simulated/floor{tag = "icon-whiteblue (NORTH)"; icon_state = "whiteblue"; dir = 1},/area/medical/medbay4)
"bUf" = (/obj/structure/sign/science{pixel_x = 32},/obj/machinery/atmospherics/unary/vent_pump/on{dir = 8},/turf/simulated/floor{icon_state = "white"},/area/rnd/research)
"bUg" = (/turf/simulated/wall,/area/rnd/misc_lab)
"bUh" = (/obj/machinery/light_switch{pixel_y = -23},/obj/machinery/power/apc{dir = 8; name = "west bump"; pixel_x = -24},/obj/structure/cable/green{d2 = 4; icon_state = "0-4"},/turf/simulated/floor{icon_state = "floorgrime"},/area/rnd/storage)
"bUh" = (/obj/machinery/light_switch{pixel_y = -23},/obj/machinery/power/apc{dir = 8; name = "west bump"; pixel_x = -24},/obj/structure/cable/green{d2 = 4; icon_state = "0-4"},/obj/machinery/vending/cigarette{pixel_x = 0; pixel_y = 2},/turf/simulated/floor{icon_state = "floorgrime"},/area/rnd/storage)
"bUi" = (/obj/structure/cable/green{d1 = 1; d2 = 2; icon_state = "1-2"},/obj/structure/cable/green{d1 = 2; d2 = 8; icon_state = "2-8"},/obj/machinery/atmospherics/pipe/simple/hidden/scrubbers,/obj/machinery/atmospherics/pipe/simple/hidden/supply,/turf/simulated/floor{icon_state = "warningcorner"; dir = 8},/area/rnd/storage)
"bUj" = (/obj/structure/sign/fire{pixel_x = 32; pixel_y = 0},/turf/simulated/floor{dir = 9; icon_state = "whitehall"},/area/rnd/research)
"bUk" = (/obj/structure/ore_box,/obj/machinery/light{dir = 4},/turf/simulated/shuttle/floor,/area/shuttle/mining/station)
@@ -5168,7 +5168,7 @@
"bVt" = (/obj/structure/table/reinforced,/obj/item/clothing/mask/gas,/obj/item/clothing/mask/gas,/obj/item/clothing/mask/gas,/obj/item/clothing/mask/gas,/obj/structure/cable/green{d1 = 4; d2 = 8; icon_state = "4-8"},/turf/simulated/floor{icon_state = "white"},/area/rnd/misc_lab)
"bVu" = (/obj/machinery/computer/security/telescreen{desc = "Used to monitor the proceedings inside the test chamber."; name = "Test Chamber Monitor"; network = list("Miscellaneous Reseach"); pixel_x = 32; pixel_y = 0},/obj/structure/cable/green{d1 = 1; d2 = 8; icon_state = "1-8"},/turf/simulated/floor{icon_state = "white"},/area/rnd/misc_lab)
"bVv" = (/obj/machinery/atmospherics/portables_connector{dir = 4},/obj/structure/window/reinforced{dir = 8},/turf/simulated/floor,/area/rnd/mixing)
"bVw" = (/obj/machinery/vending/cigarette{pixel_x = 0; pixel_y = 2},/turf/simulated/floor{icon_state = "white"},/area/rnd/research)
"bVw" = (/obj/machinery/vending/coffee,/turf/simulated/floor{icon_state = "white"},/area/rnd/research)
"bVx" = (/obj/machinery/door/firedoor/border_only,/obj/structure/disposalpipe/segment{dir = 4},/obj/machinery/door/airlock/glass_engineering{name = "Engineering Break Room"; req_one_access = list(10)},/obj/structure/cable/green{d1 = 4; d2 = 8; icon_state = "4-8"},/obj/machinery/atmospherics/pipe/simple/hidden/supply{dir = 4},/obj/machinery/atmospherics/pipe/simple/hidden/scrubbers{dir = 4},/turf/simulated/floor,/area/engineering/break_room)
"bVy" = (/obj/machinery/atmospherics/unary/heat_exchanger{dir = 8},/turf/simulated/floor{dir = 10; icon_state = "warning"},/area/rnd/mixing)
"bVz" = (/obj/machinery/atmospherics/pipe/manifold/visible,/obj/machinery/meter,/turf/simulated/floor{icon_state = "white"},/area/rnd/mixing)