mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-19 03:49:10 +01:00
Modular PDAs: The End of an Era (#10319)
PDAs are dead, long live PDAs. All trace of old PDAs has been scoured from the codebase, and in its place are modular computer PDAs that are feature-equivalent. Essentially every PDA function except the Syndicate detonation feature and Notepad has been ported over, and battery life for handheld computers has been boosted alongside the addition of charging cables to make things easier.
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
// Eject ID card from computer, if it has ID slot with card inside.
|
||||
/obj/item/modular_computer/verb/eject_id()
|
||||
/obj/item/modular_computer/proc/eject_id()
|
||||
set name = "Eject ID"
|
||||
set category = "Object"
|
||||
set src in view(1)
|
||||
@@ -7,49 +6,12 @@
|
||||
if(use_check_and_message(usr))
|
||||
return
|
||||
|
||||
proc_eject_id(usr)
|
||||
|
||||
// Eject ID card from computer, if it has ID slot with card inside.
|
||||
/obj/item/modular_computer/verb/eject_usb()
|
||||
set name = "Eject Portable Storage"
|
||||
set category = "Object"
|
||||
set src in view(1)
|
||||
|
||||
if(use_check_and_message(usr))
|
||||
return
|
||||
|
||||
proc_eject_usb(usr)
|
||||
|
||||
/obj/item/modular_computer/verb/eject_ai()
|
||||
set name = "Eject AI Storage"
|
||||
set category = "Object"
|
||||
set src in view(1)
|
||||
|
||||
if(use_check_and_message(usr))
|
||||
return
|
||||
|
||||
proc_eject_ai(usr)
|
||||
|
||||
/obj/item/modular_computer/verb/eject_personal_ai()
|
||||
set name = "Eject Personal AI"
|
||||
set category = "Object"
|
||||
set src in view(1)
|
||||
|
||||
if(use_check_and_message(usr))
|
||||
return
|
||||
|
||||
proc_eject_personal_ai(usr)
|
||||
|
||||
/obj/item/modular_computer/proc/proc_eject_id(mob/user)
|
||||
if(!user)
|
||||
user = usr
|
||||
|
||||
if(!card_slot)
|
||||
to_chat(user, SPAN_WARNING("\The [src] does not have an ID card slot."))
|
||||
to_chat(usr, SPAN_WARNING("\The [src] does not have an ID card slot."))
|
||||
return
|
||||
|
||||
if(!card_slot.stored_card)
|
||||
to_chat(user, SPAN_WARNING("There is no card in \the [src]."))
|
||||
to_chat(usr, SPAN_WARNING("There is no card in \the [src]."))
|
||||
return
|
||||
|
||||
if(active_program)
|
||||
@@ -57,57 +19,155 @@
|
||||
|
||||
for(var/datum/computer_file/program/P in idle_threads)
|
||||
P.event_idremoved(TRUE)
|
||||
if(ishuman(user))
|
||||
user.put_in_hands(card_slot.stored_card)
|
||||
else
|
||||
card_slot.stored_card.forceMove(get_turf(src))
|
||||
card_slot.stored_card = null
|
||||
|
||||
card_slot.eject_id(usr)
|
||||
|
||||
update_uis()
|
||||
to_chat(user, SPAN_NOTICE("You remove the card from \the [src]."))
|
||||
to_chat(usr, SPAN_NOTICE("You remove the card from \the [src]."))
|
||||
|
||||
|
||||
/obj/item/modular_computer/proc/proc_eject_usb(mob/user)
|
||||
if(!user)
|
||||
user = usr
|
||||
/obj/item/modular_computer/proc/eject_usb()
|
||||
set name = "Eject Portable Storage"
|
||||
set category = "Object"
|
||||
set src in view(1)
|
||||
|
||||
if(!portable_drive)
|
||||
to_chat(user, SPAN_WARNING("There is no portable drive connected to \the [src]."))
|
||||
if(use_check_and_message(usr))
|
||||
return
|
||||
|
||||
uninstall_component(user, portable_drive, put_in_hands = TRUE)
|
||||
if(!portable_drive)
|
||||
to_chat(usr, SPAN_WARNING("There is no portable drive connected to \the [src]."))
|
||||
return
|
||||
|
||||
uninstall_component(usr, portable_drive, put_in_hands = TRUE)
|
||||
verbs -= /obj/item/modular_computer/proc/eject_usb
|
||||
update_uis()
|
||||
|
||||
/obj/item/modular_computer/proc/proc_eject_ai(mob/user)
|
||||
if(!user)
|
||||
user = usr
|
||||
/obj/item/modular_computer/proc/eject_item()
|
||||
set name = "Eject Stored Item"
|
||||
set category = "Object"
|
||||
set src in view(1)
|
||||
|
||||
if(use_check_and_message(usr))
|
||||
return
|
||||
|
||||
if(!card_slot)
|
||||
to_chat(usr, SPAN_WARNING("\The [src] does not have an ID card slot."))
|
||||
return
|
||||
|
||||
if(!card_slot.stored_item)
|
||||
to_chat(usr, SPAN_WARNING("There is no item stored in \the [src]."))
|
||||
return
|
||||
|
||||
var/I = card_slot.stored_item.name
|
||||
|
||||
if(ishuman(usr))
|
||||
usr.put_in_hands(card_slot.stored_item)
|
||||
else
|
||||
card_slot.stored_item.forceMove(get_turf(src))
|
||||
|
||||
card_slot.stored_item = null
|
||||
update_uis()
|
||||
verbs -= /obj/item/modular_computer/proc/eject_item
|
||||
to_chat(usr, SPAN_NOTICE("You remove \the [I] from \the [src]."))
|
||||
|
||||
/obj/item/modular_computer/proc/eject_battery(mob/usr = usr)
|
||||
set name = "Eject Battery"
|
||||
set category = "Object"
|
||||
set src in view(1)
|
||||
|
||||
if(use_check_and_message(usr))
|
||||
return
|
||||
|
||||
if(!battery_module)
|
||||
to_chat(usr, SPAN_WARNING("\The [src] doesn't have a battery installed."))
|
||||
return
|
||||
|
||||
if(!battery_module.hotswappable)
|
||||
to_chat(usr, SPAN_WARNING("\The [src]'s battery isn't removable without tools!"))
|
||||
return
|
||||
|
||||
uninstall_component(usr, battery_module, put_in_hands = TRUE)
|
||||
verbs -= /obj/item/modular_computer/proc/eject_battery
|
||||
update_uis()
|
||||
|
||||
/obj/item/modular_computer/proc/eject_ai()
|
||||
set name = "Eject AI Storage"
|
||||
set category = "Object"
|
||||
set src in view(1)
|
||||
|
||||
if(use_check_and_message(usr))
|
||||
return
|
||||
|
||||
if(!ai_slot)
|
||||
to_chat(user, SPAN_WARNING("\The [src] doesn't have an intellicard slot."))
|
||||
to_chat(usr, SPAN_WARNING("\The [src] doesn't have an intellicard slot."))
|
||||
return
|
||||
|
||||
if(!ai_slot.stored_card)
|
||||
to_chat(user, SPAN_WARNING("There is no intellicard connected to \the [src]."))
|
||||
to_chat(usr, SPAN_WARNING("There is no intellicard connected to \the [src]."))
|
||||
return
|
||||
|
||||
if(ishuman(user))
|
||||
user.put_in_hands(ai_slot.stored_card)
|
||||
if(ishuman(usr))
|
||||
usr.put_in_hands(ai_slot.stored_card)
|
||||
else
|
||||
ai_slot.stored_card.forceMove(get_turf(src))
|
||||
ai_slot.stored_card = null
|
||||
ai_slot.update_power_usage()
|
||||
verbs -= /obj/item/modular_computer/proc/eject_ai
|
||||
update_uis()
|
||||
|
||||
/obj/item/modular_computer/proc/proc_eject_personal_ai(mob/user)
|
||||
if(!personal_ai)
|
||||
to_chat(user, SPAN_WARNING("There is no personal AI connected to \the [src]."))
|
||||
/obj/item/modular_computer/proc/eject_personal_ai()
|
||||
set name = "Eject Personal AI"
|
||||
set category = "Object"
|
||||
set src in view(1)
|
||||
|
||||
if(use_check_and_message(usr))
|
||||
return
|
||||
|
||||
personal_ai.pai.verbs -= /mob/living/silicon/pai/proc/personal_computer_interact
|
||||
personal_ai.pai.parent_computer = null
|
||||
to_chat(personal_ai.pai, SPAN_NOTICE("You lose access to \the [src]'s computronics."))
|
||||
uninstall_component(user, personal_ai, put_in_hands = TRUE)
|
||||
if(!personal_ai)
|
||||
to_chat(usr, SPAN_WARNING("There is no personal AI connected to \the [src]."))
|
||||
return
|
||||
|
||||
uninstall_component(usr, personal_ai, put_in_hands = TRUE)
|
||||
verbs -= /obj/item/modular_computer/proc/eject_personal_ai
|
||||
update_uis()
|
||||
|
||||
/obj/item/modular_computer/AltClick(var/mob/user)
|
||||
if(use_check_and_message(user, 32))
|
||||
return
|
||||
|
||||
if(!card_slot)
|
||||
to_chat(user, SPAN_WARNING("\The [src] does not have an ID card slot."))
|
||||
return
|
||||
|
||||
if(card_slot.stored_card)
|
||||
eject_id()
|
||||
else if(card_slot.stored_item)
|
||||
eject_item()
|
||||
else
|
||||
to_chat(user, SPAN_WARNING("\The [src] does not have a card or item stored in the card slot."))
|
||||
|
||||
/obj/item/modular_computer/attack(mob/living/M, mob/living/user)
|
||||
if(scan_mode == SCANNER_MEDICAL)
|
||||
health_scan_mob(M, user, TRUE)
|
||||
|
||||
/obj/item/modular_computer/afterattack(atom/A, mob/user, proximity_flag, click_parameters)
|
||||
. = ..()
|
||||
if(!proximity_flag)
|
||||
return
|
||||
if(scan_mode == SCANNER_REAGENT)
|
||||
if(!isobj(A) || isnull(A.reagents))
|
||||
return
|
||||
if(A.reagents.reagent_list.len)
|
||||
var/reagents_length = A.reagents.reagent_list.len
|
||||
to_chat(user, SPAN_NOTICE("[reagents_length] chemical agent[reagents_length > 1 ? "s" : ""] found."))
|
||||
for(var/re in A.reagents.reagent_list)
|
||||
to_chat(user, SPAN_NOTICE(" [re]"))
|
||||
else
|
||||
to_chat(user, SPAN_NOTICE("No active chemical agents found in [A]."))
|
||||
|
||||
else if(scan_mode == SCANNER_GAS)
|
||||
analyze_gases(A, user)
|
||||
|
||||
/obj/item/modular_computer/attack_ghost(var/mob/abstract/observer/user)
|
||||
if(enabled)
|
||||
ui_interact(user)
|
||||
@@ -152,15 +212,29 @@
|
||||
if(!card_slot)
|
||||
to_chat(user, SPAN_WARNING("You try to insert \the [I] into \the [src], but it does not have an ID card slot installed."))
|
||||
return
|
||||
if(card_slot.stored_card)
|
||||
to_chat(user, SPAN_WARNING("You try to insert \the [I] into \the [src], but its ID card slot is occupied."))
|
||||
return
|
||||
|
||||
user.drop_from_inventory(I, src)
|
||||
card_slot.stored_card = I
|
||||
if(card_slot.stored_card)
|
||||
eject_id()
|
||||
|
||||
card_slot.insert_id(I)
|
||||
update_uis()
|
||||
to_chat(user, SPAN_NOTICE("You insert \the [I] into \the [src]."))
|
||||
return
|
||||
if(is_type_in_list(W, card_slot?.allowed_items))
|
||||
if(!card_slot)
|
||||
to_chat(user, SPAN_WARNING("You try to insert \the [W] into \the [src], but it does not have an ID card slot installed."))
|
||||
return
|
||||
if(card_slot.stored_item)
|
||||
to_chat(user, SPAN_WARNING("You try to insert \the [W] into \the [src], but its storage slot is occupied."))
|
||||
return
|
||||
|
||||
user.drop_from_inventory(W, src)
|
||||
card_slot.stored_item = W
|
||||
update_uis()
|
||||
verbs += /obj/item/modular_computer/proc/eject_item
|
||||
to_chat(user, SPAN_NOTICE("You insert \the [W] into \the [src]."))
|
||||
return
|
||||
if(istype(W, /obj/item/paper))
|
||||
if(!nano_printer)
|
||||
return
|
||||
@@ -230,6 +304,8 @@
|
||||
var/mob/M = usr
|
||||
if(use_check_and_message(M))
|
||||
return
|
||||
if(istype(over_object, /obj/machinery/power/apc) && tesla_link)
|
||||
return over_object.attackby(src, M)
|
||||
if(!istype(over_object, /obj/screen) && !(over_object == src))
|
||||
return attack_self(M)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user