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
This commit is contained in:
Ren Erthilo
2012-04-26 22:36:50 +01:00
parent 29f60c55c6
commit f1c5937cb2
3 changed files with 34 additions and 6 deletions
+14
View File
@@ -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 << "<span class='notice'>You request an AI's presence.</span>"
var/area/area = get_area(src)
for(var/mob/living/silicon/ai/AI in world)
if(!AI.client) continue
AI << "<span class='info'>Your presence is requested at <a href='?src=\ref[AI];jumptoholopad=\ref[src]'>\the [area]</a>.</span>"
else
user << "<span class='notice'>A request for AI presence was already sent recently.</span>"
/obj/machinery/hologram/holopad/attack_ai(mob/living/silicon/ai/user)
if (!istype(user))
return
+12 -6
View File
@@ -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: []<BR>"},
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: []<BR>"},
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
+8
View File
@@ -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 << "<span class='notice'>Unable to locate the holopad.</span>"
if (href_list["lawc"]) // Toggling whether or not a law gets stated by the State Laws verb --NeoFite
var/L = text2num(href_list["lawc"])