Modular Cmp Updates

This commit is contained in:
Letter N
2021-02-12 18:29:00 +08:00
parent 5db87b9065
commit 5b0a1077f4
46 changed files with 1311 additions and 318 deletions
@@ -9,6 +9,7 @@
transfer_access = ACCESS_HEADS
available_on_ntnet = TRUE
tgui_id = "NtosAiRestorer"
program_icon = "laptop-code"
/// Variable dictating if we are in the process of restoring the AI in the inserted intellicard
var/restoring = FALSE
@@ -19,7 +20,7 @@
if(computer)
ai_slot = computer.all_components[MC_AI]
if(computer && ai_slot && ai_slot.check_functionality())
if(computer && ai_slot?.check_functionality())
if(cardcheck == 1)
return ai_slot
if(ai_slot.enabled && ai_slot.stored_card)
@@ -31,7 +32,8 @@
return
/datum/computer_file/program/aidiag/ui_act(action, params)
if(..())
. = ..()
if(.)
return
var/mob/living/silicon/ai/A = get_ai()
@@ -47,7 +49,7 @@
if("PRG_eject")
if(computer.all_components[MC_AI])
var/obj/item/computer_hardware/ai_slot/ai_slot = computer.all_components[MC_AI]
if(ai_slot && ai_slot.stored_card)
if(ai_slot?.stored_card)
ai_slot.try_eject(usr)
return TRUE
@@ -72,10 +74,10 @@
restoring = FALSE
return
ai_slot.locked = TRUE
A.adjustOxyLoss(-5, 0)//, FALSE)
A.adjustFireLoss(-5, 0)//, FALSE)
A.adjustToxLoss(-5, 0)
A.adjustBruteLoss(-5, 0)
A.adjustOxyLoss(-5, FALSE)
A.adjustFireLoss(-5, FALSE)
A.adjustToxLoss(-5, FALSE)
A.adjustBruteLoss(-5, FALSE)
// Please don't forget to update health, otherwise the below if statements will probably always fail.
A.updatehealth()