Uplink implant. 'nuff said.

The only problem with it is that it doesn't update its window because durp can't pass user arguments to Topic(), so it uses usr by default, which doesn't work in this case.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1757 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
uporotiy
2011-07-03 20:10:06 +00:00
parent 43717b6a15
commit f1759a4aec
6 changed files with 44 additions and 9 deletions
+7 -2
View File
@@ -40,6 +40,7 @@
menu_message += "<A href='byond://?src=\ref[src];buy_item=voice'>Voice-Changer</A> (4)<BR>"
menu_message += "<BR>"
menu_message += "<A href='byond://?src=\ref[src];buy_item=imp_freedom'>Freedom Implant (with injector)</A> (3)<BR>"
menu_message += "<A href='byond://?src=\ref[src];buy_item=imp_uplink'>Uplink Implant (4 crystals inside)</A> (10)<BR>"
menu_message += "<A href='byond://?src=\ref[src];buy_item=paralysispen'>Paralysis Pen</A> (3)<BR>"
menu_message += "<A href='byond://?src=\ref[src];buy_item=sleepypen'>Sleepy Pen</A> (5)<BR>"
menu_message += "<BR>"
@@ -121,6 +122,11 @@
uses -= 3
var/obj/item/weapon/implanter/O = new /obj/item/weapon/implanter(get_turf(hostpda))
O.imp = new /obj/item/weapon/implant/freedom(O)
if("imp_uplink")
if (uses >= 10)
uses -= 10
var/obj/item/weapon/implanter/O = new /obj/item/weapon/implanter(get_turf(hostpda))
O.imp = new /obj/item/weapon/implant/uplink(O)
if("sleepypen")
if (uses >= 5)
uses -= 5
@@ -170,7 +176,6 @@
if(uses >= 3)
uses -= 3
new /obj/machinery/singularity_beacon/syndicate(get_turf(hostpda))
if("toolbox")
if(uses)
uses--
@@ -190,4 +195,4 @@
if (hostpda.mode==1)
hostpda.mode = 0
hostpda.updateDialog()
return
return
@@ -310,3 +310,21 @@ the implant may become unstable and either pre-maturely inject the subject or si
src.imp = null
user.show_message("\red You implanted the implant into [M].")
src.icon_state = "implanter0"
/obj/item/weapon/implant/uplink
var/activation_emote = "chuckle"
var/obj/item/weapon/syndicate_uplink/uplink = null
New()
activation_emote = pick("blink", "blink_r", "eyebrow", "chuckle", "twitch_s", "frown", "nod", "blush", "giggle", "grin", "groan", "shrug", "smile", "pale", "sniff", "whimper", "wink")
uplink = new /obj/item/weapon/syndicate_uplink/implanted(src)
..()
implanted(mob/source as mob)
source.mind.store_memory("Uplink implant can be activated by using the [activation_emote] emote, <B>say *[activation_emote]</B> to attempt to activate.", 0, 0)
source << "The implanted uplink implant can be activated by using the [activation_emote] emote, <B>say *[activation_emote]</B> to attempt to activate."
trigger(emote, mob/source as mob)
if(emote == activation_emote)
uplink.attack_self(source)
+18 -7
View File
@@ -3,6 +3,9 @@ CONTAINS:
SYNDICATE UPLINK
*/
/obj/item/weapon/syndicate_uplink/implanted
uses = 4
/obj/item/weapon/syndicate_uplink/proc/explode()
var/turf/location = get_turf(src.loc)
if(location)
@@ -15,6 +18,7 @@ SYNDICATE UPLINK
return
/obj/item/weapon/syndicate_uplink/attack_self(mob/user as mob)
currentUser = user
user.machine = src
var/dat
if (src.selfdestruct)
@@ -54,6 +58,8 @@ SYNDICATE UPLINK
dat += "<BR>"
dat += "<A href='byond://?src=\ref[src];buy_item=botchat'>Binary Translator</A> (3)<BR>"
dat += "<A href='byond://?src=\ref[src];buy_item=lawmod'>Hacked AI Module</A> (7)<BR>"
dat += "<BR>"
dat += "<A href='byond://?src=\ref[src];buy_item=toolbox'>Syndicate Toolbox</A> (Includes various tools) (1)<BR>"
dat += "<HR>"
if (src.origradio)
@@ -66,13 +72,14 @@ SYNDICATE UPLINK
/obj/item/weapon/syndicate_uplink/Topic(href, href_list)
..()
if (usr.stat || usr.restrained())
if(!currentUser)
return
var/mob/living/carbon/human/H = usr
if (!( istype(H, /mob/living/carbon/human)))
return 1
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))))
usr.machine = src
if (currentUser.stat || currentUser.restrained())
return
if (!( istype(currentUser, /mob/living/carbon/human)))
return
if ((currentUser.contents.Find(src) || (in_range(src, currentUser) && istype(src.loc, /turf))) || istype(src,/obj/item/weapon/syndicate_uplink/implanted))
currentUser.machine = src
if (href_list["buy_item"])
switch(href_list["buy_item"])
if("revolver")
@@ -127,7 +134,7 @@ SYNDICATE UPLINK
if("cloak")
if (src.uses >= 4)
if (ticker.mode.config_tag!="nuclear" || \
(input("Spawning a cloak in nuke is generally regarded as entirely dumb, are you sure?") in list("Confirm", "Abort")) == "Confirm" \
(input(currentUser,"Spawning a cloak in nuke is generally regarded as entirely dumb, are you sure?") in list("Confirm", "Abort")) == "Confirm" \
)
if (src.uses >= 4)
src.uses -= 4
@@ -161,6 +168,10 @@ SYNDICATE UPLINK
if (src.uses >= 3)
src.uses -= 3
new /obj/item/device/radio/headset/traitor(get_turf(src))
if("toolbox")
if(uses)
uses--
new /obj/item/weapon/storage/toolbox/syndicate(get_turf(src))
else if (href_list["lock"] && src.origradio)
// presto chango, a regular radio again! (reset the freq too...)
shutdown_uplink()