Files
Paradise/code/game/objects/items/stacks/telecrystal.dm
T
warriorstar-orionandGitHub 525c68d617 Attack chain, initial setup. (pull *immediately* for *any* TM issues) (#26834)
* refactor: Attack chain, initial setup.

* migrate curtain to make dreamchecker happy

* update thurible

* don't call attacked_by separately for legacy attack chain

* remove duplicate proc

* condense similar code, put allowances for legacy code in new procs

* update docs, include diagram source

* add comment on how to update diagram

* fix admonition

* mindflayer updates

* remove commented out code

* clarify all steps

* after_attack should be overridable

* whoops

* retrofit recent changes

* duh, can't restrict this yet because of tool_acts

* i hate ore bags with the fire of a thousand suns

* return correct value for object attack logic

* Various cleanups.

We don't want to attempt to pull stuff out of `/obj/item/attackby`,
because those pieces are part of the related objects' migrations, not
`/obj/item` itself. Attempting to do this causes knockon effects where
things expected to call e.g. `/obj/item/storage/attackby` in the call
chain were not ferried over to the new item interaction code, because
the related objects hadn't actually been migrated over yet.

I've used refactoring /obj/vehicle as the example for migrating
`attackby` methods instead.

* simplify some argument names

* fuck it

* make it do the thing

* Rename CI module call

* Prove that CI works

* improve test output

* aaand fix it again

* fix curtain tool interactions

* fix compile error

* fix compile error

* Better docs, introduce migration plan tool.
2024-12-02 23:36:36 +00:00

54 lines
2.0 KiB
Plaintext

/obj/item/stack/telecrystal
name = "telecrystal"
desc = "It seems to be pulsing with suspiciously enticing energies."
singular_name = "telecrystal"
icon = 'icons/obj/stacks/minerals.dmi'
icon_state = "telecrystal"
item_state = "telecrystal"
w_class = WEIGHT_CLASS_TINY
max_amount = 100
flags = NOBLUDGEON
origin_tech = "materials=6;syndicate=1"
dynamic_icon_state = TRUE
/obj/item/stack/telecrystal/attack__legacy__attackchain(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/bio_chip/uplink/I in target)
if(I && I.imp_in)
I.hidden_uplink.uses += amount
use(amount)
to_chat(user, "<span class='notice'>You press [src] onto yourself and charge your hidden uplink.</span>")
/obj/item/stack/telecrystal/afterattack__legacy__attackchain(obj/item/I, mob/user, proximity)
if(!proximity)
return
if(istype(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.uses += 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/frame))
var/obj/item/cartridge/frame/cart = I
if(!cart.charges)
to_chat(user, "<span class='notice'>[cart] is out of charges, it's refusing to accept [src]</span>")
return
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>")
/obj/item/stack/telecrystal/examine(mob/user)
. = ..()
if(isAntag(user))
. += "<span class='warning'>Telecrystals can be activated by utilizing them on devices with an actively running uplink. They will not activate on inactive uplinks.</span>"
/obj/item/stack/telecrystal/five
amount = 5
/obj/item/stack/telecrystal/twenty
amount = 20
/obj/item/stack/telecrystal/fifty
amount = 50
/obj/item/stack/telecrystal/hundred
amount = 100