Files
Aurora.3/code/modules/modular_computers/computers/modular_computer/interaction.dm
Alberyk 76b743a986 Adds the Aut'akh unathi (#5919)
* Base work for the unathi robot subspecies.

* Adds metabolism species, kidney vars, and the robot unathi organs.

* Moves some action buttons to organs, pretty much a bay port right now. Todo: the unathi and alien stuff should also go here.

* First autakh implant power.

* Fixes the organs action button this time.

* Finishes more implants, and interactions with flashs and vaurca.

* Prepare for great changes.

* Drops the real bomb, boss.

* He who fights with monsters.

* Far more work into augments and limb removing powers.

* Limb verbs should be good now.

* A LOT of work into the assited organ, allowing it to bleed and etc, as well adding a new chem that will stop bleeding in their case.

* Probably the last work on implants.

* Some extra touches.

* Some tweaks to the species.

* More fixes and adds kyre's sprites.

* More runtime fixes.

* Fixes the species name too.

* Fixes travis.

* Updates this file too to work with the new tools procs.

* Adds changelog

* Fixed changelog.

* Unathi hair and lore description.

* Some tweaks to this too.

* Locks away them for now, they will be released after we got all the events and etc done.

* Changes this chemical.

* Fixes an airlock runtime.

* Adds the non scan flag to the autakh, mostly due to some bizzare interactions with changelings and cloning.

* Organs removal changes; can't take out the organ if it is too damage.

* Restricts them back again.

* Robotic organs now have the proper icons and names.

* Adds sprites for their organs and some extra tweaks.

* Fixes this missing icon.

* emp should also now hurt assited organs.

* Tweaks more organ related things.

* Fixes the head not being properly set as well.

* Fixes their flags.

* fixes the flag for real this time.

* Poze's review.

* Changes the au'takh organ buttons to don't be animated.

* Helps with adminbus or something.

* Fowl's requested changes.

* Fixes a typo.

* Robotic limb's brute and burn mods are now controlled by the limb model.

* Fowl's changes once more.

* Stops some spam.

* More grammar.

* No eal.

* Skull's review.
2019-01-23 19:27:44 +01:00

213 lines
5.8 KiB
Plaintext

// Eject ID card from computer, if it has ID slot with card inside.
/obj/item/modular_computer/verb/eject_id()
set name = "Eject ID"
set category = "Object"
set src in view(1)
if(usr.incapacitated() || !istype(usr, /mob/living))
to_chat(usr, "<span class='warning'>You can't do that.</span>")
return
if(!Adjacent(usr))
to_chat(usr, "<span class='warning'>You can't reach it.</span>")
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(usr.incapacitated() || !istype(usr, /mob/living))
to_chat(usr, "<span class='warning'>You can't do that.</span>")
return
if(!Adjacent(usr))
to_chat(usr, "<span class='warning'>You can't reach it.</span>")
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(usr.incapacitated() || !istype(usr, /mob/living))
to_chat(usr, "<span class='warning'>You can't do that.</span>")
return
if(!Adjacent(usr))
to_chat(usr, "<span class='warning'>You can't reach it.</span>")
return
proc_eject_ai(usr)
/obj/item/modular_computer/proc/proc_eject_id(mob/user)
if(!user)
user = usr
if(!card_slot)
to_chat(user, "\The [src] does not have an ID card slot")
return
if(!card_slot.stored_card)
to_chat(user, "There is no card in \the [src]")
return
if(active_program)
active_program.event_idremoved(0)
for(var/datum/computer_file/program/P in idle_threads)
P.event_idremoved(1)
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
update_uis()
to_chat(user, "You remove the card from \the [src]")
/obj/item/modular_computer/proc/proc_eject_usb(mob/user)
if(!user)
user = usr
if(!portable_drive)
to_chat(user, "There is no portable device connected to \the [src].")
return
uninstall_component(user, portable_drive)
update_uis()
/obj/item/modular_computer/proc/proc_eject_ai(mob/user)
if(!user)
user = usr
if(!ai_slot || !ai_slot.stored_card)
to_chat(user, "There is no intellicard connected to \the [src].")
return
if(ishuman(user))
user.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()
update_uis()
/obj/item/modular_computer/attack_ghost(var/mob/abstract/observer/user)
if(enabled)
ui_interact(user)
else if(check_rights(R_ADMIN, 0, user))
var/response = alert(user, "This computer is turned off. Would you like to turn it on?", "Admin Override", "Yes", "No")
if(response == "Yes")
turn_on(user)
/obj/item/modular_computer/attack_hand(var/mob/user)
if(anchored)
return attack_self(user)
return ..()
/obj/item/modular_computer/attack_ai(var/mob/user)
if(anchored)
return attack_self(user)
return ..()
// On-click handling. Turns on the computer if it's off and opens the GUI.
/obj/item/modular_computer/attack_self(mob/user)
if(enabled && screen_on)
ui_interact(user)
else if(!enabled && screen_on)
turn_on(user)
/obj/item/modular_computer/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
if(istype(W, /obj/item/weapon/card/id)) // ID Card, try to insert it.
var/obj/item/weapon/card/id/I = W
if(!card_slot)
to_chat(user, "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, "You try to insert \the [I] into \the [src], but it's ID card slot is occupied.")
return
user.drop_from_inventory(I,src)
card_slot.stored_card = I
update_uis()
to_chat(user, "You insert \the [I] into \the [src].")
return
if(istype(W, /obj/item/weapon/paper))
if(!nano_printer)
return
nano_printer.attackby(W, user)
if(istype(W, /obj/item/weapon/aicard))
if(!ai_slot)
return
ai_slot.attackby(W, user)
if(istype(W, /obj/item/weapon/computer_hardware))
var/obj/item/weapon/computer_hardware/C = W
if(C.hardware_size <= max_hardware_size)
try_install_component(user, C)
else
to_chat(user, "This component is too large for \the [src].")
if(W.iswrench())
var/list/components = get_all_components()
if(components.len)
to_chat(user, "Remove all components from \the [src] before disassembling it.")
return
to_chat(user, span("notice", "You begin to disassemble \the [src]."))
playsound(user, 'sound/items/Ratchet.ogg', 100, 1)
if (do_after(user, 20))
new /obj/item/stack/material/steel(get_turf(src.loc), steel_sheet_cost)
src.visible_message("\The [user] disassembles \the [src].",
"You disassemble \the [src].",
"You hear a ratchet.")
qdel(src)
return
if(W.iswelder())
var/obj/item/weapon/weldingtool/WT = W
if(!WT.isOn())
to_chat(user, "\The [W] is off.")
return
if(!damage)
to_chat(user, "\The [src] does not require repairs.")
return
to_chat(user, "You begin repairing damage to \the [src]...")
playsound(src, 'sound/items/Welder.ogg', 100, 1)
if(WT.remove_fuel(round(damage/75)) && do_after(usr, damage/10))
damage = 0
to_chat(user, "You repair \the [src].")
return
if(W.isscrewdriver())
var/list/all_components = get_all_components()
if(!all_components.len)
to_chat(user, "This device doesn't have any components installed.")
return
var/list/component_names = list()
for(var/obj/item/weapon/computer_hardware/H in all_components)
component_names.Add(H.name)
var/choice = input(usr, "Which component do you want to uninstall?", "Computer maintenance", null) as null|anything in component_names
if(!choice)
return
if(!Adjacent(usr))
return
var/obj/item/weapon/computer_hardware/H = find_hardware_by_name(choice)
if(!H)
return
uninstall_component(user, H)
return
..()