Agent ID Buff (#8918)

The agent ID card now makes you invisible to the AI when electronic warfare is enabled.
    The price of the agent ID card have been upped to 4, from 3.
    Agent IDs now have a charge, which lasts for a few minutes. When the charge runs out, electronic warfare is disabled.

Credits to Loaf (the man of many names) from Nebula for teaching me this technique.
This commit is contained in:
Geeves
2020-05-25 19:22:41 +03:00
committed by GitHub
parent 74a0f05ef2
commit 344630ea29
9 changed files with 113 additions and 6 deletions
+4
View File
@@ -466,6 +466,10 @@ var/list/global/slot_flags_enumeration = list(
return 0
return 1
// override for give shenanigans
/obj/item/proc/on_give(var/mob/giver, var/mob/receiver)
return
/*
/obj/item/verb/verb_pickup()
set src in oview(1)
@@ -2,17 +2,38 @@
name = "agent card"
assignment = "Agent"
origin_tech = list(TECH_ILLEGAL = 3)
var/electronic_warfare = 1
var/charge = 10000
var/electronic_warfare = FALSE
var/image/obfuscation_image
var/mob/registered_user = null
/obj/item/card/id/syndicate/New(mob/user as mob)
..()
access = syndicate_access.Copy()
START_PROCESSING(SSprocessing, src)
/obj/item/card/id/syndicate/Destroy()
STOP_PROCESSING(SSprocessing, src)
unset_registered_user(registered_user)
return ..()
/obj/item/card/id/syndicate/examine(mob/user)
..()
if(Adjacent(user))
if(user == registered_user)
to_chat(user, FONT_SMALL(SPAN_NOTICE("It is at [charge]/[initial(charge)] charge.")))
/obj/item/card/id/syndicate/process()
if(electronic_warfare)
charge = max(0, charge - 50)
if(charge <= 0)
if(ismob(loc))
to_chat(loc, SPAN_WARNING("\The [src] runs out of power and deactivates."))
electronic_warfare = FALSE
check_obfuscation()
else if(charge != initial(charge))
charge = min(initial(charge), charge + 100)
/obj/item/card/id/syndicate/prevent_tracking()
return electronic_warfare
@@ -79,6 +100,42 @@
return STATUS_CLOSE
return ..()
/obj/item/card/id/syndicate/throw_at()
..()
electronic_warfare = FALSE
check_obfuscation()
/obj/item/card/id/syndicate/dropped()
..()
electronic_warfare = FALSE
check_obfuscation()
/obj/item/card/id/syndicate/on_give()
check_obfuscation()
/obj/item/card/id/syndicate/update_icon()
cut_overlays()
if(electronic_warfare)
var/mutable_appearance/electro_overlay = mutable_appearance(icon, "electronic_warfare")
add_overlay(electro_overlay)
/obj/item/card/id/syndicate/proc/check_obfuscation()
if(electronic_warfare)
if(ismob(loc))
obfuscation_image = image("loc" = loc)
obfuscation_image.override = TRUE
SSai_obfuscation.add_obfuscation_image(obfuscation_image)
else if(obfuscation_image)
electronic_warfare = FALSE
SSai_obfuscation.remove_obfuscation_image(obfuscation_image)
QDEL_NULL(obfuscation_image)
else
if(obfuscation_image)
SSai_obfuscation.remove_obfuscation_image(obfuscation_image)
QDEL_NULL(obfuscation_image)
update_icon()
/obj/item/card/id/syndicate/Topic(href, href_list, var/datum/topic_state/state)
if(..())
return 1
@@ -86,7 +143,8 @@
var/user = usr
if(href_list["electronic_warfare"])
electronic_warfare = text2num(href_list["electronic_warfare"])
to_chat(user, "<span class='notice'>Electronic warfare [electronic_warfare ? "enabled" : "disabled"].</span>")
to_chat(user, SPAN_NOTICE("Electronic warfare [electronic_warfare ? "enabled" : "disabled"]."))
check_obfuscation()
else if(href_list["set"])
switch(href_list["set"])
if("Age")