Merge pull request #1812 from LaharlMontogmmery/Unanchored-AI

AI can now anchor/unanchor itself. Goes with Malf AI pinpointer tracking once it activates Delta for balance reasons. Please review/merge if satisfying enough.
This commit is contained in:
Giacom
2013-11-26 12:15:47 -08:00
8 changed files with 87 additions and 40 deletions
+14 -1
View File
@@ -18,7 +18,7 @@ var/list/ai_list = list()
icon_state = "ai"
anchored = 1 // -- TLE
density = 1
status_flags = CANSTUN|CANPARALYSE
status_flags = CANSTUN|CANPARALYSE|CANPUSH
var/list/network = list("SS13")
var/obj/machinery/camera/current = null
var/list/connected_robots = list()
@@ -253,6 +253,19 @@ var/list/ai_list = list()
return
/mob/living/silicon/ai/verb/toggle_anchor()
set category = "AI Commands"
set name = "Toggle Floor Bolts"
if(!isturf(loc)) // if their location isn't a turf
return // stop
anchored = !anchored // Toggles the anchor
src << "[anchored ? "<b>You are now anchored.</b>" : "<b>You are now unanchored.</b>"]"
// the message in the [] will change depending whether or not the AI is anchored
/mob/living/silicon/ai/update_canmove() //If the AI dies, mobs won't go through it anymore
return 0
/mob/living/silicon/ai/proc/ai_cancel_call()
set category = "AI Commands"
if(src.stat == 2)
@@ -339,32 +339,6 @@
if(prob(75) && Proj.damage > 0) spark_system.start()
return 2
/mob/living/silicon/robot/Bump(atom/movable/AM as mob|obj, yes)
if ((!( yes ) || now_pushing))
return
now_pushing = 1
if(ismob(AM))
var/mob/tmob = AM
if(!(tmob.status_flags & CANPUSH))
now_pushing = 0
return
now_pushing = 0
..()
if (!istype(AM, /atom/movable))
return
if (!now_pushing)
now_pushing = 1
if (!AM.anchored)
var/t = get_dir(src, AM)
if (istype(AM, /obj/structure/window))
if(AM:ini_dir == NORTHWEST || AM:ini_dir == NORTHEAST || AM:ini_dir == SOUTHWEST || AM:ini_dir == SOUTHEAST)
for(var/obj/structure/window/win in get_step(AM,t))
now_pushing = 0
return
step(AM, t)
now_pushing = null
/mob/living/silicon/robot/triggerAlarm(var/class, area/A, var/O, var/alarmsource)
if (stat == 2)
return 1
+26 -1
View File
@@ -253,4 +253,29 @@
number++
list += {"<br><br><A href='byond://?src=\ref[src];laws=1'>State Laws</A>"}
usr << browse(list, "window=laws")
usr << browse(list, "window=laws")
/mob/living/silicon/Bump(atom/movable/AM as mob|obj, yes) //Allows the AI to bump into mobs if it's itself pushed
if ((!( yes ) || now_pushing))
return
now_pushing = 1
if(ismob(AM))
var/mob/tmob = AM
if(!(tmob.status_flags & CANPUSH))
now_pushing = 0
return
now_pushing = 0
..()
if (!istype(AM, /atom/movable))
return
if (!now_pushing)
now_pushing = 1
if (!AM.anchored)
var/t = get_dir(src, AM)
if (istype(AM, /obj/structure/window))
if(AM:ini_dir == NORTHWEST || AM:ini_dir == NORTHEAST || AM:ini_dir == SOUTHWEST || AM:ini_dir == SOUTHEAST)
for(var/obj/structure/window/win in get_step(AM,t))
now_pushing = 0
return
step(AM, t)
now_pushing = null