mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 20:48:56 +01:00
Fully implements the ID Card design document (#56910)
Co-authored-by: Rohesie <rohesie@gmail.com>
This commit is contained in:
@@ -538,7 +538,7 @@
|
||||
|
||||
/obj/item/storage/box/ids/PopulateContents()
|
||||
for(var/i in 1 to 7)
|
||||
new /obj/item/card/id(src)
|
||||
new /obj/item/card/id/advanced(src)
|
||||
|
||||
//Some spare PDAs in a box
|
||||
/obj/item/storage/box/pdas
|
||||
@@ -565,7 +565,7 @@
|
||||
|
||||
/obj/item/storage/box/silver_ids/PopulateContents()
|
||||
for(var/i in 1 to 7)
|
||||
new /obj/item/card/id/silver(src)
|
||||
new /obj/item/card/id/advanced/silver(src)
|
||||
|
||||
/obj/item/storage/box/prisoner
|
||||
name = "box of prisoner IDs"
|
||||
@@ -575,13 +575,13 @@
|
||||
|
||||
/obj/item/storage/box/prisoner/PopulateContents()
|
||||
..()
|
||||
new /obj/item/card/id/prisoner/one(src)
|
||||
new /obj/item/card/id/prisoner/two(src)
|
||||
new /obj/item/card/id/prisoner/three(src)
|
||||
new /obj/item/card/id/prisoner/four(src)
|
||||
new /obj/item/card/id/prisoner/five(src)
|
||||
new /obj/item/card/id/prisoner/six(src)
|
||||
new /obj/item/card/id/prisoner/seven(src)
|
||||
new /obj/item/card/id/advanced/prisoner/one(src)
|
||||
new /obj/item/card/id/advanced/prisoner/two(src)
|
||||
new /obj/item/card/id/advanced/prisoner/three(src)
|
||||
new /obj/item/card/id/advanced/prisoner/four(src)
|
||||
new /obj/item/card/id/advanced/prisoner/five(src)
|
||||
new /obj/item/card/id/advanced/prisoner/six(src)
|
||||
new /obj/item/card/id/advanced/prisoner/seven(src)
|
||||
|
||||
/obj/item/storage/box/seccarts
|
||||
name = "box of PDA security cartridges"
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
var/l_setshort = FALSE
|
||||
var/l_hacking = FALSE
|
||||
var/open = FALSE
|
||||
var/can_hack_open = TRUE
|
||||
w_class = WEIGHT_CLASS_NORMAL
|
||||
desc = "This shouldn't exist. If it does, create an issue report."
|
||||
|
||||
@@ -35,30 +36,31 @@
|
||||
. += "The service panel is currently <b>[open ? "unscrewed" : "screwed shut"]</b>."
|
||||
|
||||
/obj/item/storage/secure/attackby(obj/item/W, mob/user, params)
|
||||
if(SEND_SIGNAL(src, COMSIG_IS_STORAGE_LOCKED))
|
||||
if(can_hack_open && SEND_SIGNAL(src, COMSIG_IS_STORAGE_LOCKED))
|
||||
if (W.tool_behaviour == TOOL_SCREWDRIVER)
|
||||
if (W.use_tool(src, user, 20))
|
||||
open =! open
|
||||
open = !open
|
||||
to_chat(user, "<span class='notice'>You [open ? "open" : "close"] the service panel.</span>")
|
||||
return
|
||||
if (W.tool_behaviour == TOOL_WIRECUTTER)
|
||||
to_chat(user, "<span class='danger'>[src] is protected from this sort of tampering, yet it appears the internal memory wires can still be <b>pulsed</b>.</span>")
|
||||
if ((W.tool_behaviour == TOOL_MULTITOOL) && (!l_hacking))
|
||||
return
|
||||
if (W.tool_behaviour == TOOL_MULTITOOL)
|
||||
if(l_hacking)
|
||||
to_chat(user, "<span class='danger'>This safe is already being hacked.</span>")
|
||||
return
|
||||
if(open == TRUE)
|
||||
to_chat(user, "<span class='danger'>Now attempting to reset internal memory, please hold.</span>")
|
||||
l_hacking = TRUE
|
||||
if (W.use_tool(src, user, 400))
|
||||
to_chat(user, "<span class='danger'>Internal memory reset - lock has been disengaged.</span>")
|
||||
l_set = FALSE
|
||||
l_hacking = FALSE
|
||||
else
|
||||
l_hacking = FALSE
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You must <b>unscrew</b> the service panel before you can pulse the wiring!</span>")
|
||||
|
||||
l_hacking = FALSE
|
||||
return
|
||||
|
||||
to_chat(user, "<span class='warning'>You must <b>unscrew</b> the service panel before you can pulse the wiring!</span>")
|
||||
return
|
||||
//At this point you have exhausted all the special things to do when locked
|
||||
// ... but it's still locked.
|
||||
return
|
||||
|
||||
// -> storage/attackby() what with handle insertion, etc
|
||||
return ..()
|
||||
@@ -187,3 +189,35 @@
|
||||
|
||||
/obj/item/storage/secure/safe/hos
|
||||
name = "head of security's safe"
|
||||
|
||||
/**
|
||||
* This safe is meant to be damn robust. To break in, you're supposed to get creative, or use acid or an explosion.
|
||||
*
|
||||
* This makes the safe still possible to break in for someone who is prepared and capable enough, either through
|
||||
* chemistry, botany or whatever else.
|
||||
*
|
||||
* The safe is also weak to explosions, so spending some early TC could allow an antag to blow it upen if they can
|
||||
* get access to it.
|
||||
*/
|
||||
/obj/item/storage/secure/safe/caps_spare
|
||||
name = "captain's spare ID safe"
|
||||
desc = "In case of emergency, do not break glass. All Captains and Acting Captains are provided with codes to access this safe. \
|
||||
It is made out of the same material as the station's Black Box and is designed to resist all conventional weaponry. \
|
||||
There appears to be a small amount of surface corrosion. It doesn't look like it could withstand much of an explosion."
|
||||
can_hack_open = FALSE
|
||||
armor = list(MELEE = 100, BULLET = 100, LASER = 100, ENERGY = 100, BOMB = 70, BIO = 100, RAD = 100, FIRE = 80, ACID = 70)
|
||||
max_integrity = 300
|
||||
color = "#ffdd33"
|
||||
|
||||
/obj/item/storage/secure/safe/caps_spare/Initialize()
|
||||
. = ..()
|
||||
|
||||
l_code = SSid_access.spare_id_safe_code
|
||||
l_set = TRUE
|
||||
SEND_SIGNAL(src, COMSIG_TRY_STORAGE_SET_LOCKSTATE, TRUE)
|
||||
|
||||
/obj/item/storage/secure/safe/caps_spare/PopulateContents()
|
||||
new /obj/item/card/id/advanced/gold/captains_spare(src)
|
||||
|
||||
/obj/item/storage/secure/safe/caps_spare/rust_heretic_act()
|
||||
take_damage(damage_amount = 100, damage_type = BRUTE, damage_flag = MELEE, armour_penetration = 100)
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
if("bloodyspai")
|
||||
new /obj/item/clothing/under/chameleon(src) // 2 tc since it's not the full set
|
||||
new /obj/item/clothing/mask/chameleon(src) // Goes with above
|
||||
new /obj/item/card/id/syndicate(src) // 2 tc
|
||||
new /obj/item/clothing/shoes/chameleon/noslip(src) // 2 tc
|
||||
new /obj/item/camera_bug(src) // 1 tc
|
||||
new /obj/item/multitool/ai_detect(src) // 1 tc
|
||||
@@ -79,7 +78,6 @@
|
||||
new /obj/item/storage/toolbox/syndicate(src)
|
||||
new /obj/item/camera_bug(src)
|
||||
new /obj/item/clothing/glasses/thermal/syndi(src)
|
||||
new /obj/item/card/id/syndicate(src)
|
||||
|
||||
if("lordsingulo")
|
||||
new /obj/item/sbeacondrop(src)
|
||||
@@ -87,7 +85,7 @@
|
||||
new /obj/item/clothing/head/helmet/space/syndicate/black/red(src)
|
||||
new /obj/item/card/emag(src)
|
||||
new /obj/item/storage/toolbox/syndicate(src)
|
||||
new /obj/item/card/mining_access_card(src)
|
||||
new /obj/item/card/id/advanced/mining(src)
|
||||
new /obj/item/stack/spacecash/c10000(src)
|
||||
new /obj/item/toy/spinningtoy(src) //lol
|
||||
|
||||
@@ -127,7 +125,6 @@
|
||||
new /obj/item/ammo_box/magazine/m9mm(src)
|
||||
new /obj/item/ammo_box/magazine/m9mm(src)
|
||||
new /obj/item/clothing/under/chameleon(src)
|
||||
new /obj/item/card/id/syndicate(src)
|
||||
new /obj/item/reagent_containers/hypospray/medipen/stimulants(src)
|
||||
new /obj/item/reagent_containers/glass/rag(src)
|
||||
|
||||
@@ -137,14 +134,12 @@
|
||||
for(var/i in 1 to 6)
|
||||
new /obj/item/throwing_star(src) // ~5 tc for all 6
|
||||
new /obj/item/storage/belt/chameleon(src) // Unique but worth at least 2 tc
|
||||
new /obj/item/card/id/syndicate(src) // 2 tc
|
||||
new /obj/item/chameleon(src) // 7 tc
|
||||
|
||||
if("darklord")
|
||||
new /obj/item/dualsaber(src)
|
||||
new /obj/item/dnainjector/telemut/darkbundle(src)
|
||||
new /obj/item/clothing/suit/hooded/chaplain_hoodie(src)
|
||||
new /obj/item/card/id/syndicate(src)
|
||||
new /obj/item/clothing/shoes/chameleon/noslip(src) //because slipping while being a dark lord sucks
|
||||
new /obj/item/book/granter/spell/summonitem(src)
|
||||
|
||||
@@ -259,7 +254,6 @@
|
||||
new /obj/item/clothing/suit/space/syndicate/contract(src)
|
||||
new /obj/item/clothing/under/chameleon(src)
|
||||
new /obj/item/clothing/mask/chameleon(src)
|
||||
new /obj/item/card/id/syndicate(src)
|
||||
new /obj/item/storage/fancy/cigarettes/cigpack_syndicate(src)
|
||||
new /obj/item/lighter(src)
|
||||
|
||||
|
||||
@@ -42,27 +42,52 @@
|
||||
|
||||
/obj/item/storage/wallet/Exited(atom/movable/AM)
|
||||
. = ..()
|
||||
refreshID()
|
||||
refreshID(removed = TRUE)
|
||||
|
||||
/obj/item/storage/wallet/proc/refreshID()
|
||||
/**
|
||||
* Calculates the new front ID.
|
||||
*
|
||||
* Picks the ID card that has the most combined command or higher tier accesses.
|
||||
* Arguments:
|
||||
* * removed - If this proc was called because a card was removed. There's a chance we don't need to calculate the new front ID if a card was removed.
|
||||
*/
|
||||
/obj/item/storage/wallet/proc/refreshID(removed = FALSE)
|
||||
LAZYCLEARLIST(combined_access)
|
||||
if(!(front_id in src))
|
||||
front_id = null
|
||||
for(var/obj/item/card/id/I in contents)
|
||||
if(!front_id)
|
||||
front_id = I
|
||||
|
||||
// If the front_id is still in our wallet an we removed a card, we can return early.
|
||||
if((front_id in src) && removed)
|
||||
return
|
||||
|
||||
front_id = null
|
||||
var/winning_tally = 0
|
||||
for(var/card in contents)
|
||||
var/obj/item/card/id/id_card = card
|
||||
if(!istype(id_card))
|
||||
continue
|
||||
var/card_tally = SSid_access.tally_access(id_card, ACCESS_FLAG_COMMAND)
|
||||
if(card_tally > winning_tally)
|
||||
winning_tally = card_tally
|
||||
front_id = id_card
|
||||
LAZYINITLIST(combined_access)
|
||||
combined_access |= I.access
|
||||
combined_access |= id_card.access
|
||||
|
||||
// If we didn't pick a front ID - Maybe none of our cards have any command accesses? Just grab the first card (if we even have one).
|
||||
// We could also have no ID card in the wallet at all, which will mean we end up with a null front_id and that's fine too.
|
||||
if(!front_id)
|
||||
front_id = (locate(/obj/item/card/id) in contents)
|
||||
|
||||
if(ishuman(loc))
|
||||
var/mob/living/carbon/human/H = loc
|
||||
if(H.wear_id == src)
|
||||
H.sec_hud_set_ID()
|
||||
update_appearance()
|
||||
var/mob/living/carbon/human/wearing_human = loc
|
||||
if(wearing_human.wear_id == src)
|
||||
wearing_human.sec_hud_set_ID()
|
||||
|
||||
update_label()
|
||||
update_appearance(UPDATE_ICON)
|
||||
update_slot_icon()
|
||||
|
||||
/obj/item/storage/wallet/Entered(atom/movable/AM)
|
||||
. = ..()
|
||||
refreshID()
|
||||
refreshID(removed = FALSE)
|
||||
|
||||
/obj/item/storage/wallet/update_overlays()
|
||||
. = ..()
|
||||
@@ -94,6 +119,12 @@
|
||||
if(front_id)
|
||||
. += "<span class='notice'>Alt-click to remove the id.</span>"
|
||||
|
||||
/obj/item/storage/wallet/get_id_examine_strings(mob/user)
|
||||
. = ..()
|
||||
if(front_id)
|
||||
. += "\The [src] is displaying [front_id]."
|
||||
. += front_id.get_id_examine_strings(user)
|
||||
|
||||
/obj/item/storage/wallet/GetID()
|
||||
return front_id
|
||||
|
||||
|
||||
Reference in New Issue
Block a user