Merge branch 'master' into pipeWrench

This commit is contained in:
IAmBigCoat
2015-05-15 18:09:32 -04:00
21 changed files with 126 additions and 38 deletions
+18
View File
@@ -1683,3 +1683,21 @@ atom/proc/GetTypeInAllContents(typepath)
temp_col = "0[temp_col]"
colour += temp_col
return colour
/proc/get_distant_turf(var/turf/T,var/direction,var/distance)
if(!T || !direction || !distance) return
var/dest_x = T.x
var/dest_y = T.y
var/dest_z = T.z
if(direction & NORTH)
dest_y = min(world.maxy, dest_y+distance)
if(direction & SOUTH)
dest_y = max(0, dest_y-distance)
if(direction & EAST)
dest_x = min(world.maxy, dest_x+distance)
if(direction & WEST)
dest_x = max(0, dest_x-distance)
return locate(dest_x,dest_y,dest_z)
+3 -3
View File
@@ -59,13 +59,13 @@
var/atom/movable/lighting_overlay/L = locate(/atom/movable/lighting_overlay) in T
var/light_available
if(L)
light_available = max(0,min(10,L.lum_r + L.lum_g + L.lum_b)-5)
light_available = L.get_clamped_lum()*10
else
light_available = 5
if(light_available <= 2)
M.alpha = round(255 * 1.15)
M.alpha = round(M.alpha * 0.8)
else
M.alpha = round(255 * 0.80)
M.alpha = 255
//WAS: /datum/bioEffect/chameleon
/datum/dna/gene/basic/stealth/chameleon
+2 -1
View File
@@ -118,4 +118,5 @@
else
return 0
/mob/camera/experience_pressure_difference()
return 0
@@ -273,9 +273,9 @@
var/atom/movable/lighting_overlay/L = locate(/atom/movable/lighting_overlay) in T
var/light_available
if(L)
light_available = max(0,min(10,L.lum_r + L.lum_g + L.lum_b)-5)
light_available = L.get_clamped_lum(0.5)*10
else
light_available = 5
light_available = 10
if(!istype(T))
return 0
@@ -446,7 +446,7 @@
if(T.y>world.maxy-outer_tele_radius || T.y<outer_tele_radius) continue
var/atom/movable/lighting_overlay/L = locate(/atom/movable/lighting_overlay) in T
var/lightingcount = max(0,min(10,L.lum_r + L.lum_g + L.lum_b)-5)
var/lightingcount = L.get_clamped_lum(0.5)*10
// LIGHTING CHECK
if(lightingcount > max_lum) continue
+2 -2
View File
@@ -64,7 +64,7 @@
H.equip_or_collect(new /obj/item/clothing/under/rank/medical/mortician(H), slot_w_uniform)
H.equip_or_collect(new /obj/item/clothing/suit/storage/labcoat/mortician(H), slot_wear_suit)
if(H.backbag != 1)
H.equip_or_collect(new /obj/item/clothing/head/surgery/black(H.back), slot_in_backpack)
H.equip_or_collect(new /obj/item/clothing/head/surgery/black(H.back), slot_in_backpack)
H.equip_or_collect(new /obj/item/weapon/autopsy_scanner(H.back), slot_in_backpack)
H.equip_or_collect(new /obj/item/device/mass_spectrometer(H.back), slot_in_backpack)
H.equip_or_collect(new /obj/item/weapon/storage/box/bodybags(H.back), slot_in_backpack)
@@ -222,7 +222,7 @@
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/medical(H), slot_w_uniform)
H.equip_to_slot_or_del(new /obj/item/clothing/suit/storage/labcoat(H), slot_wear_suit)
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/laceup(H), slot_shoes)
H.equip_to_slot_or_del(new /obj/item/device/pda/medical(H), slot_belt)
H.equip_to_slot_or_del(new /obj/item/device/pda/medical(H), slot_wear_pda)
H.equip_or_collect(new /obj/item/device/flashlight/pen(H), slot_s_store)
if(H.backbag == 1)
H.equip_or_collect(new /obj/item/weapon/storage/box/survival(H), slot_r_hand)
+3 -1
View File
@@ -11,7 +11,9 @@
var/use = 5
var/unlocked = 0
var/open = 0
var/brightness_on = 999 //can't remember what the maxed out value is
var/brightness_on = 14
light_power = 20
//var/brightness_on = 999 //can't remember what the maxed out value is //Lighting overhaul: No max, stop TRYING TO ILLUMINATE MORE TILES THAN THE MAP CONSISTS OF.
/obj/machinery/floodlight/New()
src.cell = new(src)
+56
View File
@@ -69,6 +69,7 @@
var/obj/item/mecha_parts/mecha_equipment/selected
var/max_equip = 3
var/datum/events/events
var/turf/crashing = null
var/stepsound = 'sound/mecha/mechturn.ogg'
@@ -365,6 +366,61 @@
/obj/mecha/Bump(var/atom/obstacle)
// src.inertia_dir = null
if(src.throwing)//high velocity mechas in your face!
var/breakthrough = 0
if(istype(obstacle, /obj/structure/window/))
obstacle.Destroy(brokenup = 1)
breakthrough = 1
else if(istype(obstacle, /obj/structure/grille/))
var/obj/structure/grille/G = obstacle
G.health = (0.25*initial(G.health))
G.destroyed = 1
G.icon_state = "[initial(G.icon_state)]-b"
G.density = 0
getFromPool(/obj/item/stack/rods, get_turf(G.loc))
breakthrough = 1
else if(istype(obstacle, /obj/structure/table))
var/obj/structure/table/T = obstacle
T.destroy()
breakthrough = 1
else if(istype(obstacle, /obj/structure/rack))
new /obj/item/weapon/rack_parts(obstacle.loc)
qdel(obstacle)
breakthrough = 1
else if(istype(obstacle, /obj/structure/reagent_dispensers/fueltank))
obstacle.ex_act(1)
else if(istype(obstacle, /mob/living))
var/mob/living/L = obstacle
var/hit_sound = list('sound/weapons/genhit1.ogg','sound/weapons/genhit2.ogg','sound/weapons/genhit3.ogg')
if(L.flags & GODMODE)
return
L.take_overall_damage(5,0)
if(L.buckled)
L.buckled = 0
L.Stun(5)
L.Weaken(5)
L.apply_effect(STUTTER, 5)
playsound(src, pick(hit_sound), 50, 0, 0)
breakthrough = 1
else
src.throwing = 0//so mechas don't get stuck when landing after being sent by a Mass Driver
src.crashing = null
if(breakthrough)
if(crashing)
spawn(1)
src.throw_at(crashing, 50, src.throw_speed)
else
spawn(1)
crashing = get_distant_turf(get_turf(src), dir, 3)//don't use get_dir(src, obstacle) or the mech will stop if he bumps into a one-direction window on his tile.
src.throw_at(crashing, 50, src.throw_speed)
if(istype(obstacle, /obj))
var/obj/O = obstacle
if(istype(O, /obj/effect/portal)) //derpfix
+2 -2
View File
@@ -64,9 +64,9 @@
var/turf/T = get_turf(src)
var/atom/movable/lighting_overlay/LO = locate(/atom/movable/lighting_overlay) in T
if(LO)
light_amount = max(0,min(10,LO.lum_r + LO.lum_g + LO.lum_b)-5)
light_amount = LO.get_clamped_lum(0.5)*10
else
light_amount = 5
light_amount = 10
if(light_amount > 2)
M << "<span class='warning'>It's too bright here to use [src.name]!</span>"
+1 -1
View File
@@ -281,7 +281,7 @@
if(!light_supplied)
var/atom/movable/lighting_overlay/L = locate(/atom/movable/lighting_overlay) in current_turf
if(L)
light_supplied = max(0,min(10,L.lum_r + L.lum_g + L.lum_b)-5)
light_supplied = L.get_clamped_lum()*10
else
light_supplied = 5
+1 -1
View File
@@ -810,7 +810,7 @@
var/atom/movable/lighting_overlay/L = locate(/atom/movable/lighting_overlay) in T
var/light_available
if(L)
light_available = max(0,min(10,L.lum_r + L.lum_g + L.lum_b))
light_available = L.get_clamped_lum()*10
else
light_available = 5
light_string = "a light level of [light_available] lumens"
+1 -1
View File
@@ -50,7 +50,7 @@
/datum/light_source/proc/destroy()
destroyed = 1
force_update()
if(source_atom) source_atom.light_sources -= src
if(source_atom && source_atom.light_sources) source_atom.light_sources -= src
if(top_atom) top_atom.light_sources -= src
/datum/light_source/proc/update(atom/new_top_atom)
@@ -25,6 +25,15 @@
. = ..()
verbs.Cut()
/atom/movable/lighting_overlay/proc/get_clamped_lum(var/minlum = 0, var/maxlum = 1)
var/lum = max(lum_r, lum_g, lum_b)
if(lum <= minlum)
return 0
else if(lum >= maxlum)
return 1
else
return (lum - minlum) / (maxlum - minlum)
/atom/movable/lighting_overlay/proc/update_lumcount(delta_r, delta_g, delta_b)
lum_r += delta_r
lum_g += delta_g
@@ -229,6 +229,9 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
if(A)
A.Entered(src)
/mob/dead/observer/experience_pressure_difference()
return 0
/mob/dead/observer/examine()
if(usr)
usr << desc
@@ -492,10 +492,8 @@ emp_act
/mob/living/carbon/human/experience_pressure_difference(pressure_difference, direction)
if(shoes)
if(istype(shoes,/obj/item/clothing/shoes/magboots)) //TODO: Make a not-shit shoe var system to negate airflow.
var/obj/item/clothing/shoes/magboots/MB = shoes
if(MB.magpulse)
return 0
if(istype(shoes,/obj/item/clothing/shoes/magboots) && (shoes.flags & NOSLIP)) //TODO: Make a not-shit shoe var system to negate airflow.
return 0
..()
/mob/living/carbon/human/water_act(volume, temperature, source)
+2 -2
View File
@@ -746,7 +746,7 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc
var/turf/T = loc
var/atom/movable/lighting_overlay/L = locate(/atom/movable/lighting_overlay) in T
if(L)
light_amount = min(10,L.lum_r + L.lum_g + L.lum_b) - 5 //hardcapped so it's not abused by having a ton of flashlights
light_amount = (L.get_clamped_lum()*10) - 5 //hardcapped so it's not abused by having a ton of flashlights
else
light_amount = 5
nutrition += light_amount
@@ -768,7 +768,7 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc
var/turf/T = loc
var/atom/movable/lighting_overlay/L = locate(/atom/movable/lighting_overlay) in T
if(L)
light_amount = L.lum_r + L.lum_g + L.lum_b //hardcapped so it's not abused by having a ton of flashlights
light_amount = L.get_clamped_lum()*10
else
light_amount = 10
if(light_amount > species.light_dam) //if there's enough light, start dying
@@ -442,7 +442,7 @@
var/turf/T = loc
var/atom/movable/lighting_overlay/L = locate(/atom/movable/lighting_overlay) in T
if(L)
light_amount = min(10,L.lum_r + L.lum_g + L.lum_b) - 5 //hardcapped so it's not abused by having a ton of flashlights
light_amount = (L.get_clamped_lum()*10) - 5 //hardcapped so it's not abused by having a ton of flashlights
else
light_amount = 5
@@ -672,4 +672,4 @@
proc/handle_wetness()
if(mob_master.current_cycle%20==2) //dry off a bit once every 20 ticks or so
wetlevel = max(wetlevel - 1,0)
return
return
@@ -77,6 +77,9 @@
return
return ai.eyeobj.loc
/mob/aiEye/experience_pressure_difference()
return 0
// AI MOVEMENT
// The AI's "eye". Described on the top of the page.
@@ -116,19 +116,19 @@
var/DLlight_amount
var/atom/movable/lighting_overlay/L = locate(/atom/movable/lighting_overlay) in T
if(L)
light_amount = min(10,L.lum_r + L.lum_g + L.lum_b) - 5 //hardcapped so it's not abused by having a ton of flashlights
light_amount = L.lum_r + L.lum_g + L.lum_b
else
light_amount = 5
var/atom/movable/lighting_overlay/DL = locate(/atom/movable/lighting_overlay) in destination
if(DL)
DLlight_amount = min(10,L.lum_r + L.lum_g + L.lum_b) - 5 //hardcapped so it's not abused by having a ton of flashlights
DLlight_amount = DL.lum_r + DL.lum_g + DL.lum_b
else
DLlight_amount = 5
if(T && destination)
// Don't check it twice if our destination is the tile we are on or we can't even get to our destination
if(T == destination)
destination = null
else if(light_amount <= 1 && DLlight_amount <= 1) // No one can see us in the darkness, right?
else if(light_amount < 0.1 && DLlight_amount < 0.1) // No one can see us in the darkness, right?
return null
// We aren't in darkness, loop for viewers.
+1 -1
View File
@@ -119,7 +119,7 @@
if (building==0)
init()
else
area = src.loc.loc:master
area = src.loc.loc
area.apc |= src
opened = 1
operating = 0
+2 -4
View File
@@ -560,11 +560,9 @@
qdel(src)
return
if(2.0)
if (prob(75))
broken()
broken()
if(3.0)
if (prob(50))
broken()
broken()
return
//blob effect