Revert "AI/Cyborg Shells (2) (#27892)"

This reverts commit 3e3e022fa2.
This commit is contained in:
d3athrow
2020-09-27 22:16:37 -05:00
committed by GitHub
parent 237115ece4
commit 61ccaabd8b
23 changed files with 73 additions and 518 deletions

View File

@@ -74,8 +74,6 @@
#define isrobot(A) istype(A, /mob/living/silicon/robot)
#define isshell(A) istype(A, /mob/living/silicon/robot/shell)
#define isanimal(A) istype(A, /mob/living/simple_animal)
#define iscorgi(A) istype(A, /mob/living/simple_animal/corgi)

View File

@@ -241,7 +241,7 @@
..()
candidates = candidates[CURRENT_LIVING_PLAYERS]
for(var/mob/living/player in candidates)
if(!isAI(player) && !isshell(player))
if(!isAI(player))
candidates -= player
continue
if(player.z == map.zCentcomm)
@@ -256,21 +256,13 @@
unction = ticker.mode.CreateFaction(/datum/faction/malf, null, 1)
if(!candidates || !candidates.len)
return 0
var/mob/living/silicon/P = pick(candidates)
var/mob/living/silicon/ai/M
if(isshell(P))
var/mob/living/silicon/robot/shell/S = P
S.undeploy()
M = S.mainframe
else
M = P
var/mob/living/silicon/ai/M = pick(candidates)
assigned += M
candidates -= M
var/datum/role/malfAI/malf = unction.HandleNewMind(M.mind)
malf.OnPostSetup()
malf.Greet()
for(var/mob/living/silicon/robot/R in M.connected_robots)
if(!isshell(R))
unction.HandleRecruitedMind(R.mind)
unction.forgeObjectives()
unction.AnnounceObjectives()

View File

@@ -75,14 +75,11 @@
src.key = key
/datum/mind/proc/transfer_to(mob/new_character)
if(!new_character)
return
if (!current)
transfer_to_without_current(new_character)
return
if(new_character.attack_log && current.attack_log)
// new_character.attack_log += current.attack_log
current.attack_log += "\[[time_stamp()]\]: mind transfer from [current] to [new_character]"
new_character.attack_log += current.attack_log
new_character.attack_log += "\[[time_stamp()]\]: mind transfer from [current] to [new_character]"
for (var/role in antag_roles)

View File

@@ -312,16 +312,6 @@ var/global/datum/controller/occupations/job_master
var/datum/job/master_assistant = GetJob("Assistant")
count = (officer.current_positions + warden.current_positions + hos.current_positions)
var/datum/job/borg = job_master.GetJob("Cyborg") //spawn a completed cyborg shell if no borgs readied up
var/borg_count = borg.current_positions
if(!borg_count)
for(var/obj/effect/landmark/start/sloc in landmarks_list)
if(sloc.name != "Cyborg")
continue
else
new /obj/item/robot_parts/robot_suit/mapped(sloc.loc)
break
// For those who wanted to be assistant if their preferences were filled, here you go.
for(var/mob/new_player/player in unassigned)
if(player.client.prefs.alternate_option == BE_ASSISTANT)

View File

@@ -170,9 +170,7 @@ That prevents a few funky behaviors.
if(C.contents.len)//If there is an AI on card.
to_chat(U, "<span class='danger'>Transfer failed:</span> Existing AI found on this terminal. Remove existing AI to install a new one.")
else
if(T.is_in_shell) //send them back!
T.shell.undeploy()
if(T.mind?.GetRole(MALF))
if(T.mind.GetRole(MALF))
to_chat(U, "<span class='danger'>ERROR:</span> Remote transfer interface disabled.")//Do ho ho ho~
return
new /obj/structure/AIcore/deactivated(T.loc)//Spawns a deactivated terminal at AI location.
@@ -199,8 +197,6 @@ That prevents a few funky behaviors.
var/obj/item/device/aicard/C = src
var/mob/living/silicon/ai/A = locate() in C//I love locate(). Best proc ever.
if(A)//If AI exists on the card. Else nothing since both are empty.
if(A.is_in_shell) //send them back!
A.shell.undeploy()
A.control_disabled = 0
A.forceMove(T.loc)//To replace the terminal.
A.update_icon()
@@ -223,8 +219,6 @@ That prevents a few funky behaviors.
else
for(var/mob/living/silicon/ai/A in C)
if(A.is_in_shell) //send them back!
A.shell.undeploy()
C.icon_state = "aicard"
C.name = "inteliCard"
C.overlays.len = 0
@@ -276,8 +270,6 @@ That prevents a few funky behaviors.
else
for(var/mob/living/silicon/ai/A in C)
if(A.is_in_shell) //send them back!
A.shell.undeploy()
C.icon_state = "aicard"
C.name = "inteliCard"
C.overlays.len = 0

View File

@@ -254,11 +254,7 @@
// message_admins("<span class='notice'>[key_name_admin(usr)] emagged [R.name] using robotic console!</span>")
log_game("[key_name(usr)] emagged [R.name] using robotic console!")
R.SetEmagged(TRUE)
var/mob/living/silicon/ai/A = usr
if(A.is_in_shell)
to_chat(A.shell, "Hack successful. [R.name] now has access to illegal technology.")
else
to_chat(A, "Hack successful. [R.name] now has access to illegal technology.")
to_chat(usr, "Hack successful. [R.name] now has access to illegal technology.")
if(R.mind.special_role)
R.verbs += /mob/living/silicon/robot/proc/ResetSecurityCodes
hacking = 0

View File

@@ -65,13 +65,13 @@
/obj/machinery/mind_machine/mind_machine_hub/New()
..()
illegalSwap = boss_mobs + blacklisted_mobs + list(/mob/living/silicon/ai, /mob/living/silicon/robot/shell) - list(/mob/living/simple_animal/hostile/mechahitler,
illegalSwap = boss_mobs + blacklisted_mobs - list(/mob/living/simple_animal/hostile/mechahitler,
/mob/living/simple_animal/hostile/alien/queen/large,
/mob/living/simple_animal/hostile/retaliate/cockatrice,
/mob/living/simple_animal/hostile/asteroid/goliath/david/dave,
/mob/living/simple_animal/hostile/bear/spare,
/mob/living/simple_animal/hostile/asteroid/rockernaut/boss,
/mob/living/simple_animal/hostile/mining_drone,
/mob/living/simple_animal/hostile/mining_drone
)
component_parts = newlist(
/obj/item/weapon/circuitboard/mind_machine_hub,

View File

@@ -207,10 +207,7 @@
if(src.occupant)
if(isrobot(occupant))
var/mob/living/silicon/robot/R = occupant
if(R.stat)//no more borgs suiciding in recharge stations to ruin them.
go_out()
return
if(!R.client && !isshell(R))
if((R.stat) || (!R.client))//no more borgs suiciding in recharge stations to ruin them.
go_out()
return
restock_modules()

View File

@@ -280,9 +280,6 @@
else if (isAI(speech.speaker))
speech.job = "AI"
else if (isshell(speech.speaker))
speech.job = "AI Shell"
// --- Cyborg ---
else if (isrobot(speech.speaker))
speech.job = "Cyborg"

View File

@@ -44,10 +44,6 @@
var/obj/item/weapon/cell/cell = null
var/extension = null //For making borgs start with pre-installed better components. Make the var the end of the path including the "/".
/obj/item/robot_parts/chest/complete
cell = new /obj/item/weapon/cell/high
wires = 1.0
/obj/item/robot_parts/chest/get_cell()
return cell
@@ -63,10 +59,6 @@
var/obj/item/device/flash/flash1 = null
var/obj/item/device/flash/flash2 = null
/obj/item/robot_parts/head/complete
flash1 = new /obj/item/device/flash
flash2 = new /obj/item/device/flash
/obj/item/robot_parts/robot_suit
name = "robot endoskeleton"
desc = "A complex metal backbone with standard limb sockets and pseudomuscle anchors."
@@ -78,15 +70,6 @@
var/obj/item/robot_parts/chest/chest = null
var/obj/item/robot_parts/head/head = null
var/created_name = ""
var/ai_control = 1
/obj/item/robot_parts/robot_suit/mapped
l_arm = new /obj/item/robot_parts/l_arm
r_arm = new /obj/item/robot_parts/r_arm
l_leg = new /obj/item/robot_parts/l_leg
r_leg = new /obj/item/robot_parts/r_leg
chest = new /obj/item/robot_parts/chest/complete
head = new /obj/item/robot_parts/head/complete
/obj/item/robot_parts/robot_suit/New()
..()
@@ -226,14 +209,47 @@
if(!user.drop_item(W))
return
var/mob/living/silicon/robot/O = new /mob/living/silicon/robot(get_turf(loc))
for(var/P in M.mommi_assembly_parts) //Let's give back all those mommi creation components
for(var/obj/item/L in M.contents)
if(L == P)
L.forceMove(T)
M.contents -= L
create_robot(M)
if(!O)
return
O.mmi = W
O.invisibility = 0
O.custom_name = created_name
O.updatename("Default")
M.brainmob.mind.transfer_to(O)
if(O.mind && O.mind.special_role)
O.mind.store_memory("In case you look at this after being borged, the objectives are only here until I find a way to make them not show up for you, as I can't simply delete them without screwing up round-end reporting. --NeoFite")
O.job = "Cyborg"
if(chest.extension)
O.component_extension = chest.extension
O.upgrade_components()
O.cell = chest.cell
O.cell.forceMove(O)
W.forceMove(O) //Should fix cybros run time erroring when blown up. It got deleted before, along with the frame.
// Since we "magically" installed a cell, we also have to update the correct component.
if(O.cell)
var/datum/robot_component/cell_component = O.components["power cell"]
cell_component.wrapped = O.cell
cell_component.installed = 1
feedback_inc("cyborg_birth",1)
spawn()
O.Namepick()
qdel(src)
else
to_chat(user, "<span class='notice'>The MMI must go in after everything else!</span>")
@@ -246,113 +262,8 @@
src.created_name = t
if(W.force >= 15) //Smash those skeletons
smash()
return
/obj/item/robot_parts/robot_suit/attack_hand(mob/user)
if(!check_completion())
return
if(ai_control)
to_chat(user, "You disable AI control on the cyborg exoskeleton.")
ai_control = 0
else
to_chat(user, "You enable AI control on the cyborg exoskeleton.")
ai_control = 1
/obj/item/robot_parts/robot_suit/attack_ai(mob/user)
if(!isAI(user))
return
if(user.isDead())
return
if(!check_completion())
return
if(!ai_control)
to_chat(user, "<span class='warning'>AI control is disabled on that exoskeleton.</span>")
return
var/mob/living/silicon/ai/A = user
if(!A.shell)
A.create_shell(src)
else
to_chat(user, "<span class='warning'>You already have a shell. Destroy it to create a new one.</span>")
/obj/item/robot_parts/robot_suit/bullet_act(var/obj/item/projectile/P)
if(P.damage > 10)
smash()
/obj/item/robot_parts/robot_suit/proc/smash()
robogibs(loc)
visible_message("<span class='danger'>[src] blows apart!</span>")
var/turf/T = get_turf(src)
if(l_arm)
l_arm.forceMove(T)
l_arm = null
if(r_arm)
r_arm.forceMove(T)
r_arm = null
if(l_leg)
l_leg.forceMove(T)
l_leg = null
if(r_leg)
r_leg.forceMove(T)
r_leg = null
if(chest)
chest.forceMove(T)
chest = null
if(head)
head.forceMove(T)
head = null
qdel(src)
/obj/item/robot_parts/robot_suit/proc/create_robot(var/obj/item/device/mmi/M, is_shell = FALSE)
var/robottype
if(is_shell)
robottype = /mob/living/silicon/robot/shell
else
robottype = /mob/living/silicon/robot
var/mob/living/silicon/robot/O = new robottype(get_turf(loc))
if(!O)
return
if(M)
O.mmi = M
O.invisibility = 0
O.custom_name = created_name
O.updatename("Default")
if(M)
M.brainmob.mind.transfer_to(O)
if(O.mind && O.mind.special_role)
O.mind.store_memory("In case you look at this after being borged, the objectives are only here until I find a way to make them not show up for you, as I can't simply delete them without screwing up round-end reporting. --NeoFite")
O.job = "Cyborg"
if(chest.extension)
O.component_extension = chest.extension
O.upgrade_components()
O.cell = chest.cell
O.cell.forceMove(O)
if(M)
M.forceMove(O) //Should fix cybros run time erroring when blown up. It got deleted before, along with the frame.
// Since we "magically" installed a cell, we also have to update the correct component.
if(O.cell)
var/datum/robot_component/cell_component = O.components["power cell"]
cell_component.wrapped = O.cell
cell_component.installed = 1
feedback_inc("cyborg_birth",1)
spawn()
if(M)
O.Namepick()
qdel(src)
return O
/obj/item/robot_parts/chest/attackby(obj/item/W as obj, mob/user as mob)
..()
if(istype(W, /obj/item/weapon/cell))

View File

@@ -41,13 +41,6 @@ var/list/ai_list = list()
var/mentions_on = FALSE
var/list/holopadoverlays = list()
//Shell stuff
var/mob/living/silicon/robot/shell/shell = null //The shell the AI currently owns
var/datum/action/deploy_shell/deploy_action = new
var/datum/action/detonate/destroy_action = new
var/is_in_shell = 0 //Is the AI currently controlling a borg
var/greeted = 0 //Shitty fix for being repeatedly told the AI greeting
// See VOX_AVAILABLE_VOICES for available values
var/vox_voice = "fem";
var/vox_corrupted = FALSE
@@ -115,10 +108,6 @@ var/list/ai_list = list()
proc_holder_list = new()
//Action Buttons
deploy_action.Grant(src)
destroy_action.Grant(src)
//Determine the AI's lawset
if(L && istype(L,/datum/ai_laws))
src.laws = L
@@ -163,7 +152,7 @@ var/list/ai_list = list()
spawn(1)
mind.store_memory("Frequencies list: <br/><b>Command:</b> [COMM_FREQ] <br/> <b>Security:</b> [SEC_FREQ] <br/> <b>Medical:</b> [MED_FREQ] <br/> <b>Science:</b> [SCI_FREQ] <br/> <b>Engineering:</b> [ENG_FREQ] <br/> <b>Service:</b> [SER_FREQ] <b>Cargo:</b> [SUP_FREQ]<br/> <b>AI private:</b> [AIPRIV_FREQ]<br/>")
stored_freqs = 1
greeted = 1
job = "AI"
ai_list += src
..()
@@ -859,105 +848,6 @@ var/list/ai_list = list()
station_holomap.toggleHolomap(src,1)
/mob/living/silicon/ai/verb/deploy_to_shell() //Pop into a shell if you own one
set category = "AI Commands"
set name = "Deploy to Shell"
if(isDead())
to_chat(src, "<span class='warning'>Not while you're incapacitated.</span>")
return
if(control_disabled)
to_chat(src, "<span class='warning'>Wireless networking module is offline.</span>")
return
if(istype(loc, /obj/machinery/power/apc))
to_chat(src, "<span class='warning'>You can't control a shell while shunted.</span>")
return
if(is_in_shell) //if this is true, something went wrong
return
if(shell) //If the silicon already has a linked shell, go to that one!
if(mind)
shell.deploy(src)
else //Otherwise, lets see if we can create a new shell
var/list/potential_shells = list()
for(var/obj/item/robot_parts/robot_suit/emptyborg in world) //Looping through the world might not be good
if(!cameranet.checkCameraVis(emptyborg)) //Must be visible
continue
if(!emptyborg.check_completion()) //Must be ready to have a posi/MMI inserted
continue
if(!emptyborg.ai_control) //AI control was disabled
continue
potential_shells.Add(emptyborg)
if(potential_shells.len == 0)
to_chat(src, "<span class='warning'>No potential cyborg shells available.</span>")
return
var/list/options = list()
for(var/obj/item/robot_parts/robot_suit/S in potential_shells)
options["Exoskeleton #[potential_shells.Find(S)] in [get_area(S)]"] = S
var/choice = input(src, "Which exoskeleton to control?") as null|anything in options
if(shell) //no exploits allowed
to_chat(src, "<span class='warning'>You already have a shell.</span>")
if(choice)
create_shell(options[choice])
/mob/living/silicon/ai/proc/create_shell(var/obj/item/robot_parts/robot_suit/suit)
if(shell)
to_chat(src, "<span class='warning'>You already have a shell.</span>")
return
if(mind)
to_chat(src, "Taking control of cyborg shell...")
var/mob/living/silicon/robot/shell/R = suit.create_robot(is_shell = 1)
shell = R
R.set_mainframe(src)
R.deploy()
/datum/action/deploy_shell
name = "Deploy to AI Shell"
desc = "Wirelessly control your personal cyborg shell or create a new one from an empty exoskeleton."
icon_icon = 'icons/mob/robots.dmi'
button_icon_state = "robot"
/datum/action/deploy_shell/Trigger()
var/mob/living/silicon/ai/AI = owner
if(!AI)
return
AI.deploy_to_shell()
/datum/action/detonate/
name = "Destroy shell"
desc = "Destroy your current shell and make room for a new one."
icon_icon = 'icons/mob/robots.dmi'
button_icon_state = "gibup"
/datum/action/detonate/Trigger()
if(istype(owner, /mob/living/silicon/robot/shell)) //Pressing the button as a shell
var/mob/living/silicon/robot/shell/R = owner
R.mainframe.shell = null
R.gib()
return TRUE
else if(istype(owner, /mob/living/silicon/ai)) //Pressing the button as an AI
var/mob/living/silicon/ai/R = owner
if(R.isDead())
to_chat(src, "<span class='warning'>Not while you're incapacitated.</span>")
return FALSE
if(R.control_disabled)
to_chat(src, "<span class='warning'>Wireless networking module is offline.</span>")
return FALSE
if(R.shell)
R.shell.gib()
return TRUE
else
to_chat("<span class='warning'>You have no shell.</span>")
return FALSE
else
to_chat("<span class='warning'>You can't do that.</span>")
return FALSE
//AI_CAMERA_LUMINOSITY
/mob/living/silicon/ai/proc/light_cameras()

View File

@@ -1,7 +1,4 @@
/mob/living/silicon/ai/death(gibbed)
if(shell)
shell.close_connection()
shell.gib()
if(stat == DEAD)
return
if(!gibbed)

View File

@@ -1,7 +1,6 @@
/mob/living/silicon/ai/Login() //ThisIsDumb(TM) TODO: tidy this up ¬_¬ ~Carn
..()
if(!greeted)
to_chat(src, "<B>You are playing the station's AI. The AI cannot move, but can interact with many objects while viewing them (through cameras).</B>")
to_chat(src, "<B>To look at other parts of the station, click on yourself to get a camera menu.</B>")
to_chat(src, "<B>While observing through a camera, you can use most (networked) devices which you can see, such as computers, APCs, intercoms, doors, etc.</B>")
@@ -23,11 +22,9 @@
O.mode = 1
O.emotion = "Neutral"
view_core()
if (mind && !stored_freqs && !greeted)
if (mind && !stored_freqs)
to_chat(src, "The various frequencies used by the crew to communicate have been stored in your mind. Use the verb <i>Notes</i> to access them.")
spawn(1)
mind.store_memory("Frequencies list: <br/><b>Command:</b> [COMM_FREQ] <br/> <b>Security:</b> [SEC_FREQ] <br/> <b>Medical:</b> [MED_FREQ] <br/> <b>Science:</b> [SCI_FREQ] <br/> <b>Engineering:</b> [ENG_FREQ] <br/> <b>Service:</b> [SER_FREQ] <b>Cargo:</b> [SUP_FREQ]<br/> <b>AI private:</b> [AIPRIV_FREQ]<br/>")
stored_freqs = 1
if(!greeted)
greeted = 1
client.CAN_MOVE_DIAGONALLY = TRUE

View File

@@ -1,6 +1,5 @@
/mob/living/silicon/ai/Logout()
..()
if(!is_in_shell)
for(var/obj/machinery/ai_status_display/O in machines) //change status
O.mode = 0
if(!isturf(loc))

View File

@@ -89,7 +89,3 @@
ghostize() //Somehow their MMI has no brainmob or something even worse happened. Let's just save their soul from this hell.
mmi = null
..()
/mob/living/silicon/robot/shell/Destroy()
close_connection()
..()

View File

@@ -38,18 +38,6 @@
if(ticker.current_state == GAME_STATE_PLAYING) //Only tell them this if the game has started. We might find an AI master for them before it starts if it hasn't.
to_chat(who, "<b>Remember, you are not bound to any AI, you are not required to listen to them.</b>")
/mob/living/silicon/robot/shell/show_laws(var/everyone = 0)
laws_sanity_check()
var/who
if (everyone)
who = world
else
who = src
to_chat(who, "<b>Obey these laws:</b>")
laws.show_laws(who)
/mob/living/silicon/robot/proc/lawsync()
laws_sanity_check()
var/datum/ai_laws/master = connected_ai ? connected_ai.laws : null
@@ -81,9 +69,7 @@
laws.supplied[index] = temp
if(mind)
var/datum/role/mastermalf //Workaround for shelled AIs causing runtimes
mastermalf = connected_ai.is_in_shell ? connected_ai.shell.mind.GetRole(MALF) : connected_ai.mind.GetRole(MALF)
var/datum/role/mastermalf = connected_ai.mind.GetRole(MALF)
if(mastermalf)
var/datum/faction/my_new_faction = mastermalf.faction
my_new_faction.HandleRecruitedMind(mind)

View File

@@ -1,14 +1,13 @@
/mob/living/silicon/robot/Login(var/showlaw_override = 0)
/mob/living/silicon/robot/Login()
..()
regenerate_icons()
if(!showlaw_override)
show_laws(0)
if(module)
module.UpdateModuleHolder(src)
if (mind && !stored_freqs && !showlaw_override)
if (mind && !stored_freqs)
spawn(1)
mind.store_memory("Frequencies list: <br/><b>Command:</b> [COMM_FREQ] <br/> <b>Security:</b> [SEC_FREQ] <br/> <b>Medical:</b> [MED_FREQ] <br/> <b>Science:</b> [SCI_FREQ] <br/> <b>Engineering:</b> [ENG_FREQ] <br/> <b>Service:</b> [SER_FREQ] <b>Cargo:</b> [SUP_FREQ]<br/> <b>AI private:</b> [AIPRIV_FREQ]<br/>")
stored_freqs = 1
/mob/living/silicon/robot/shell/Login()
..(1)
/*if(mind)
ticker.mode.remove_revolutionary(mind)
*/

View File

@@ -557,13 +557,13 @@ var/list/cyborg_list = list()
to_chat(user, "The wires get in your way.")
else
if(prob(50))
to_chat(user, "You emag [src]'s interface")
message_admins("[key_name_admin(user)] emagged cyborg [key_name_admin(src)].")
sleep(6)
SetEmagged(TRUE)
SetLockdown(TRUE)
lawupdate = FALSE
disconnect_AI()
to_chat(user, "You emag [src]'s interface")
message_admins("[key_name_admin(user)] emagged cyborg [key_name_admin(src)]. Laws overidden.")
log_game("[key_name(user)] emagged cyborg [key_name(src)]. Laws overridden.")
clear_supplied_laws()
clear_inherent_laws()
@@ -1006,10 +1006,8 @@ var/list/cyborg_list = list()
overlays.Cut()
update_fire()
if(!stat && cell != null)
var/icon/eyesicon = icon(icon,"eyes-[icon_state]", overlay_layer)
eyes = image(eyesicon,"eyes-[icon_state]", overlay_layer)
eyes = image(icon,"eyes-[icon_state]", overlay_layer)
eyes.plane = overlay_plane
overlays += eyes
if(opened)
@@ -1344,155 +1342,3 @@ var/list/cyborg_list = list()
//Currently only used for borg movement, to avoid awkward situations where borgs with RTG or basic cells are always slowed down
/mob/living/silicon/robot/proc/get_percentage_power_for_movement()
return clamp(round(cell.maxcharge/4), 0, SILI_LOW_TRIGGER)
//AI Shell Control
/mob/living/silicon/robot/shell
var/is_being_controlled = FALSE //Is the shell being controlled right now
var/mob/living/silicon/ai/mainframe = null //The AI the shell belongs to.
var/datum/action/undeployment/undeployment_action = new
var/datum/action/detonate/destroy_action = new
var/last_swap = 0
braintype = "AI Shell"
/mob/living/silicon/robot/shell/proc/set_mainframe(mob/living/silicon/ai/A)
connected_ai = A
real_name = "Shell of [A.name]"
name = real_name
mainframe = A
mainframe.connected_robots |= src
if(radio) //Recalculate the radio channel
radio.channels = mainframe.radio.channels
radio.keyslot = new /obj/item/device/encryptionkey/ai
radio.recalculateChannels()
radio.subspace_transmission = TRUE
/mob/living/silicon/robot/shell/proc/deploy() //called right after the AI pops into the shell.
if(is_being_controlled || mainframe.is_in_shell)
message_admins("AI/SHELL Error: Deploy() called while is_being_controlled or is_in_shell was set to true")
return
if(last_swap + 10 > world.time)
to_chat(mainframe, "<span class='warning'>Processors rebooting, please wait before redeploying.</span>")
return
to_chat(mainframe, "Taking control of cyborg shell...")
mainframe.mind.transfer_to(src)
mainframe.is_in_shell = 1
is_being_controlled = 1
lawupdate = TRUE
lawsync()
undeployment_action.Grant(src)
destroy_action.Grant(src)
updateicon()
playsound_local(src, 'sound/machines/paistartup.ogg', 50)
last_swap = world.time
/datum/action/undeployment
name = "Disconnect from shell"
desc = "Stop controlling your shell and resume normal core operations."
icon_icon = 'icons/mob/AI.dmi'
button_icon_state = "ai"
/datum/action/undeployment/UpdateButtonIcon()
var/mob/living/silicon/robot/shell/R = owner
if(R.mainframe)
button_icon_state = "[R.mainframe.icon_state]"
else
button_icon_state = "ai"
..()
/datum/action/undeployment/Trigger()
if(!..())
return FALSE
var/mob/living/silicon/robot/shell/R = owner
R.undeploy()
return TRUE
/mob/living/silicon/robot/shell/proc/undeploy()
if(!is_being_controlled || !mind || !mainframe)
return
if(last_swap + 10 > world.time)
to_chat(src, "<span class='warning'>Processors rebooting, please wait before undeploying.</span>")
return
is_being_controlled = 0
mainframe.is_in_shell = 0
to_chat(src,"Releasing control of cyborg shell...")
mind.transfer_to(mainframe)
undeployment_action.Remove(src)
destroy_action.Remove(src)
if(mainframe.eyeobj)
mainframe.eyeobj.forceMove(loc)
updateicon()
last_swap = world.time
/mob/living/silicon/robot/shell/proc/close_connection()
undeploy()
if(mainframe)
mainframe.shell = null
mainframe = null
/mob/living/silicon/robot/shell/connect_AI()
to_chat(mainframe, "<span class='notice' style=\"font-family:Courier\">Notice: Connection to cyborg shell re-established.</span>" )
SetLockdown(FALSE)
/mob/living/silicon/robot/shell/disconnect_AI()
to_chat(src, "<span class='alert' style=\"font-family:Courier\">Notice: Connection to cyborg shell has been cut.</span>")
SetLockdown(TRUE)
/mob/living/silicon/robot/shell/emag_act(mob/user as mob)
if(user != src)
spark(src, 5, FALSE)
if(!opened)
if(locked)
if(prob(90))
to_chat(user, "You emag the cover lock.")
locked = FALSE
else
to_chat(user, "You fail to emag the cover lock.")
if(prob(25))
to_chat(src, "<span class='danger'><span style=\"font-family:Courier\">Hack attempt detected.</span>")
else
to_chat(user, "The cover is already open.")
else
if(emagged)
return TRUE
if(wiresexposed)
to_chat(user, "The wires get in your way.")
else
if(prob(50))
to_chat(user, "You emag [src]'s interface")
message_admins("[key_name_admin(user)] emagged AI-Cyborg shell [key_name_admin(src)] and destroyed it.")
sleep(6)
gib()
else
to_chat(user, "You fail to unlock [src]'s interface.")
if(prob(25))
to_chat(src, "<span class='danger'><span style=\"font-family:Courier\">Hack attempt detected.</span>")
return TRUE
/mob/living/silicon/robot/shell/updateicon(var/overlay_layer = ABOVE_LIGHTING_LAYER, var/overlay_plane = LIGHTING_PLANE)
..(overlay_layer, overlay_plane)
overlays.Cut()
if(!stat && cell != null && is_being_controlled)
var/icon/eyesicon = icon(icon,"eyes-[icon_state]", overlay_layer)
eyesicon.Blend(rgb(255,255,255), ICON_ADD)
eyesicon.Blend(rgb(45,45,45), ICON_SUBTRACT)
eyes = image(eyesicon,"eyes-[icon_state]", overlay_layer)
eyes.plane = overlay_plane
overlays += eyes
/mob/living/silicon/robot/shell/updatename()
if(mainframe)
real_name = "Shell of [mainframe.name]"
name = real_name
else
real_name = "AI Shell"
name = real_name
/mob/living/silicon/robot/shell/attack_ai(mob/user)
var/mob/living/silicon/ai/A = user
if(A == mainframe)
deploy()

View File

@@ -118,8 +118,6 @@
/obj/item/weapon/robot_module/proc/AddEncryptionKey(var/mob/living/silicon/robot/R)
if(!R.radio)
return
if(isshell(R))
return
if(radio_key)
R.radio.insert_key(new radio_key(R.radio))

View File

@@ -162,11 +162,3 @@
to_chat(src, "<span class='notice'>Sensor augmentations disabled.</span>")
handle_sensor_modes()
update_sight_hud()
/mob/living/silicon/robot/shell/verb/return_to_core()
set category = "Robot Commands"
set name = "Retun to Core"
undeploy()

View File

@@ -63,7 +63,7 @@
var/computer_id = null
var/lastattacker = null
var/lastattacked = null
var/list/attack_log = list()
var/attack_log = list( )
var/already_placed = 0.0
var/obj/machine
var/other_mobs = null

View File

@@ -946,12 +946,8 @@
src.malfai = usr:parent
else
src.malfai = usr
var/mob/target_malf
target_malf = malfai.is_in_shell ? malfai.shell : malfai
to_chat(target_malf, "Hack complete. The APC is now under your exclusive control. [STATION_Z == z?"You now have [M.apcs] under your control.":"As this APC is not located on the station, it is not contributing to your control of it."]")
target_malf.handle_regular_hud_updates()
to_chat(malfai, "Hack complete. The APC is now under your exclusive control. [STATION_Z == z?"You now have [M.apcs] under your control.":"As this APC is not located on the station, it is not contributing to your control of it."]")
malfai.handle_regular_hud_updates()
update_icon()
else if (href_list["occupyapc"])

View File

@@ -19,17 +19,6 @@
if(ismanifested(M) || iscluwnebanned(M))
visible_message("<span class='caution'>The bolt of change doesn't seem to affect [M] in any way.</span>")
return
if(isshell(M)) //Kick out the AI if its a shell
var/mob/living/silicon/robot/shell/R = M
R.close_connection()
if(isAI(M)) //Force the AI back if its in a shell
var/mob/living/silicon/ai/R = M
if(R.is_in_shell)
R.shell.close_connection()
R.shell.gib() //Destroy the shell, they wont be needing it anymore
var/mob/living/new_mob
// Random chance of fucking up
if(type!=null && prob(10))