diff --git a/code/modules/mob/holder.dm b/code/modules/mob/holder.dm index a6c0ce6614d..dc04bbe8b70 100644 --- a/code/modules/mob/holder.dm +++ b/code/modules/mob/holder.dm @@ -48,4 +48,9 @@ name = "maintenance drone" desc = "It's a small maintenance robot." icon_state = "drone" - origin_tech = "magnets=3;engineering=5" \ No newline at end of file + origin_tech = "magnets=3;engineering=5" + +/obj/item/weapon/holder/pai + name = "pAI" + desc = "It's a little robot." + icon_state = "pai" \ No newline at end of file diff --git a/code/modules/mob/living/silicon/pai/pai.dm b/code/modules/mob/living/silicon/pai/pai.dm index ae26734975f..bd70eb19bb5 100644 --- a/code/modules/mob/living/silicon/pai/pai.dm +++ b/code/modules/mob/living/silicon/pai/pai.dm @@ -8,6 +8,7 @@ small = 1 pass_flags = 1 density = 0 + holder_type = /obj/item/weapon/holder/pai var/network = "SS13" var/obj/machinery/camera/current = null @@ -461,7 +462,16 @@ src.client.perspective = EYE_PERSPECTIVE src.client.eye = card - //This seems redundant but not including the forced loc setting messes the behavior up. + // If we are being held, handle removing our holder from their inv. + var/obj/item/weapon/holder/H = loc + if(istype(H)) + var/mob/living/M = H.loc + if(istype(M)) + M.drop_from_inventory(H) + H.loc = get_turf(src) + src.loc = get_turf(H) + + // Move us into the card and move the card to the ground src.loc = card card.loc = get_turf(card) src.forceMove(card) @@ -519,4 +529,23 @@ // No binary for pAIs. /mob/living/silicon/pai/binarycheck() - return 0 \ No newline at end of file + return 0 + +// Handle being picked up. +/mob/living/silicon/pai/get_scooped(var/mob/living/carbon/grabber) + var/obj/item/weapon/holder/H = ..() + if(!istype(H)) + return + H.icon_state = "pai-[icon_state]" + grabber.update_inv_l_hand() + grabber.update_inv_r_hand() + return H + +/mob/living/silicon/pai/MouseDrop(atom/over_object) + var/mob/living/carbon/H = over_object + if(!istype(H) || !Adjacent(H)) return ..() + if(H.a_intent == "help") + get_scooped(H) + return + else + return ..() \ No newline at end of file diff --git a/code/modules/mob/living/silicon/pai/software_modules.dm b/code/modules/mob/living/silicon/pai/software_modules.dm index 877c6002dc6..78845906a24 100644 --- a/code/modules/mob/living/silicon/pai/software_modules.dm +++ b/code/modules/mob/living/silicon/pai/software_modules.dm @@ -547,3 +547,62 @@ P.sradio.code = min(100, P.sradio.code) P.sradio.code = max(1, P.sradio.code) return 1 + +/datum/pai_software/host_scan + name = "Host Bioscan" + ram_cost = 5 + id = "bioscan" + + + var/mob/living/silicon/pai/P = usr + if(!istype(P)) return + + var/mob/living/M = P.loc + var/count = 0 + + // Find the carrier + while(!istype(M, /mob/living)) + if(!M || !M.loc || count > 6) + src << "You are not being carried by anyone!" + return 0 + M = M.loc + count++ + + on_ui_interact(mob/living/silicon/pai/user, datum/nanoui/ui=null, force_open=1) + + var/data[0] + + + if(istype(M, /mob/living) + data["holder"] = M + data["health"] = "[M.stat > 1 ? "dead" : "[M.health]% healthy"]" + data["oxy"] = "[M.getOxyLoss() > 50 ? "" : ""][M.getOxyLoss()]" + data["tox"] = "[M.getToxLoss() > 50 ? "" : ""][M.getToxLoss()]" + data["burn"] = "[M.getFireLoss() > 50 ? "" : ""][M.getFireLoss()]" + data["temp"] = "[M.bodytemperature-T0C]°C ([M.bodytemperature*1.8-459.67]°F" + + if (M.viruses) + data["infected"] = 1 + var/virus[0] + for(var/datum/disease/D in M.viruses) + var/vdata[0] + vdata["name"] = D.name || "unknown" + vdata["type"] = D.spread || "unknown" + vdata["stage"] = D.stage || "unknown" + vdata["stageMax"] = D.max_stages || "unknown" + vdata["cure"] = D.cure || "unknown" + + virus[++virus.len]=vdata + data["infectionDat"] = virus + + + else + data["holder"] = 0 + + ui = nanomanager.try_update_ui(user, user, id, ui,data , force_open) + if(!ui) + // Don't copy-paste this unless you're making a pAI software module! + ui = new(user, user, id, "pai_bioscan.tmpl", "Host Bioscan", 450, 600) + ui.set_initial_data(data) + ui.open() + ui.set_auto_update(1) \ No newline at end of file diff --git a/icons/mob/PaiHat.dmi b/icons/mob/PaiHat.dmi new file mode 100644 index 00000000000..6273db75152 Binary files /dev/null and b/icons/mob/PaiHat.dmi differ diff --git a/icons/mob/in-hand/left/paiheldleft.dmi b/icons/mob/in-hand/left/paiheldleft.dmi new file mode 100644 index 00000000000..4cbc82be3d9 Binary files /dev/null and b/icons/mob/in-hand/left/paiheldleft.dmi differ diff --git a/icons/mob/in-hand/right/paiheldright.dmi b/icons/mob/in-hand/right/paiheldright.dmi new file mode 100644 index 00000000000..fd98dc37fd3 Binary files /dev/null and b/icons/mob/in-hand/right/paiheldright.dmi differ diff --git a/icons/obj/objects.dmi b/icons/obj/objects.dmi index 7393f11d276..7ec5af32d3c 100644 Binary files a/icons/obj/objects.dmi and b/icons/obj/objects.dmi differ diff --git a/nano/templates/pai_bioscan.tmpl b/nano/templates/pai_bioscan.tmpl new file mode 100644 index 00000000000..2dd43556856 --- /dev/null +++ b/nano/templates/pai_bioscan.tmpl @@ -0,0 +1,36 @@ + + +{{if data.holder}} +
+
+ Bioscan Results for {{:data.holder}}: +
+
+ Health Status : {{:data.health}} + Oxygen Content : {{:data.oxy}} + Toxin Cotnet : {{:data.tox}} + Burn Status : {{:data.burn}} + User Temprature : {{:data.temp}} +
+
+ {{if data.infected}} + Alert:Viral pathogen detected, Attempting to find information... + {{for data.infectionDat}} +
+
+ {{:value.name}}: +
+
+ Type : {{:value.type}} + Stage: {{:value.stage}} / {{:value.stagemax}} + Possible Cure: {{:value.cure}} + +
+
+ {{/for}} + {{/if}} +{{else}} + Error: No biological host found! +{{/if}} \ No newline at end of file