From 0f28456db3e07197cdca4b2a16234edeec54d8d7 Mon Sep 17 00:00:00 2001 From: Fox McCloud Date: Thu, 19 Apr 2018 20:54:59 -0400 Subject: [PATCH] Adds F.R.A.M.E. Cartridge --- code/datums/uplink_item.dm | 24 +++++++++++++ code/game/objects/items/devices/uplinks.dm | 3 ++ code/game/objects/items/stacks/telecrystal.dm | 35 +++++++++++++------ code/modules/pda/cart.dm | 7 ++++ code/modules/pda/messenger_plugins.dm | 21 ++++++++++- 5 files changed, 78 insertions(+), 12 deletions(-) diff --git a/code/datums/uplink_item.dm b/code/datums/uplink_item.dm index a2a6a894d6f..1390873687f 100644 --- a/code/datums/uplink_item.dm +++ b/code/datums/uplink_item.dm @@ -874,6 +874,16 @@ var/list/uplink_items = list() gamemodes = list(/datum/game_mode/nuclear) excludefrom = list() +/datum/uplink_item/stealthy_tools/frame + 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 receive the unlock code upon activating the virus, and the new uplink may be charged with \ + telecrystals normally." + reference = "FRAME" + item = /obj/item/cartridge/frame + cost = 4 + /datum/uplink_item/stealthy_tools/agent_card name = "Agent ID Card" desc = "Agent cards prevent artificial intelligences from tracking the wearer, and can copy access from other identification cards. The access is cumulative, so scanning one card does not erase the access gained from another." @@ -1153,6 +1163,20 @@ var/list/uplink_items = list() cost = 1 surplus = 0 +/datum/uplink_item/device_tools/telecrystal/five + name = "5 Raw Telecrystals" + desc = "Five telecrystals in their rawest and purest form; can be utilized on active uplinks to increase their telecrystal count." + reference = "RTCF" + item = /obj/item/stack/telecrystal/five + cost = 5 + +/datum/uplink_item/device_tools/telecrystal/twenty + name = "20 Raw Telecrystals" + desc = "Twenty telecrystals in their rawest and purest form; can be utilized on active uplinks to increase their telecrystal count." + reference = "RTCT" + item = /obj/item/stack/telecrystal/twenty + cost = 20 + /datum/uplink_item/device_tools/jammer name = "Radio Jammer" desc = "This device will disrupt any nearby outgoing radio communication when activated." diff --git a/code/game/objects/items/devices/uplinks.dm b/code/game/objects/items/devices/uplinks.dm index b5aaaee4707..d138ce82a77 100644 --- a/code/game/objects/items/devices/uplinks.dm +++ b/code/game/objects/items/devices/uplinks.dm @@ -11,6 +11,7 @@ var/list/world_uplinks = list() /obj/item/device/uplink var/welcome // Welcoming menu message var/uses // Numbers of crystals + var/hidden_crystals = 0 var/list/ItemsCategory // List of categories with lists of items var/list/ItemsReference // List of references with an associated item var/list/nanoui_items // List of items for NanoUI use @@ -231,6 +232,8 @@ var/list/world_uplinks = list() return 1 else if(href_list["lock"]) toggle() + uses += hidden_crystals + hidden_crystals = 0 ui.close() return 1 if(href_list["return"]) diff --git a/code/game/objects/items/stacks/telecrystal.dm b/code/game/objects/items/stacks/telecrystal.dm index 94196ecf251..6f160ca2440 100644 --- a/code/game/objects/items/stacks/telecrystal.dm +++ b/code/game/objects/items/stacks/telecrystal.dm @@ -10,19 +10,32 @@ flags = NOBLUDGEON origin_tech = "materials=6;syndicate=1" -/obj/item/stack/telecrystal/attack(mob/target as mob, mob/user as mob) +/obj/item/stack/telecrystal/attack(mob/target, mob/user) if(target == user) //You can't go around smacking people with crystals to find out if they have an uplink or not. for(var/obj/item/implant/uplink/I in target) - if(I && I.implanted) - I.hidden_uplink.uses +=1 - use(1) - to_chat(user, "You press the [src] onto yourself and charge your hidden uplink.") + if(I && I.imp_in) + I.hidden_uplink.uses += amount + use(amount) + to_chat(user, "You press [src] onto yourself and charge your hidden uplink.") -/obj/item/stack/telecrystal/afterattack(var/obj/item/I as obj, mob/user as mob, proximity) +/obj/item/stack/telecrystal/afterattack(obj/item/I, mob/user, proximity) if(!proximity) return - if(istype(I, /obj/item)) - if(I.hidden_uplink && I.hidden_uplink.active) //No metagaming by using this on every PDA around just to see if it gets used up. - I.hidden_uplink.uses +=1 - use(1) - to_chat(user, "You slot the [src] into the [I] and charge its internal uplink.") + if(istype(I, /obj/item) && I.hidden_uplink && I.hidden_uplink.active) //No metagaming by using this on every PDA around just to see if it gets used up. + I.hidden_uplink.uses += amount + use(amount) + to_chat(user, "You slot [src] into [I] and charge its internal uplink.") + else if(istype(I, /obj/item/cartridge/frame)) + var/obj/item/cartridge/frame/cart = I + if(!cart.charges) + to_chat(user, "[cart] is out of charges, it's refusing to accept [src]") + return + cart.telecrystals += amount + use(amount) + to_chat(user, "You slot [src] into the [cart]. The next time it's used, it will also give telecrystals") + +/obj/item/stack/telecrystal/five + amount = 5 + +/obj/item/stack/telecrystal/twenty + amount = 20 \ No newline at end of file diff --git a/code/modules/pda/cart.dm b/code/modules/pda/cart.dm index 1346dd2bfdd..aabbefdb204 100644 --- a/code/modules/pda/cart.dm +++ b/code/modules/pda/cart.dm @@ -296,6 +296,13 @@ if(istype(D)) D.remote_door_id = initial_remote_door_id +/obj/item/cartridge/frame + name = "F.R.A.M.E. cartridge" + icon_state = "cart" + charges = 5 + var/telecrystals = 0 + messenger_plugins = list(new/datum/data/pda/messenger_plugin/virus/frame) + /obj/item/cartridge/mob_hunt_game name = "Nano-Mob Hunter GO! Cartridge" desc = "The hit new PDA game that lets you track down and capture your favorite Nano-Mobs living in your world!" diff --git a/code/modules/pda/messenger_plugins.dm b/code/modules/pda/messenger_plugins.dm index b1fa63dd2e0..8b00e7e6ef5 100644 --- a/code/modules/pda/messenger_plugins.dm +++ b/code/modules/pda/messenger_plugins.dm @@ -72,4 +72,23 @@ user.show_message("Success!", 1) log_admin("[key_name(user)] just attempted to blow up [P] with the Detomatix cartridge and succeded") message_admins("[key_name_admin(user)] just attempted to blow up [P] with the Detomatix cartridge and succeded", 1) - P.explode() \ No newline at end of file + P.explode() + +/datum/data/pda/messenger_plugin/virus/frame + icon = "exclamation-circle" + +/datum/data/pda/messenger_plugin/virus/frame/user_act(mob/user, obj/item/device/pda/P) + . = ..(user, P) + if(.) + var/lock_code = "[rand(100,999)] [pick("Alpha","Bravo","Charlie","Delta","Echo","Foxtrot","Golf","Hotel","India","Juliet","Kilo","Lima","Mike","November","Oscar","Papa","Quebec","Romeo","Sierra","Tango","Uniform","Victor","Whiskey","X-ray","Yankee","Zulu")]" + user.show_message("Virus Sent! The unlock code to the target is: [lock_code]") + if(!P.hidden_uplink) + var/obj/item/device/uplink/hidden/uplink = new(P) + P.hidden_uplink = uplink + P.lock_code = lock_code + else + P.hidden_uplink.hidden_crystals += P.hidden_uplink.uses //Temporarially hide the PDA's crystals, so you can't steal telecrystals. + var/obj/item/cartridge/frame/parent_cart = pda.cartridge + P.hidden_uplink.uses = parent_cart.telecrystals + parent_cart.telecrystals = 0 + P.hidden_uplink.active = TRUE \ No newline at end of file