More pAI Stuff (#10647)

This commit is contained in:
Geeves
2021-01-16 12:56:24 +01:00
committed by GitHub
parent 01a0b1bac2
commit bb18e617b3
13 changed files with 79 additions and 17 deletions
+9 -1
View File
@@ -45,9 +45,10 @@
pai.death(0)
return ..()
/obj/item/device/paicard/attackby(obj/item/C as obj, mob/user as mob)
/obj/item/device/paicard/attackby(obj/item/C, mob/user)
if(istype(C, /obj/item/card/id))
scan_ID(C, user)
return
else if(istype(C, /obj/item/device/encryptionkey))
if(length(installed_encryptionkeys) > 2)
to_chat(user, SPAN_WARNING("\The [src] already has the full number of possible encryption keys installed!"))
@@ -67,6 +68,7 @@
to_chat(pai, SPAN_NOTICE("You now have access to these radio channels: [english_list(radio.channels)]."))
else
to_chat(user, SPAN_WARNING("\The [src] would not gain any new channels from \the [EK]."))
return
else if(C.isscrewdriver())
if(!length(installed_encryptionkeys))
to_chat(user, SPAN_WARNING("There are no installed encryption keys to remove!"))
@@ -77,6 +79,12 @@
EK.forceMove(get_turf(src))
installed_encryptionkeys -= EK
recalculateChannels()
return
else if(istype(C, /obj/item/stack/nanopaste))
if(!pai)
to_chat(user, SPAN_WARNING("You cannot repair a pAI device if there's no active pAI personality installed."))
return
pai.attackby(C, user)
/obj/item/device/paicard/proc/recalculateChannels()
radio.channels = list("Common" = radio.FREQ_LISTENING, "Entertainment" = radio.FREQ_LISTENING)
+5 -4
View File
@@ -22,12 +22,13 @@
else
icon_state = "[initial(icon_state)]-empty"
/obj/item/stack/nanopaste/attack(mob/living/M as mob, mob/user as mob, var/target_zone)
if (!istype(M) || !istype(user))
/obj/item/stack/nanopaste/attack(atom/M, mob/user, var/target_zone)
if(!ismob(M) || !istype(user))
return 0
if (!can_use(1, user))
return 0
if (istype(M,/mob/living/silicon/robot)) //Repairing cyborgs
if (isrobot(M)) //Repairing cyborgs
var/mob/living/silicon/robot/R = M
if (R.getBruteLoss() || R.getFireLoss() )
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
@@ -41,7 +42,7 @@
else
to_chat(user, "<span class='notice'>All [R]'s systems are nominal.</span>")
if (istype(M,/mob/living/carbon/human)) //Repairing robolimbs
else if(ishuman(M)) //Repairing robolimbs
var/mob/living/carbon/human/H = M
var/obj/item/organ/external/S = H.get_organ(target_zone)