mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-20 10:37:17 +01:00
* one at a time let's go * air alarm * so many * meh * hell * hell * hmm * Attack chain migration: /obj/machinery * what the fuck? * hell * review fixes * whoops * fix build * nuke fixes, more tests * gland dispsenser and start of autolathe test * var renames * small fixes * i tire of life * more tests * more tests * more tests * shrink map * customize autolathe design disk load delay * cell charger * fire alarm frame installation test * funny and burz reviews * nuke fixes
35 lines
1.1 KiB
Plaintext
35 lines
1.1 KiB
Plaintext
// ID upgrader - swipe an ID on it to gain access types. Used on ruins.
|
|
/obj/machinery/computer/id_upgrader
|
|
name = "ID Upgrade Machine"
|
|
icon_state = "guest"
|
|
icon_screen = "pass"
|
|
/// Access to give
|
|
var/list/access_to_give = list(ACCESS_AWAY01)
|
|
/// Have we been used?
|
|
var/used = FALSE
|
|
|
|
/obj/machinery/computer/id_upgrader/item_interaction(mob/living/user, obj/item/used, list/modifiers)
|
|
if(istype(used, /obj/item/card/id))
|
|
var/obj/item/card/id/D = used
|
|
if(!length(access_to_give))
|
|
to_chat(user, "<span class='notice'>This machine appears to be configured incorrectly.</span>")
|
|
return ITEM_INTERACT_COMPLETE
|
|
|
|
var/did_upgrade = FALSE
|
|
var/list/id_access = D.GetAccess()
|
|
|
|
for(var/this_access in access_to_give)
|
|
if(!(this_access in id_access))
|
|
// don't have it - add it
|
|
D.access |= this_access
|
|
did_upgrade = TRUE
|
|
|
|
if(did_upgrade)
|
|
to_chat(user, "<span class='notice'>An access type was added to your ID card.</span>")
|
|
else
|
|
to_chat(user, "<span class='notice'>Your ID card already has all the access this machine can give.</span>")
|
|
|
|
return ITEM_INTERACT_COMPLETE
|
|
|
|
return ..()
|