[READY]Refactors uplinks to a component!

This commit is contained in:
oranges
2017-11-23 10:16:16 +13:00
committed by CitadelStationBot
parent 2e9f3bc1c0
commit cec6c028f5
24 changed files with 468 additions and 298 deletions
+10 -10
View File
@@ -13,18 +13,16 @@
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.imp_in)
I.hidden_uplink.telecrystals += amount
use(amount)
to_chat(user, "<span class='notice'>You press [src] onto yourself and charge your hidden uplink.</span>")
GET_COMPONENT_FROM(hidden_uplink, /datum/component/uplink, I)
if(hidden_uplink)
hidden_uplink.telecrystals += amount
use(amount)
to_chat(user, "<span class='notice'>You press [src] onto yourself and charge your hidden uplink.</span>")
else
return ..()
/obj/item/stack/telecrystal/afterattack(obj/item/I, mob/user, proximity)
if(!proximity)
return
if(isitem(I) && 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.telecrystals += amount
use(amount)
to_chat(user, "<span class='notice'>You slot [src] into [I] and charge its internal uplink.</span>")
else if(istype(I, /obj/item/cartridge/virus/frame))
if(istype(I, /obj/item/cartridge/virus/frame))
var/obj/item/cartridge/virus/frame/cart = I
if(!cart.charges)
to_chat(user, "<span class='notice'>[cart] is out of charges, it's refusing to accept [src].</span>")
@@ -32,6 +30,8 @@
cart.telecrystals += amount
use(amount)
to_chat(user, "<span class='notice'>You slot [src] into [cart]. The next time it's used, it will also give telecrystals.</span>")
else
return ..()
/obj/item/stack/telecrystal/five
amount = 5