From f1c5937cb2d26c4ad9347d9aa0ea350c522c5771 Mon Sep 17 00:00:00 2001 From: Ren Erthilo Date: Thu, 26 Apr 2012 22:36:50 +0100 Subject: [PATCH] TG: Applied Carn's Holopad requests patch. Basically allows for people to request the presence of an AI at a holopad. Some work on porta turrets. Revision: r3270 Author: vageyenaman --- code/game/machinery/hologram.dm | 14 ++++++++++++++ code/game/machinery/portable_turret.dm | 18 ++++++++++++------ code/modules/mob/living/silicon/ai/ai.dm | 8 ++++++++ 3 files changed, 34 insertions(+), 6 deletions(-) diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm index 55fa212c5ef..d286943583d 100644 --- a/code/game/machinery/hologram.dm +++ b/code/game/machinery/hologram.dm @@ -11,6 +11,20 @@ Possible to do for anyone motivated enough: Give an AI variable for different hologram icons. Itegrate EMP effect to disable the unit. */ +/obj/machinery/hologram/holopad/attack_hand(var/mob/living/carbon/human/user) //Carn: Hologram requests. + if(!istype(user)) + return + if(alert(user,"Would you like to request an AI's presence?",,"Yes","No") == "Yes") + if(last_request + 200 < world.time) //don't spam the AI with requests you jerk! + last_request = world.time + user << "You request an AI's presence." + var/area/area = get_area(src) + for(var/mob/living/silicon/ai/AI in world) + if(!AI.client) continue + AI << "Your presence is requested at \the [area]." + else + user << "A request for AI presence was already sent recently." + /obj/machinery/hologram/holopad/attack_ai(mob/living/silicon/ai/user) if (!istype(user)) return diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm index ea85c63b6b8..3310a68b6f2 100644 --- a/code/game/machinery/portable_turret.dm +++ b/code/game/machinery/portable_turret.dm @@ -40,6 +40,7 @@ var/auth_weapons = 0 // checks if it can shoot people that have a weapon they aren't authorized to have var/stun_all = 0 // if this is active, the turret shoots everything that isn't security or head of staff var/check_anomalies = 1 // checks if it can shoot at unidentified lifeforms (ie xenos) + var/ai = 0 // if active, will shoot at anything not an AI or cyborg var/attacked = 0 // if set to 1, the turret gets pissed off and shoots at people nearby (unless they have sec access!) @@ -317,11 +318,20 @@ Neutralize All Unidentified Life Signs: []
"}, if(emagged) // if emagged, HOLY SHIT EVERYONE IS DANGEROUS beep boop beep targets += C else - - if (C.stat || C.handcuffed) // if the perp is handcuffed or dead/dying, no need to bother really continue // move onto next potential victim! + var/dst = get_dist(src, C) // if it's too far away, why bother? + if (dst > 12) + continue + + if(!istype(C, /mob/living/silicon) && ai) // If it's set to attack all nonsilicons, target them! + if(C.lying) + secondarytargets += C + else + targets += C + continue + if (istype(C, /mob/living/carbon/human)) // if the target is a human, analyze threat level if(src.assess_perp(C)<4) continue // if threat level < 4, keep going @@ -329,10 +339,6 @@ Neutralize All Unidentified Life Signs: []
"}, else if (istype(C, /mob/living/carbon/monkey) || istype(C, /mob/living/silicon)) continue // Don't target monkeys or borgs/AIs you dumb shit - var/dst = get_dist(src, C) // if it's too far away, why bother? - if (dst > 12) - continue - if (C.lying) // if the perp is lying down, it's still a target but a less-important target secondarytargets += C continue diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm index f6939441334..3ab582828e1 100644 --- a/code/modules/mob/living/silicon/ai/ai.dm +++ b/code/modules/mob/living/silicon/ai/ai.dm @@ -301,6 +301,14 @@ if (href_list["showalerts"]) ai_alerts() + //Carn: holopad requests + if (href_list["jumptoholopad"]) + var/obj/machinery/hologram/holopad/H = locate(href_list["jumptoholopad"]) + if(stat == CONSCIOUS) + if(H) + H.attack_ai(src) //may as well recycle + else + src << "Unable to locate the holopad." if (href_list["lawc"]) // Toggling whether or not a law gets stated by the State Laws verb --NeoFite var/L = text2num(href_list["lawc"])