July 5th TG sync (#1883)

July 5th TG sync
This commit is contained in:
Poojawa
2017-07-05 22:14:19 -05:00
committed by GitHub
parent 454b9c3d68
commit b1b4826c0c
1264 changed files with 149689 additions and 570309 deletions
+145 -145
View File
@@ -1,160 +1,160 @@
GLOBAL_LIST_EMPTY(uplinks)
/**
* Uplinks
*
* All /obj/item(s) have a hidden_uplink var. By default it's null. Give the item one with 'new(src') (it must be in it's contents). Then add 'uses.'
* Use whatever conditionals you want to check that the user has an uplink, and then call interact() on their uplink.
* You might also want the uplink menu to open if active. Check if the uplink is 'active' and then interact() with it.
**/
/obj/item/device/uplink
name = "syndicate uplink"
desc = "There is something wrong if you're examining this."
var/active = FALSE
var/lockable = TRUE
var/telecrystals = 20
var/selected_cat = null
var/owner = null
var/datum/game_mode/gamemode = null
var/spent_telecrystals = 0
var/purchase_log = ""
var/list/uplink_items
GLOBAL_LIST_EMPTY(uplinks)
/**
* Uplinks
*
* All /obj/item(s) have a hidden_uplink var. By default it's null. Give the item one with 'new(src') (it must be in it's contents). Then add 'uses.'
* Use whatever conditionals you want to check that the user has an uplink, and then call interact() on their uplink.
* You might also want the uplink menu to open if active. Check if the uplink is 'active' and then interact() with it.
**/
/obj/item/device/uplink
name = "syndicate uplink"
desc = "There is something wrong if you're examining this."
var/active = FALSE
var/lockable = TRUE
var/telecrystals = 20
var/selected_cat = null
var/owner = null
var/datum/game_mode/gamemode = null
var/spent_telecrystals = 0
var/purchase_log = ""
var/list/uplink_items
var/hidden_crystals = 0
/obj/item/device/uplink/Initialize()
. = ..()
GLOB.uplinks += src
uplink_items = get_uplink_items(gamemode)
/obj/item/device/uplink/proc/set_gamemode(gamemode)
src.gamemode = gamemode
uplink_items = get_uplink_items(gamemode)
/obj/item/device/uplink/Destroy()
GLOB.uplinks -= src
return ..()
/obj/item/device/uplink/attackby(obj/item/I, mob/user, params)
for(var/item in subtypesof(/datum/uplink_item))
var/datum/uplink_item/UI = item
var/path = null
if(initial(UI.refund_path))
path = initial(UI.refund_path)
else
path = initial(UI.item)
var/cost = 0
if(initial(UI.refund_amount))
cost = initial(UI.refund_amount)
else
cost = initial(UI.cost)
var/refundable = initial(UI.refundable)
if(I.type == path && refundable && I.check_uplink_validity())
telecrystals += cost
spent_telecrystals -= cost
to_chat(user, "<span class='notice'>[I] refunded.</span>")
qdel(I)
return
..()
/obj/item/device/uplink/interact(mob/user)
active = TRUE
GLOB.uplinks += src
uplink_items = get_uplink_items(gamemode)
/obj/item/device/uplink/proc/set_gamemode(gamemode)
src.gamemode = gamemode
uplink_items = get_uplink_items(gamemode)
/obj/item/device/uplink/Destroy()
GLOB.uplinks -= src
return ..()
/obj/item/device/uplink/attackby(obj/item/I, mob/user, params)
for(var/item in subtypesof(/datum/uplink_item))
var/datum/uplink_item/UI = item
var/path = null
if(initial(UI.refund_path))
path = initial(UI.refund_path)
else
path = initial(UI.item)
var/cost = 0
if(initial(UI.refund_amount))
cost = initial(UI.refund_amount)
else
cost = initial(UI.cost)
var/refundable = initial(UI.refundable)
if(I.type == path && refundable && I.check_uplink_validity())
telecrystals += cost
spent_telecrystals -= cost
to_chat(user, "<span class='notice'>[I] refunded.</span>")
qdel(I)
return
..()
/obj/item/device/uplink/interact(mob/user)
active = TRUE
if(user)
ui_interact(user)
/obj/item/device/uplink/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.inventory_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "uplink", name, 450, 750, master_ui, state)
ui.set_autoupdate(FALSE) // This UI is only ever opened by one person, and never is updated outside of user input.
ui.set_style("syndicate")
ui.open()
/obj/item/device/uplink/ui_data(mob/user)
if(!user.mind)
return
var/list/data = list()
data["telecrystals"] = telecrystals
data["lockable"] = lockable
data["categories"] = list()
for(var/category in uplink_items)
var/list/cat = list(
"name" = category,
"items" = (category == selected_cat ? list() : null))
if(category == selected_cat)
for(var/item in uplink_items[category])
var/datum/uplink_item/I = uplink_items[category][item]
if(I.limited_stock == 0)
continue
if(I.restricted_roles.len)
var/is_inaccessible = 1
for(var/R in I.restricted_roles)
if(R == user.mind.assigned_role)
is_inaccessible = 0
if(is_inaccessible)
continue
cat["items"] += list(list(
"name" = I.name,
"cost" = I.cost,
"desc" = I.desc,
))
data["categories"] += list(cat)
return data
/obj/item/device/uplink/ui_act(action, params)
if(!active)
return
switch(action)
if("buy")
var/item = params["item"]
var/list/buyable_items = list()
for(var/category in uplink_items)
buyable_items += uplink_items[category]
if(item in buyable_items)
var/datum/uplink_item/I = buyable_items[item]
I.buy(usr, src)
. = TRUE
if("lock")
active = FALSE
/obj/item/device/uplink/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.inventory_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "uplink", name, 450, 750, master_ui, state)
ui.set_autoupdate(FALSE) // This UI is only ever opened by one person, and never is updated outside of user input.
ui.set_style("syndicate")
ui.open()
/obj/item/device/uplink/ui_data(mob/user)
if(!user.mind)
return
var/list/data = list()
data["telecrystals"] = telecrystals
data["lockable"] = lockable
data["categories"] = list()
for(var/category in uplink_items)
var/list/cat = list(
"name" = category,
"items" = (category == selected_cat ? list() : null))
if(category == selected_cat)
for(var/item in uplink_items[category])
var/datum/uplink_item/I = uplink_items[category][item]
if(I.limited_stock == 0)
continue
if(I.restricted_roles.len)
var/is_inaccessible = 1
for(var/R in I.restricted_roles)
if(R == user.mind.assigned_role)
is_inaccessible = 0
if(is_inaccessible)
continue
cat["items"] += list(list(
"name" = I.name,
"cost" = I.cost,
"desc" = I.desc,
))
data["categories"] += list(cat)
return data
/obj/item/device/uplink/ui_act(action, params)
if(!active)
return
switch(action)
if("buy")
var/item = params["item"]
var/list/buyable_items = list()
for(var/category in uplink_items)
buyable_items += uplink_items[category]
if(item in buyable_items)
var/datum/uplink_item/I = buyable_items[item]
I.buy(usr, src)
. = TRUE
if("lock")
active = FALSE
telecrystals += hidden_crystals
hidden_crystals = 0
SStgui.close_uis(src)
if("select")
selected_cat = params["category"]
return 1
/obj/item/device/uplink/ui_host()
return loc
// Refund certain items by hitting the uplink with it.
/obj/item/device/radio/uplink/attackby(obj/item/I, mob/user, params)
return hidden_uplink.attackby(I, user, params)
// A collection of pre-set uplinks, for admin spawns.
SStgui.close_uis(src)
if("select")
selected_cat = params["category"]
return 1
/obj/item/device/uplink/ui_host()
return loc
// Refund certain items by hitting the uplink with it.
/obj/item/device/radio/uplink/attackby(obj/item/I, mob/user, params)
return hidden_uplink.attackby(I, user, params)
// A collection of pre-set uplinks, for admin spawns.
/obj/item/device/radio/uplink/Initialize()
. = ..()
icon_state = "radio"
hidden_uplink = new(src)
hidden_uplink.active = TRUE
hidden_uplink.lockable = FALSE
icon_state = "radio"
hidden_uplink = new(src)
hidden_uplink.active = TRUE
hidden_uplink.lockable = FALSE
/obj/item/device/radio/uplink/nuclear/Initialize()
. = ..()
hidden_uplink.set_gamemode(/datum/game_mode/nuclear)
hidden_uplink.set_gamemode(/datum/game_mode/nuclear)
/obj/item/device/multitool/uplink/Initialize()
. = ..()
hidden_uplink = new(src)
hidden_uplink.active = TRUE
hidden_uplink.lockable = FALSE
hidden_uplink = new(src)
hidden_uplink.active = TRUE
hidden_uplink.lockable = FALSE
/obj/item/weapon/pen/uplink/Initialize()
. = ..()
hidden_uplink = new(src)
traitor_unlock_degrees = 360
hidden_uplink = new(src)
traitor_unlock_degrees = 360
+15 -14
View File
@@ -455,8 +455,8 @@ GLOBAL_LIST_EMPTY(uplink_items) // Global list so we only initialize this once.
include_modes = list(/datum/game_mode/nuclear)
/datum/uplink_item/ammo/shotgun/bag
name = "12g Ammo duffelbag"
desc = "A duffelbag filled with enough 12g ammo to supply an entire team, at a discounted price."
name = "12g Ammo Duffel Bag"
desc = "A duffel bag filled with enough 12g ammo to supply an entire team, at a discounted price."
item = /obj/item/weapon/storage/backpack/duffelbag/syndie/ammo/shotgun
cost = 12
@@ -469,8 +469,8 @@ GLOBAL_LIST_EMPTY(uplink_items) // Global list so we only initialize this once.
include_modes = list(/datum/game_mode/nuclear, /datum/game_mode/gang)
/datum/uplink_item/ammo/smg/bag
name = ".45 Ammo duffelbag"
desc = "A duffelbag filled with enough .45 ammo to supply an entire team, at a discounted price."
name = ".45 Ammo Duffel Bag"
desc = "A duffel bag filled with enough .45 ammo to supply an entire team, at a discounted price."
item = /obj/item/weapon/storage/backpack/duffelbag/syndie/ammo/smg
cost = 20
include_modes = list(/datum/game_mode/nuclear)
@@ -748,7 +748,7 @@ GLOBAL_LIST_EMPTY(uplink_items) // Global list so we only initialize this once.
name = "F.R.A.M.E. PDA Cartridge"
desc = "When inserted into a personal digital assistant, this cartridge gives you five PDA viruses which \
when used cause the targeted PDA to become a new uplink with zero TCs, and immediately become unlocked. \
You will recieve the unlock code upon activating the virus, and the new uplink may be charged with \
You will receive the unlock code upon activating the virus, and the new uplink may be charged with \
telecrystals normally."
item = /obj/item/weapon/cartridge/virus/frame
cost = 4
@@ -846,7 +846,7 @@ GLOBAL_LIST_EMPTY(uplink_items) // Global list so we only initialize this once.
/datum/uplink_item/suits/space_suit
name = "Syndicate Space Suit"
desc = "This red and black syndicate space suit is less encumbering than Nanotrasen variants, \
fits inside bags, and has a weapon slot. Nanotrasen crewmembers are trained to report red space suit \
fits inside bags, and has a weapon slot. Nanotrasen crew members are trained to report red space suit \
sightings, however."
item = /obj/item/weapon/storage/box/syndie_kit/space
cost = 4
@@ -865,15 +865,17 @@ GLOBAL_LIST_EMPTY(uplink_items) // Global list so we only initialize this once.
/datum/uplink_item/suits/hardsuit/elite
name = "Elite Syndicate Hardsuit"
desc = "An advanced hardsuit with superior armor and mobility to the standard Syndicate hardsuit."
desc = "An upgraded, elite version of the syndicate hardsuit. It features fireproofing, and also \
provides the user with superior armor and mobility compared to the standard syndicate hardsuit."
item = /obj/item/clothing/suit/space/hardsuit/syndi/elite
cost = 8
include_modes = list(/datum/game_mode/nuclear)
exclude_modes = list()
/datum/uplink_item/suits/hardsuit/shielded
name = "Shielded Hardsuit"
desc = "An advanced hardsuit with built in energy shielding. The shields will rapidly recharge when not under fire."
name = "Shielded Syndicate Hardsuit"
desc = "An upgraded version of the standard syndicate hardsuit. It features a built-in energy shielding system. \
The shields can handle up to three impacts within a short duration and will rapidly recharge while not under fire."
item = /obj/item/clothing/suit/space/hardsuit/shielded/syndi
cost = 30
include_modes = list(/datum/game_mode/nuclear)
@@ -899,8 +901,8 @@ GLOBAL_LIST_EMPTY(uplink_items) // Global list so we only initialize this once.
cost = 1
/datum/uplink_item/device_tools/surgerybag
name = "Syndicate Surgery duffelbag"
desc = "The Syndicate surgery duffelbag is a toolkit containing all surgery tools, surgical drapes, \
name = "Syndicate Surgery Duffel Bag"
desc = "The Syndicate surgery duffel bag is a toolkit containing all surgery tools, surgical drapes, \
a Syndicate brand MMI, a straitjacket, and a muzzle."
item = /obj/item/weapon/storage/backpack/duffelbag/syndie/surgery
cost = 3
@@ -1130,18 +1132,17 @@ GLOBAL_LIST_EMPTY(uplink_items) // Global list so we only initialize this once.
/datum/uplink_item/device_tools/codespeak_manual
name = "Codespeak Manual"
desc = "Syndicate agents can be trained to use a series of codewords to comvey complex information, which sounds like random concepts and drinks to anyone listening. This manual teaches you this Codespeak. You can also hit someone else with the manual in order to teach them. One use."
desc = "Syndicate agents can be trained to use a series of codewords to convey complex information, which sounds like random concepts and drinks to anyone listening. This manual teaches you this Codespeak. You can also hit someone else with the manual in order to teach them. One use."
item = /obj/item/weapon/codespeak_manual
cost = 2
exclude_modes = list(/datum/game_mode/nuclear)
/datum/uplink_item/device_tools/codespeak_manual_deluxe
name = "Deluxe Codespeak Manual"
desc = "Syndicate agents can be trained to use a series of codewords to comvey complex information, which sounds like random concepts and drinks to anyone listening. This manual teaches you this Codespeak. You can also hit someone else with the manual in order to teach them. This is the deluxe edition, which has unlimited uses."
desc = "Syndicate agents can be trained to use a series of codewords to convey complex information, which sounds like random concepts and drinks to anyone listening. This manual teaches you this Codespeak. You can also hit someone else with the manual in order to teach them. This is the deluxe edition, which has unlimited uses."
cost = 8
include_modes = list(/datum/game_mode/nuclear)
// Implants
/datum/uplink_item/implants
category = "Implants"
+11 -3
View File
@@ -1,4 +1,4 @@
/datum/uplink_item/stealthy_tools/syndi_borer
/*/datum/uplink_item/stealthy_tools/syndi_borer
name = "Syndicate Brain Slug"
desc = "A small cortical borer, modified to be completely loyal to the owner. \
Genetically infertile, these brain slugs can assist medically in a support role, or take direct action \
@@ -7,7 +7,7 @@
refundable = TRUE
cost = 10
surplus = 20 //Let's not have this be too common
exclude_modes = list(/datum/game_mode/nuclear)
exclude_modes = list(/datum/game_mode/nuclear) */
/datum/uplink_item/stealthy_tools/holoparasite
name="Holoparasite Injector"
@@ -19,4 +19,12 @@
cost = 15 //I'm working off the borer. Price subject to change
surplus = 20 //Nobody needs a ton of parasites
exclude_modes = list(/datum/game_mode/nuclear)
refund_path = /obj/item/weapon/guardiancreator/tech/choose/traitor
refund_path = /obj/item/weapon/guardiancreator/tech/choose/traitor
/obj/item/weapon/storage/box/syndie_kit/holoparasite
name = "box"
/obj/item/weapon/storage/box/syndie_kit/holoparasite/PopulateContents()
new /obj/item/weapon/guardiancreator/tech/choose/traitor(src)
new /obj/item/weapon/paper/guardian(src)