Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions code/__DEFINES/components.dm
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,12 @@
#define COMSIG_MACHINERY_POWER_LOST "machinery_power_lost" //from base power_change() when power is lost
#define COMSIG_MACHINERY_POWER_RESTORED "machinery_power_restored" //from base power_change() when power is restored

// /obj/machinery/power/supermatter_crystal signals
/// from /obj/machinery/power/supermatter_crystal/process_atmos(); when the SM delam reaches the point of sounding alarms
#define COMSIG_SUPERMATTER_DELAM_START_ALARM "sm_delam_start_alarm"
/// from /obj/machinery/power/supermatter_crystal/process_atmos(); when the SM sounds an audible alarm
#define COMSIG_SUPERMATTER_DELAM_ALARM "sm_delam_alarm"

// /obj/item signals
#define COMSIG_ITEM_ATTACK "item_attack" //from base of obj/item/attack(): (/mob/living/target, /mob/living/user)
#define COMSIG_ITEM_ATTACK_SELF "item_attack_self" //from base of obj/item/attack_self(): (/mob)
Expand Down
2 changes: 2 additions & 0 deletions code/__DEFINES/is_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ GLOBAL_LIST_INIT(heavyfootmob, typecacheof(list(

#define isitem(A) (istype(A, /obj/item))

#define isidcard(I) (istype(I, /obj/item/card/id))

#define isstructure(A) (istype(A, /obj/structure))

#define ismachinery(A) (istype(A, /obj/machinery))
Expand Down
8 changes: 8 additions & 0 deletions code/__DEFINES/machines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,13 @@
#define MC_HDD "HDD"
#define MC_SDD "SDD"
#define MC_CARD "CARD"
#define MC_CARD2 "CARD2"
#define MC_NET "NET"
#define MC_PRINT "PRINT"
#define MC_CELL "CELL"
#define MC_CHARGE "CHARGE"
#define MC_AI "AI"
#define MC_SENSORS "SENSORS"

//NTNet stuff, for modular computers
// NTNet module-configuration values. Do not change these. If you need to add another use larger number (5..6..7 etc)
Expand Down Expand Up @@ -71,6 +73,12 @@
#define PROGRAM_STATE_KILLED 0
#define PROGRAM_STATE_BACKGROUND 1
#define PROGRAM_STATE_ACTIVE 2
//Program categories
#define PROGRAM_CATEGORY_CREW "Crew"
#define PROGRAM_CATEGORY_ENGI "Engineering"
#define PROGRAM_CATEGORY_ROBO "Robotics"
#define PROGRAM_CATEGORY_SUPL "Supply"
#define PROGRAM_CATEGORY_MISC "Other"

#define FIREDOOR_OPEN 1
#define FIREDOOR_CLOSED 2
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/computer/card.dm
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0)
change_position_cooldown = CONFIG_GET(number/id_console_jobslot_delay)

/obj/machinery/computer/card/attackby(obj/O, mob/user, params)//TODO:SANITY
if(istype(O, /obj/item/card/id))
if(isidcard(O))
var/obj/item/card/id/idcard = O
if(!modify)
if (!user.transferItemToLoc(idcard,src))
Expand Down
8 changes: 3 additions & 5 deletions code/game/objects/items/cards_ids.dm
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,6 @@
detail_overlay.color = detail_color
add_overlay(detail_overlay)

/obj/item/proc/GetCard()

/obj/item/card/data/GetCard()
return src

/obj/item/card/data/full_color
desc = "A plastic magstripe card for simple and speedy data storage and transfer. This one has the entire card colored."
icon_state = "data_2"
Expand Down Expand Up @@ -256,6 +251,9 @@
/obj/item/card/id/GetID()
return src

/obj/item/card/id/RemoveID()
return src

/*
Usage:
update_label()
Expand Down
67 changes: 49 additions & 18 deletions code/game/objects/items/devices/PDA/PDA.dm
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,18 @@ GLOBAL_LIST_EMPTY(PDAs)
/obj/item/pda/GetID()
return id

/obj/item/pda/RemoveID()
return do_remove_id()

/obj/item/pda/InsertID(obj/item/inserting_item)
var/obj/item/card/inserting_id = inserting_item.RemoveID()
if(!inserting_id)
return
insert_id(inserting_id)
if(id == inserting_id)
return TRUE
return FALSE

/obj/item/pda/update_icon()
cut_overlays()
var/mutable_appearance/overlay = new()
Expand Down Expand Up @@ -696,16 +708,27 @@ GLOBAL_LIST_EMPTY(PDAs)

if(issilicon(usr) || !usr.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
return
do_remove_id(usr)


/obj/item/pda/proc/do_remove_id(mob/user)
if(!id)
return
if(user)
user.put_in_hands(id)
to_chat(user, "<span class='notice'>You remove the ID from the [name].</span>")
else
id.forceMove(get_turf(src))

. = id
id = null
update_icon()

if(ishuman(loc))
var/mob/living/carbon/human/H = loc
if(H.wear_id == src)
H.sec_hud_set_ID()

if (id)
usr.put_in_hands(id)
to_chat(usr, span_notice("You remove the ID from the [name]."))
id = null
update_icon()
if(ishuman(loc))
var/mob/living/carbon/human/H = loc
if(H.wear_id == src)
H.sec_hud_set_ID()

/obj/item/pda/proc/msg_input(mob/living/U = usr)
var/t = stripped_input(U, "Please enter message", name)
Expand Down Expand Up @@ -923,20 +946,28 @@ GLOBAL_LIST_EMPTY(PDAs)
if(istype(C))
I = C

if(I && I.registered_name)
if(I && I?.registered_name)
if(!user.transferItemToLoc(I, src))
return FALSE
var/obj/old_id = id
id = I
if(ishuman(loc))
var/mob/living/carbon/human/H = loc
if(H.wear_id == src)
H.sec_hud_set_ID()
if(old_id)
user.put_in_hands(old_id)
insert_id(I, user)
update_icon()
return TRUE


/obj/item/pda/proc/insert_id(obj/item/card/id/inserting_id, mob/user)
var/obj/old_id = id
id = inserting_id
if(ishuman(loc))
var/mob/living/carbon/human/human_wearer = loc
if(human_wearer.wear_id == src)
human_wearer.sec_hud_set_ID()
if(old_id)
if(user)
user.put_in_hands(old_id)
else
old_id.forceMove(get_turf(src))


// access to status display signals
/obj/item/pda/attackby(obj/item/C, mob/user, params)
if(istype(C, /obj/item/cartridge) && !cartridge)
Expand Down
15 changes: 15 additions & 0 deletions code/game/objects/items/storage/wallets.dm
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,21 @@
/obj/item/storage/wallet/GetID()
return front_id

/obj/item/storage/wallet/RemoveID()
if(!front_id)
return
. = front_id
front_id.forceMove(get_turf(src))

/obj/item/storage/wallet/InsertID(obj/item/inserting_item)
var/obj/item/card/inserting_id = inserting_item.RemoveID()
if(!inserting_id)
return FALSE
attackby(inserting_id)
if(inserting_id in contents)
return TRUE
return FALSE

/obj/item/storage/wallet/GetAccess()
if(LAZYLEN(combined_access))
return combined_access
Expand Down
6 changes: 6 additions & 0 deletions code/modules/jobs/access.dm
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@
/obj/item/proc/GetID()
return null

/obj/item/proc/RemoveID()
return null

/obj/item/proc/InsertID()
return FALSE

/// Convert a text string to a list of accesses
/obj/proc/text2access(access_text)
. = list()
Expand Down
2 changes: 1 addition & 1 deletion code/modules/jobs/job_types/atmospheric_technician.dm
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
duffelbag = /obj/item/storage/backpack/duffelbag/engineering
box = /obj/item/storage/box/engineer
pda_slot = SLOT_L_STORE
backpack_contents = list(/obj/item/modular_computer/tablet/phone/preset/advanced=1)
backpack_contents = list(/obj/item/modular_computer/tablet/phone/preset/advanced/atmos=1)

/datum/outfit/job/atmos/rig
name = "Atmospheric Technician (Hardsuit)"
Expand Down
2 changes: 1 addition & 1 deletion code/modules/jobs/job_types/chief_engineer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
alt_shoes = /obj/item/clothing/shoes/xeno_wraps/command // Provides Command shoes to digitigrade species
head = /obj/item/clothing/head/hardhat/white
gloves = /obj/item/clothing/gloves/color/black/ce
backpack_contents = list(/obj/item/melee/classic_baton/telescopic=1, /obj/item/modular_computer/tablet/preset/advanced=1) //yogs - removes eng budget
backpack_contents = list(/obj/item/melee/classic_baton/telescopic=1, /obj/item/modular_computer/tablet/phone/preset/advanced/command=1) //yogs - removes eng budget
glasses = /obj/item/clothing/glasses/meson/sunglasses

backpack = /obj/item/storage/backpack/industrial
Expand Down
2 changes: 1 addition & 1 deletion code/modules/jobs/job_types/chief_medical_officer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
l_hand = /obj/item/storage/firstaid/medical
suit_store = /obj/item/flashlight/pen/paramedic
glasses = /obj/item/clothing/glasses/hud/health/sunglasses
backpack_contents = list(/obj/item/melee/classic_baton/telescopic=1, /obj/item/modular_computer/tablet/preset/advanced=1) //yogs - removes med budget
backpack_contents = list(/obj/item/melee/classic_baton/telescopic=1, /obj/item/modular_computer/tablet/phone/preset/advanced/command=1) //yogs - removes med budget

backpack = /obj/item/storage/backpack/medic
satchel = /obj/item/storage/backpack/satchel/med
Expand Down
2 changes: 1 addition & 1 deletion code/modules/jobs/job_types/head_of_personnel.dm
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@
shoes = /obj/item/clothing/shoes/sneakers/brown
head = /obj/item/clothing/head/hopcap
backpack_contents = list(/obj/item/storage/box/ids=1,\
/obj/item/melee/classic_baton/telescopic=1, /obj/item/modular_computer/tablet/preset/advanced=1) //yogs - removes serv budget
/obj/item/melee/classic_baton/telescopic=1, /obj/item/modular_computer/tablet/phone/preset/advanced/command=1) //yogs - removes serv budget

chameleon_extras = list(/obj/item/gun/energy/e_gun, /obj/item/stamp/hop)
2 changes: 1 addition & 1 deletion code/modules/jobs/job_types/head_of_security.dm
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
suit_store = /obj/item/gun/energy/e_gun
r_pocket = /obj/item/assembly/flash/handheld
l_pocket = /obj/item/restraints/handcuffs
backpack_contents = list(/obj/item/melee/baton/loaded=1, /obj/item/modular_computer/tablet/preset/advanced=1) //yogs - removed departmental budget ID //come here often?
backpack_contents = list(/obj/item/melee/baton/loaded=1, /obj/item/modular_computer/tablet/phone/preset/advanced/command=1) //yogs - removed departmental budget ID //come here often?

backpack = /obj/item/storage/backpack/security
satchel = /obj/item/storage/backpack/satchel/sec
Expand Down
2 changes: 1 addition & 1 deletion code/modules/jobs/job_types/research_director.dm
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
suit = /obj/item/clothing/suit/toggle/labcoat
l_hand = /obj/item/clipboard
l_pocket = /obj/item/laser_pointer
backpack_contents = list(/obj/item/melee/classic_baton/telescopic=1, /obj/item/modular_computer/tablet/preset/advanced=1) //yogs - removes sci budget
backpack_contents = list(/obj/item/melee/classic_baton/telescopic=1, /obj/item/modular_computer/tablet/phone/preset/advanced/command=1) //yogs - removes sci budget

backpack = /obj/item/storage/backpack/science
satchel = /obj/item/storage/backpack/satchel/tox
Expand Down
16 changes: 9 additions & 7 deletions code/modules/mob/living/carbon/human/human_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,8 @@
. = pda.owner
else if(istype(tablet))
var/obj/item/computer_hardware/card_slot/card_slot = tablet.all_components[MC_CARD]
if(card_slot && (card_slot.stored_card2 || card_slot.stored_card))
if(card_slot.stored_card2) //The second card is the one used for authorization in the ID changing program, so we prioritize it here for consistency
. = card_slot.stored_card2.registered_name
else
if(card_slot.stored_card)
. = card_slot.stored_card.registered_name
if(card_slot?.stored_card)
. = card_slot.stored_card.registered_name
if(!.)
. = if_no_id //to prevent null-names making the mob unclickable
return
Expand Down Expand Up @@ -114,6 +110,12 @@
if(id_card)
return id_card

/mob/living/carbon/human/get_id_in_hand()
var/obj/item/held_item = get_active_held_item()
if(!held_item)
return
return held_item.GetID()

/mob/living/carbon/human/IsAdvancedToolUser()
if(HAS_TRAIT(src, TRAIT_MONKEYLIKE))
return FALSE
Expand Down Expand Up @@ -272,4 +274,4 @@
WRITE_FILE(F["current_scar_index"], sanitize_integer(scar_index))

/mob/living/carbon/human/get_biological_state()
return dna.species.get_biological_state()
return dna.species.get_biological_state()
3 changes: 3 additions & 0 deletions code/modules/mob/mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1174,6 +1174,9 @@
/mob/proc/get_idcard(hand_first)
return

/mob/proc/get_id_in_hand()
return

/**
* Get the mob VV dropdown extras
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,20 @@
. += "It has a slot installed for an intelliCard."

var/obj/item/computer_hardware/card_slot/card_slot = get_modular_computer_part(MC_CARD)
var/obj/item/computer_hardware/card_slot/card_slot2 = get_modular_computer_part(MC_CARD2)
var/multiple_slots = istype(card_slot) && istype(card_slot2)
if(card_slot)
if(card_slot.stored_card || card_slot.stored_card2)
if(card_slot.stored_card || card_slot2.stored_card)
var/obj/item/card/id/first_ID = card_slot.stored_card
var/obj/item/card/id/second_ID = card_slot.stored_card2
var/obj/item/card/id/second_ID = card_slot2.stored_card
var/multiple_cards = istype(first_ID) && istype(second_ID)
if(user_is_adjacent)
. += "It has two slots for identification cards installed[multiple_cards ? " which contain [first_ID] and [second_ID]" : ", one of which contains [first_ID ? first_ID : second_ID]"]."
. += "It has [multiple_slots ? "two slots" : "a slot"] for identification cards installed[multiple_cards ? " which contain [first_ID] and [second_ID]" : ", one of which contains [first_ID ? first_ID : second_ID]"]."
else
. += "It has two slots for identification cards installed, [multiple_cards ? "both of which appear" : "and one of them appears"] to be occupied."
. += "It has [multiple_slots ? "two slots" : "a slot"] for identification cards installed, [multiple_cards ? "both of which appear" : "and one of them appears"] to be occupied."
. += span_info("Alt-click [src] to eject the identification card[multiple_cards ? "s":""].")
else
. += "It has two slots installed for identification cards."
. += "It has [multiple_slots ? "two slots" : "a slot"] installed for identification cards."

var/obj/item/computer_hardware/printer/printer_slot = get_modular_computer_part(MC_PRINT)
if(printer_slot)
Expand Down
Loading