Merge remote-tracking branch 'upstream/dev' into 150722-TagPairs

Conflicts:
	code/game/machinery/Sleeper.dm
This commit is contained in:
PsiOmegaDelta
2015-08-17 13:05:58 +02:00
221 changed files with 2912 additions and 2646 deletions
@@ -7,60 +7,6 @@ GAS ANALYZER
MASS SPECTROMETER
REAGENT SCANNER
*/
/obj/item/device/t_scanner
name = "\improper T-ray scanner"
desc = "A terahertz-ray emitter and scanner used to detect underfloor objects such as cables and pipes."
icon_state = "t-ray0"
var/on = 0
slot_flags = SLOT_BELT
w_class = 2
item_state = "electronic"
matter = list(DEFAULT_WALL_MATERIAL = 150)
origin_tech = list(TECH_MAGNET = 1, TECH_ENGINERING = 1)
/obj/item/device/t_scanner/attack_self(mob/user)
on = !on
icon_state = "t-ray[on]"
if(on)
processing_objects.Add(src)
/obj/item/device/t_scanner/process()
if(!on)
processing_objects.Remove(src)
return null
for(var/turf/T in range(1, src.loc) )
if(!T.intact)
continue
for(var/obj/O in T.contents)
if(O.level != 1)
continue
if(O.invisibility == 101)
O.invisibility = 0
O.alpha = 128
spawn(10)
if(O)
var/turf/U = O.loc
if(U.intact)
O.invisibility = 101
O.alpha = 255
var/mob/living/M = locate() in T
if(M && M.invisibility == 2)
M.invisibility = 0
spawn(2)
if(M)
M.invisibility = INVISIBILITY_LEVEL_TWO
/obj/item/device/healthanalyzer
name = "health analyzer"
@@ -0,0 +1,135 @@
#define OVERLAY_CACHE_LEN 50
/obj/item/device/t_scanner
name = "\improper T-ray scanner"
desc = "A terahertz-ray emitter and scanner used to detect underfloor objects such as cables and pipes."
icon_state = "t-ray0"
slot_flags = SLOT_BELT
w_class = 2
item_state = "electronic"
matter = list(DEFAULT_WALL_MATERIAL = 150)
origin_tech = list(TECH_MAGNET = 1, TECH_ENGINERING = 1)
var/scan_range = 1
var/on = 0
var/list/active_scanned = list() //assoc list of objects being scanned, mapped to their overlay
var/client/user_client //since making sure overlays are properly added and removed is pretty important, so we track the current user explicitly
var/flicker = 0
var/global/list/overlay_cache = list() //cache recent overlays
/obj/item/device/t_scanner/update_icon()
icon_state = "t-ray[on]"
/obj/item/device/t_scanner/attack_self(mob/user)
set_active(!on)
/obj/item/device/t_scanner/proc/set_active(var/active)
on = active
if(on)
processing_objects.Add(src)
flicker = 0
else
processing_objects.Remove(src)
set_user_client(null)
update_icon()
//If reset is set, then assume the client has none of our overlays, otherwise we only send new overlays.
/obj/item/device/t_scanner/process()
if(!on) return
//handle clients changing
var/client/loc_client = null
if(ismob(src.loc))
var/mob/M = src.loc
loc_client = M.client
set_user_client(loc_client)
//no sense processing if no-one is going to see it.
if(!user_client) return
//get all objects in scan range
var/list/scanned = get_scanned_objects(scan_range)
var/list/update_add = scanned - active_scanned
var/list/update_remove = active_scanned - scanned
//Add new overlays
for(var/obj/O in update_add)
var/image/overlay = get_overlay(O)
active_scanned[O] = overlay
user_client.images += overlay
//Remove stale overlays
for(var/obj/O in update_remove)
user_client.images -= active_scanned[O]
active_scanned -= O
//Flicker effect
for(var/obj/O in active_scanned)
var/image/overlay = active_scanned[O]
if(flicker)
overlay.alpha = 0
else
overlay.alpha = 128
flicker = !flicker
//creates a new overlay for a scanned object
/obj/item/device/t_scanner/proc/get_overlay(obj/scanned)
//Use a cache so we don't create a whole bunch of new images just because someone's walking back and forth in a room.
//Also means that images are reused if multiple people are using t-rays to look at the same objects.
if(scanned in overlay_cache)
. = overlay_cache[scanned]
else
var/image/I = image(loc = scanned, icon = scanned.icon, icon_state = scanned.icon_state, layer = HUD_LAYER)
//Pipes are special
if(istype(scanned, /obj/machinery/atmospherics/pipe))
var/obj/machinery/atmospherics/pipe/P = scanned
I.color = P.pipe_color
I.overlays += P.overlays
I.alpha = 128
I.mouse_opacity = 0
. = I
// Add it to cache, cutting old entries if the list is too long
overlay_cache[scanned] = .
if(overlay_cache.len > OVERLAY_CACHE_LEN)
overlay_cache.Cut(1, overlay_cache.len-OVERLAY_CACHE_LEN-1)
/obj/item/device/t_scanner/proc/get_scanned_objects(var/scan_dist)
. = list()
var/turf/center = get_turf(src.loc)
if(!center) return
for(var/turf/T in range(scan_range, center))
if(!T.intact)
continue
for(var/obj/O in T.contents)
if(O.level != 1)
continue
if(!O.invisibility)
continue //if it's already visible don't need an overlay for it
. += O
/obj/item/device/t_scanner/proc/set_user_client(var/client/new_client)
if(new_client == user_client)
return
if(user_client)
for(var/scanned in active_scanned)
user_client.images -= active_scanned[scanned]
if(new_client)
for(var/scanned in active_scanned)
new_client.images += active_scanned[scanned]
else
active_scanned.Cut()
user_client = new_client
/obj/item/device/t_scanner/dropped(mob/user)
set_user_client(null)
#undef OVERLAY_CACHE_LEN
@@ -131,7 +131,7 @@ datum/uplink_item/dd_SortValue()
path = /obj/item/ammo_magazine/a357
/datum/uplink_item/item/ammo/mc9mm
name = ".9mm"
name = "9mm"
path = /obj/item/ammo_magazine/mc9mm
/datum/uplink_item/item/ammo/darts
@@ -142,6 +142,14 @@ datum/uplink_item/dd_SortValue()
name = "14.5mm"
path = /obj/item/weapon/storage/box/sniperammo
/datum/uplink_item/item/ammo/a10mm
name = "10mm"
path = /obj/item/ammo_magazine/a10mm
/datum/uplink_item/item/ammo/a762
name = "7.62mm"
path = /obj/item/ammo_magazine/a762
/***************************************
* Highly Visible and Dangerous Weapons *
***************************************/
@@ -188,6 +196,17 @@ datum/uplink_item/dd_SortValue()
item_cost = DEFAULT_TELECRYSTAL_AMOUNT
path = /obj/item/weapon/gun/projectile/heavysniper
//These are for traitors (or other antags, perhaps) to have the option of purchasing some merc gear.
/datum/uplink_item/item/visible_weapons/submachinegun
name = "Submachine Gun"
item_cost = 6
path = /obj/item/weapon/gun/projectile/automatic/c20r
/datum/uplink_item/item/visible_weapons/assaultrifle
name = "Assault Rifle"
item_cost = 7
path = /obj/item/weapon/gun/projectile/automatic/sts35
/*************************************
* Stealthy and Inconspicuous Weapons *
*************************************/
+2 -7
View File
@@ -68,10 +68,7 @@
if (istype(E, /datum/stack_recipe_list))
var/datum/stack_recipe_list/srl = E
if (src.get_amount() >= srl.req_amount)
t1 += "<a href='?src=\ref[src];sublist=[i]'>[srl.title] ([srl.req_amount] [src.singular_name]\s)</a>"
else
t1 += "[srl.title] ([srl.req_amount] [src.singular_name]\s)<br>"
t1 += "<a href='?src=\ref[src];sublist=[i]'>[srl.title]</a>"
if (istype(E, /datum/stack_recipe))
var/datum/stack_recipe/R = E
@@ -360,8 +357,6 @@
/datum/stack_recipe_list
var/title = "ERROR"
var/list/recipes = null
var/req_amount = 1
New(title, recipes, req_amount = 1)
New(title, recipes)
src.title = title
src.recipes = recipes
src.req_amount = req_amount
@@ -100,10 +100,6 @@ CIGARETTE PACKETS ARE IN FANCY.DM
flags |= NOREACT // so it doesn't react until you light it
create_reagents(chem_volume) // making the cigarrete a chemical holder with a maximum volume of 15
/obj/item/clothing/mask/smokable/Destroy()
..()
qdel(reagents)
/obj/item/clothing/mask/smokable/process()
var/turf/location = get_turf(src)
smoketime--
+1
View File
@@ -14,6 +14,7 @@ var/global/list/cached_icons = list()
amount_per_transfer_from_this = 10
possible_transfer_amounts = list(10,20,30,60)
volume = 60
unacidable = 0
flags = OPENCONTAINER
var/paint_type = "red"
@@ -15,8 +15,8 @@
/obj/item/weapon/storage/bible/booze/New()
..()
new /obj/item/weapon/reagent_containers/food/drinks/cans/beer(src)
new /obj/item/weapon/reagent_containers/food/drinks/cans/beer(src)
new /obj/item/weapon/reagent_containers/food/drinks/bottle/small/beer(src)
new /obj/item/weapon/reagent_containers/food/drinks/bottle/small/beer(src)
new /obj/item/weapon/spacecash(src)
new /obj/item/weapon/spacecash(src)
new /obj/item/weapon/spacecash(src)
@@ -146,11 +146,6 @@
new /obj/item/clothing/mask/smokable/cigarette(src)
create_reagents(15 * storage_slots)//so people can inject cigarettes without opening a packet, now with being able to inject the whole one
/obj/item/weapon/storage/fancy/cigarettes/Destroy()
qdel(reagents)
..()
/obj/item/weapon/storage/fancy/cigarettes/update_icon()
icon_state = "[initial(icon_state)][contents.len]"
return
@@ -202,10 +197,6 @@
new /obj/item/clothing/mask/smokable/cigarette/cigar(src)
create_reagents(15 * storage_slots)
/obj/item/weapon/storage/fancy/cigar/Destroy()
qdel(reagents)
..()
/obj/item/weapon/storage/fancy/cigar/update_icon()
icon_state = "[initial(icon_state)][contents.len]"
return