Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: add IPC computer screen sharing and ability to use flash drives #723

Merged
merged 4 commits into from
Feb 12, 2024
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
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/human/examine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
msg += "<span class='warning'>[T.His] face is horribly mangled!</span>\n"
if(species.species_flags & SPECIES_ALL_ROBOPARTS)
var/datum/robolimb/robohead = all_robolimbs[E.model]
if(length(robohead.display_text) && f_style == "Text")
if(length(robohead.display_text) && (f_style == "Text" || f_style == "Database"))
msg += "Отображает на экране: [robohead.display_text]\n"

//splints
Expand Down
5 changes: 5 additions & 0 deletions code/modules/mob/living/carbon/human/human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,11 @@ GLOBAL_LIST_EMPTY(compatable_genomes_owners)
if(I)
src.examinate(I)
return TOPIC_HANDLED
if(href_list["showipcscreen"])
var/obj/item/modular_computer/ecs/S = locate(href_list["showipcscreen"])
if(S)
S.ui_interact(src)
return STATUS_UPDATE
return ..()

/mob/living/carbon/human/CanUseTopic(mob/user, datum/topic_state/state, href_list)
Expand Down
10 changes: 10 additions & 0 deletions code/modules/modular_computers/hardware/portable_hard_drive.dm
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,13 @@
/obj/item/stock_parts/computer/hard_drive/portable/merchant/Initialize()
. = ..()
store_file(new/datum/computer_file/program/merchant(src))

/obj/item/stock_parts/computer/hard_drive/portable/attack(var/mob/living/carbon/human/H, var/mob/living/user, target_zone, animate = TRUE)
if(H.is_species(SPECIES_IPC) && ishuman(user) && (user.zone_sel.selecting == BP_MOUTH || user.zone_sel.selecting == BP_HEAD))
var/obj/item/organ/internal/ecs/T = H.internal_organs_by_name[BP_EXONET]
if (do_after(user, 10, src))
user.visible_message( \
"<span class='notice'>\The [user] install's [src] into [H]'s exonet port.</span>", \
"<span class='notice'>You have installed [src] into [H]'s exonet port.</span>" \
)
T.computer.try_install_component(user, src)
11 changes: 8 additions & 3 deletions code/modules/nano/interaction/default.dm
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,12 @@ GLOBAL_DATUM_INIT(default_state, /datum/topic_state/default, new)
. = min(., shared_living_nano_distance(src_object))
if(. == STATUS_UPDATE && (psi && !psi.suppressed && psi.get_rank(PSI_PSYCHOKINESIS) >= PSI_RANK_OPERANT))
return STATUS_INTERACTIVE
if(is_species(SPECIES_IPC))
var/obj/item/modular_computer/ecs/computer = src_object
if(computer.type == /obj/item/modular_computer/ecs)
var/dist = get_dist(src_object, src)
var/obj/item/modular_computer/ecs/computer = src_object
if(computer.type == /obj/item/modular_computer/ecs)
if(is_species(SPECIES_IPC) && dist == 0)
return STATUS_INTERACTIVE
else if (dist <= 3)
return STATUS_UPDATE
else
return STATUS_CLOSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/datum/species/machine
inherent_verbs = list(/mob/living/carbon/human/proc/detach_limb, /mob/living/carbon/human/proc/attach_limb, /mob/living/carbon/human/proc/IPC_change_screen, /mob/living/carbon/human/proc/IPC_display_text, /mob/living/carbon/human/proc/IPC_toggle_off_screen, /mob/living/carbon/human/proc/enter_exonet)
inherent_verbs = list(/mob/living/carbon/human/proc/detach_limb, /mob/living/carbon/human/proc/attach_limb, /mob/living/carbon/human/proc/IPC_toggle_off_screen, /mob/living/carbon/human/proc/enter_exonet)

/mob/living/carbon/human/proc/detach_limb()
set category = "Abilities"
Expand Down Expand Up @@ -189,3 +189,59 @@
return
else
enter.exonet(src)
update_ipc_verbs()

/mob/living/carbon/human/proc/show_exonet_screen()
set category = "Abilities"
set name = "Show Exonet Screen"
set desc = ""
var/obj/item/organ/external/head/R = src.get_organ(BP_HEAD)
var/obj/item/organ/internal/ecs/enter = src.internal_organs_by_name[BP_EXONET]
var/datum/robolimb/robohead = all_robolimbs[R.model]

if(R.is_stump() || R.is_broken() || !R)
return

if(!enter)
to_chat(usr, "<span class='warning'>You have no exonet connection port</span>")
return
if(robohead.is_monitor)
var/obj/item/I = enter.computer
I.showscreen(src)
f_style = "Database"
update_hair()
else
to_chat(usr, "<span class='warning'>Your head has no screen!</span>")

/obj/item/proc/showscreen(mob/user)
for (var/mob/M in view(user))
M.show_message("[user] changes image on his screen. <a HREF=?src=\ref[M];showipcscreen=\ref[src]>Take a closer look.</a>",1)


/mob/living/carbon/human/proc/update_ipc_verbs()
var/obj/item/organ/external/head/R = src.get_organ(BP_HEAD)
var/datum/robolimb/robohead = all_robolimbs[R.model]
var/obj/item/organ/internal/ecs/enter = src.internal_organs_by_name[BP_EXONET]
if(enter.computer.portable_drive)
src.verbs |= /mob/living/carbon/human/proc/ipc_eject_usb
else
src.verbs -= /mob/living/carbon/human/proc/ipc_eject_usb

if(robohead.is_monitor)
src.verbs |= /mob/living/carbon/human/proc/show_exonet_screen
src.verbs |= /mob/living/carbon/human/proc/IPC_change_screen
src.verbs |= /mob/living/carbon/human/proc/IPC_display_text
else
src.verbs -= /mob/living/carbon/human/proc/show_exonet_screen
src.verbs -= /mob/living/carbon/human/proc/IPC_change_screen
src.verbs -= /mob/living/carbon/human/proc/IPC_display_text



/mob/living/carbon/human/proc/ipc_eject_usb()
set category = "Abilities"
set name = "Eject Data Crystal"
set desc = ""
var/obj/item/organ/internal/ecs/enter = src.internal_organs_by_name[BP_EXONET]
enter.computer.uninstall_component(usr, enter.computer.portable_drive)
update_ipc_verbs()
Loading