Makes modular computer examine text more robust (#40729)

This commit is contained in:
ShizCalev
2018-10-08 04:39:08 -04:00
committed by AnturK
parent 2a933c34d1
commit fc6cc11ff4
8 changed files with 97 additions and 14 deletions

View File

@@ -9,6 +9,10 @@
var/obj/item/aicard/stored_card = null
var/locked = FALSE
/obj/item/computer_hardware/ai_slot/handle_atom_del(atom/A)
if(A == stored_card)
try_eject(0, null, TRUE)
. = ..()
/obj/item/computer_hardware/ai_slot/examine(mob/user)
..()
@@ -50,12 +54,14 @@
return FALSE
if(stored_card)
stored_card.forceMove(get_turf(src))
to_chat(user, "<span class='notice'>You remove [stored_card] from [src].</span>")
locked = FALSE
stored_card.verb_pickup()
if(user)
user.put_in_hands(stored_card)
else
stored_card.forceMove(drop_location())
stored_card = null
to_chat(user, "<span class='notice'>You remove the card from \the [src].</span>")
return TRUE
return FALSE

View File

@@ -12,6 +12,11 @@
battery = new battery_type(src)
..()
/obj/item/computer_hardware/battery/handle_atom_del(atom/A)
if(A == battery)
try_eject(0, null, TRUE)
. = ..()
/obj/item/computer_hardware/battery/try_insert(obj/item/I, mob/living/user = null)
if(!holder)
return FALSE
@@ -41,7 +46,10 @@
to_chat(user, "<span class='warning'>There is no power cell connected to \the [src].</span>")
return FALSE
else
battery.forceMove(get_turf(src))
if(user)
user.put_in_hands(battery)
else
battery.forceMove(drop_location())
to_chat(user, "<span class='notice'>You detach \the [battery] from \the [src].</span>")
battery = null

View File

@@ -9,6 +9,13 @@
var/obj/item/card/id/stored_card = null
var/obj/item/card/id/stored_card2 = null
/obj/item/computer_hardware/card_slot/handle_atom_del(atom/A)
if(A == stored_card)
try_eject(1, null, TRUE)
if(A == stored_card2)
try_eject(2, null, TRUE)
. = ..()
/obj/item/computer_hardware/card_slot/Destroy()
try_eject()
return ..()
@@ -71,7 +78,7 @@
if(user)
user.put_in_hands(stored_card)
else
stored_card.forceMove(get_turf(src))
stored_card.forceMove(drop_location())
stored_card = null
ejected++
@@ -79,7 +86,7 @@
if(user)
user.put_in_hands(stored_card2)
else
stored_card2.forceMove(get_turf(src))
stored_card2.forceMove(drop_location())
stored_card2 = null
ejected++