Merged with dev.

This commit is contained in:
Zuhayr
2015-02-24 17:03:39 +10:30
97 changed files with 2517 additions and 1727 deletions
+31 -9
View File
@@ -11,12 +11,30 @@ A list of items and costs is stored under the datum of every game mode, alongsid
var/cost = 0
var/path = null
var/reference = ""
var/description = ""
datum/uplink_item/New(var/itemPath, var/itemCost as num, var/itemName as text, var/itemReference as text)
datum/uplink_item/New(var/itemPath, var/itemCost as num, var/itemName as text, var/itemReference as text, var/itemDescription)
cost = itemCost
path = itemPath
name = itemName
reference = itemReference
description = itemDescription
datum/uplink_item/proc/description()
if(!description)
// Fallback description
var/obj/temp = src.path
description = replacetext(initial(temp.desc), "\n", "<br>")
return description
/datum/uplink_item/proc/generate_item(var/newloc)
var/list/L = list()
if(ispath(path))
L += new path(newloc)
else if(islist(path))
for(var/item_path in path)
L += new item_path(newloc)
return L
datum/nano_item_lists
var/list/items_nano
@@ -41,16 +59,17 @@ datum/nano_item_lists
uses = ticker.mode.uplink_uses
ItemsCategory = ticker.mode.uplink_items
var/datum/nano_item_lists/IL = generate_item_lists()
nanoui_items = IL.items_nano
ItemsReference = IL.items_reference
world_uplinks += src
/obj/item/device/uplink/Del()
world_uplinks -= src
..()
/obj/item/device/uplink/proc/generate_items()
var/datum/nano_item_lists/IL = generate_item_lists()
nanoui_items = IL.items_nano
ItemsReference = IL.items_reference
// BS12 no longer use this menu but there are forks that do, hency why we keep it
/obj/item/device/uplink/proc/generate_menu()
var/dat = "<B>[src.welcome]</B><BR>"
@@ -87,7 +106,7 @@ datum/nano_item_lists
for(var/category in ItemsCategory)
nano[++nano.len] = list("Category" = category, "items" = list())
for(var/datum/uplink_item/I in ItemsCategory[category])
nano[nano.len]["items"] += list(list("Name" = I.name, "Cost" = I.cost, "obj_path" = I.reference))
nano[nano.len]["items"] += list(list("Name" = I.name, "Description" = I.description(),"Cost" = I.cost, "obj_path" = I.reference))
reference[I.reference] = I
var/datum/nano_item_lists/result = new
@@ -126,10 +145,11 @@ datum/nano_item_lists
used_TC += UI.cost
feedback_add_details("traitor_uplink_items_bought", reference)
var/obj/I = new UI.path(get_turf(usr))
var/list/L = UI.generate_item(get_turf(usr))
if(ishuman(usr))
var/mob/living/carbon/human/A = usr
A.put_in_any_hand_if_possible(I)
for(var/obj/I in L)
A.put_in_any_hand_if_possible(I)
purchase_log[UI] = purchase_log[UI] + 1
@@ -189,6 +209,8 @@ datum/nano_item_lists
data["welcome"] = welcome
data["crystals"] = uses
data["menu"] = nanoui_menu
if(!nanoui_items)
generate_items()
data["nano_items"] = nanoui_items
data += nanoui_data