mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-26 22:50:26 +01:00
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:
@@ -31,7 +31,7 @@
|
||||
//Triumvirate?
|
||||
if (ticker.triai == 1)
|
||||
required_enemies = 3
|
||||
required_players = max(required_enemies+1, required_players) //to prevent issues if players are set too low
|
||||
required_players = max(required_enemies+1, required_players) //to prevent issues if players are set too low
|
||||
return ..()
|
||||
|
||||
/datum/game_mode/malfunction/get_players_for_role(var/role = BE_MALF)
|
||||
@@ -187,6 +187,12 @@
|
||||
command_alert("Hostile runtimes detected in all station systems, please deactivate your AI to prevent possible damage to its morality core.", "Anomaly Alert")
|
||||
set_security_level("delta")
|
||||
|
||||
for(var/obj/item/weapon/pinpointer/point in world)
|
||||
for(var/datum/mind/AI_mind in ticker.mode.malf_ai)
|
||||
var/mob/living/silicon/ai/A = AI_mind.current // the current mob the mind owns
|
||||
if(A.stat != DEAD)
|
||||
point.the_disk = A //The pinpointer now tracks the AI core.
|
||||
|
||||
ticker.mode:malf_mode_declared = 1
|
||||
for(var/datum/mind/AI_mind in ticker.mode:malf_ai)
|
||||
AI_mind.current.verbs -= /datum/game_mode/malfunction/proc/takeover
|
||||
|
||||
@@ -175,10 +175,21 @@
|
||||
anchored = 1
|
||||
state = 20//So it doesn't interact based on the above. Not really necessary.
|
||||
|
||||
attackby(var/obj/item/device/aicard/A as obj, var/mob/user as mob)
|
||||
if(istype(A, /obj/item/device/aicard))//Is it?
|
||||
A.transfer_ai("INACTIVE","AICARD",src,user)
|
||||
return
|
||||
/obj/structure/AIcore/deactivated/attackby(var/obj/item/A as obj, var/mob/user as mob)
|
||||
if(istype(A, /obj/item/device/aicard))//Is it?
|
||||
A.transfer_ai("INACTIVE","AICARD",src,user)
|
||||
if(istype(A, /obj/item/weapon/wrench))
|
||||
playsound(loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
switch(anchored)
|
||||
if(0)
|
||||
if(do_after(user, 20))
|
||||
user << "\blue You wrench the core into place."
|
||||
anchored = 1
|
||||
if(1)
|
||||
if(do_after(user, 20))
|
||||
user << "\blue You unfasten the core."
|
||||
anchored = 0
|
||||
return
|
||||
|
||||
/*
|
||||
This is a good place for AI-related object verbs so I'm sticking it here.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -792,9 +792,9 @@
|
||||
src.occupant.verbs += /mob/living/silicon/ai/proc/corereturn
|
||||
src.occupant.verbs += /datum/game_mode/malfunction/proc/takeover
|
||||
src.occupant.cancel_camera()
|
||||
|
||||
for(var/obj/item/weapon/pinpointer/point in world)
|
||||
point.the_disk = src //the pinpointer will detect the shunted AI
|
||||
if (seclevel2num(get_security_level()) == SEC_LEVEL_DELTA)
|
||||
for(var/obj/item/weapon/pinpointer/point in world)
|
||||
point.the_disk = src //the pinpointer will detect the shunted AI
|
||||
|
||||
|
||||
/obj/machinery/power/apc/proc/malfvacate(var/forced)
|
||||
@@ -805,6 +805,12 @@
|
||||
src.occupant.parent.adjustOxyLoss(src.occupant.getOxyLoss())
|
||||
src.occupant.parent.cancel_camera()
|
||||
del(src.occupant)
|
||||
if (seclevel2num(get_security_level()) == SEC_LEVEL_DELTA)
|
||||
for(var/obj/item/weapon/pinpointer/point in world)
|
||||
for(var/datum/mind/AI_mind in ticker.mode.malf_ai)
|
||||
var/mob/living/silicon/ai/A = AI_mind.current // the current mob the mind owns
|
||||
if(A.stat != DEAD)
|
||||
point.the_disk = A //The pinpointer tracks the AI back into its core.
|
||||
|
||||
else
|
||||
src.occupant << "\red Primary core damaged, unable to return core processes."
|
||||
@@ -812,9 +818,8 @@
|
||||
src.occupant.loc = src.loc
|
||||
src.occupant.death()
|
||||
src.occupant.gib()
|
||||
|
||||
for(var/obj/item/weapon/pinpointer/point in world)
|
||||
point.the_disk = null //the pinpointer will go back to pointing at the nuke disc.
|
||||
for(var/obj/item/weapon/pinpointer/point in world)
|
||||
point.the_disk = null //the pinpointer will go back to pointing at the nuke disc.
|
||||
|
||||
|
||||
/obj/machinery/power/apc/proc/ion_act()
|
||||
|
||||
@@ -54,6 +54,13 @@ should be listed in the changelog upon commit tho. Thanks. -->
|
||||
|
||||
|
||||
<!-- DO NOT REMOVE OR MOVE THIS COMMENT! THIS MUST BE THE LAST NON-EMPTY LINE BEFORE THE LOGS #ADDTOCHANGELOGMARKER# -->␍
|
||||
<div class="commit sansserif">
|
||||
<h2 class="date">17 November 2013</h2>
|
||||
<h3 class="author">Laharl Montgommery updated:</h3>
|
||||
<ul class="changes bgimages16">
|
||||
<li class='rscadd'>AI can now anchor and unanchor itself. In short, it means the AI can be dragged, if it wants to.</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class='commit sansserif'>
|
||||
<h2 class='date'>16 November 2013</h2>
|
||||
|
||||
@@ -58,7 +58,13 @@ should be listed in the changelog upon commit tho. Thanks. -->
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="commit sansserif">
|
||||
<h2 class="date">17 November 2013</h2>
|
||||
<h3 class="author">Laharl Montgommery updated:</h3>
|
||||
<ul class="changes bgimages16">
|
||||
<li class='rscadd'>AI can now anchor and unanchor itself. In short, it means the AI can be dragged, if it wants to.</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class='commit sansserif'>
|
||||
<h2 class='date'>29 September 2013</h2>
|
||||
|
||||
Reference in New Issue
Block a user