Full Positronic Brain to Robotic Brain Refactor

This commit is contained in:
Fox McCloud
2018-07-12 19:30:48 -04:00
parent 665c0062b3
commit 67d12c0aa6
18 changed files with 98 additions and 143 deletions
@@ -265,8 +265,6 @@
forceMove(holder)
holder.stored_mmi = src
holder.update_from_mmi()
if(istype(src, /obj/item/mmi/posibrain))
holder.robotize()
if(brainmob && brainmob.mind)
brainmob.mind.transfer_to(H)
holder.insert(H)
@@ -1,8 +1,8 @@
/obj/item/mmi/posibrain
/obj/item/mmi/robotic_brain
name = "robotic brain"
desc = "A cube of shining metal, four inches to a side and covered in shallow grooves."
icon = 'icons/obj/assemblies.dmi'
icon_state = "posibrain"
desc = "An advanced circuit, capable of housing an advanced non-sentient synthetic intelligence."
icon = 'icons/obj/module.dmi'
icon_state = "boris_blank"
w_class = WEIGHT_CLASS_NORMAL
origin_tech = "biotech=3;programming=3;plasmatech=2"
@@ -17,11 +17,11 @@
var/requires_master = TRUE
var/mob/living/carbon/human/imprinted_master = null
/obj/item/mmi/posibrain/Destroy()
/obj/item/mmi/robotic_brain/Destroy()
imprinted_master = null
return ..()
/obj/item/mmi/posibrain/attack_self(mob/user)
/obj/item/mmi/robotic_brain/attack_self(mob/user)
if(requires_master && !imprinted_master)
to_chat(user, "<span class='notice'>You press your thumb on [src] and imprint your user information.</span>")
imprinted_master = user
@@ -29,7 +29,7 @@
if(brainmob && !brainmob.key && searching == 0)
//Start the process of searching for a new user.
to_chat(user, "<span class='notice'>You carefully locate the manual activation switch and start [src]'s boot process.</span>")
icon_state = "posibrain-searching"
icon_state = "boris_recharging"
ghost_volunteers.Cut()
searching = 1
request_player()
@@ -47,12 +47,12 @@
if(brainmob && brainmob.key)
to_chat(brainmob, "<span class='warning'>Your internal speaker has been toggled [silenced ? "off" : "on"].</span>")
/obj/item/mmi/posibrain/proc/request_player()
/obj/item/mmi/robotic_brain/proc/request_player()
for(var/mob/dead/observer/O in player_list)
if(check_observer(O))
to_chat(O, "<span class='boldnotice'>\A [src] has been activated. (<a href='?src=[O.UID()];jump=\ref[src]'>Teleport</a> | <a href='?src=[UID()];signup=\ref[O]'>Sign Up</a>)</span>")
/obj/item/mmi/posibrain/proc/check_observer(var/mob/dead/observer/O)
/obj/item/mmi/robotic_brain/proc/check_observer(var/mob/dead/observer/O)
if(cannotPossess(O))
return 0
if(jobban_isbanned(O, "Cyborg") || jobban_isbanned(O,"nonhumandept"))
@@ -63,7 +63,7 @@
return 1
return 0
/obj/item/mmi/posibrain/proc/question(var/client/C)
/obj/item/mmi/robotic_brain/proc/question(var/client/C)
spawn(0)
if(!C) return
var/response = alert(C, "Someone is requesting a personality for a [src]. Would you like to play as one?", "[src] request", "Yes", "No", "Never for this round")
@@ -74,11 +74,11 @@
C.prefs.be_special -= ROLE_POSIBRAIN
// This should not ever happen, but let's be safe
/obj/item/mmi/posibrain/dropbrain(var/turf/dropspot)
/obj/item/mmi/robotic_brain/dropbrain(var/turf/dropspot)
log_runtime(EXCEPTION("[src] at [loc] attempted to drop brain without a contained brain."), src)
return
/obj/item/mmi/posibrain/transfer_identity(var/mob/living/carbon/H)
/obj/item/mmi/robotic_brain/transfer_identity(var/mob/living/carbon/H)
name = "[src] ([H])"
if(isnull(brainmob.dna))
brainmob.dna = H.dna.Clone()
@@ -90,51 +90,51 @@
brainmob.mind.assigned_role = "Positronic Brain"
if(H.mind)
H.mind.transfer_to(brainmob)
to_chat(brainmob, "<span class='notice'>You feel slightly disoriented. That's normal when you're just a metal cube.</span>")
become_occupied("posibrain-occupied")
to_chat(brainmob, "<span class='notice'>You feel slightly disoriented. That's normal when you're just a circuit.</span>")
become_occupied("boris")
if(radio)
radio_action.ApplyIcon()
return
/obj/item/mmi/posibrain/attempt_become_organ(obj/item/organ/external/parent, mob/living/carbon/human/H)
/obj/item/mmi/robotic_brain/attempt_become_organ(obj/item/organ/external/parent, mob/living/carbon/human/H)
if(..())
if(imprinted_master)
to_chat(H, "<span class='biggerdanger'>You are permanently imprinted to [imprinted_master], obey [imprinted_master]'s every order and assist [imprinted_master.p_them()] in completing [imprinted_master.p_their()] goals at any cost.</span>")
/obj/item/mmi/posibrain/proc/transfer_personality(mob/candidate)
/obj/item/mmi/robotic_brain/proc/transfer_personality(mob/candidate)
searching = 0
brainmob.key = candidate.key
name = "[src] ([brainmob.name])"
to_chat(brainmob, "<b>You are a [src], brought into existence on [station_name()].</b>")
to_chat(brainmob, "<b>As a synthetic intelligence, you answer to [imprinted_master], unless otherwise placed inside of a lawed synthetic structure or mech.</b>")
to_chat(brainmob, "<b>As a non-sentient synthetic intelligence, you answer to [imprinted_master], unless otherwise placed inside of a lawed synthetic structure or mech.</b>")
to_chat(brainmob, "<b>Remember, the purpose of your existence is to serve [imprinted_master]'s every word, unless lawed or placed into a mech in the future.</b>")
brainmob.mind.assigned_role = "Positronic Brain"
var/turf/T = get_turf_or_move(loc)
for(var/mob/M in viewers(T))
M.show_message("<span class='notice'>[src] chimes quietly.</span>")
become_occupied("posibrain-occupied")
become_occupied("boris")
/obj/item/mmi/posibrain/proc/reset_search() //We give the players sixty seconds to decide, then reset the timer.
/obj/item/mmi/robotic_brain/proc/reset_search() //We give the players sixty seconds to decide, then reset the timer.
if(src.brainmob && src.brainmob.key) return
src.searching = 0
icon_state = "posibrain"
icon_state = "boris_blank"
var/turf/T = get_turf_or_move(src.loc)
for(var/mob/M in viewers(T))
M.show_message("<span class='notice'>The [src] buzzes quietly, and the golden lights fade away. Perhaps you could try again?</span>")
M.show_message("<span class='notice'>[src] buzzes quietly as the red light fades out. Perhaps you could try again?</span>")
/obj/item/mmi/posibrain/Topic(href,href_list)
/obj/item/mmi/robotic_brain/Topic(href,href_list)
if("signup" in href_list)
var/mob/dead/observer/O = locate(href_list["signup"])
if(!O) return
volunteer(O)
/obj/item/mmi/posibrain/proc/volunteer(var/mob/dead/observer/O)
/obj/item/mmi/robotic_brain/proc/volunteer(var/mob/dead/observer/O)
if(!searching)
to_chat(O, "Not looking for a ghost, yet.")
return
@@ -158,7 +158,7 @@
ghost_volunteers.Add(O)
/obj/item/mmi/posibrain/examine(mob/user)
/obj/item/mmi/robotic_brain/examine(mob/user)
to_chat(user, "Its speaker is turned [silenced ? "off" : "on"].")
to_chat(user, "<span class='info'>*---------*</span>")
. = ..()
@@ -179,7 +179,7 @@
msg += "*---------*</span>"
to_chat(user, msg.Join(""))
/obj/item/mmi/posibrain/emp_act(severity)
/obj/item/mmi/robotic_brain/emp_act(severity)
if(!src.brainmob)
return
else
@@ -192,7 +192,7 @@
src.brainmob.emp_damage += rand(0,10)
..()
/obj/item/mmi/posibrain/New()
/obj/item/mmi/robotic_brain/New()
src.brainmob = new(src)
src.brainmob.name = "[pick(list("PBU","HIU","SINA","ARMA","OSI"))]-[rand(100, 999)]"
src.brainmob.real_name = src.brainmob.name
@@ -204,7 +204,7 @@
..()
/obj/item/mmi/posibrain/attack_ghost(var/mob/dead/observer/O)
/obj/item/mmi/robotic_brain/attack_ghost(var/mob/dead/observer/O)
if(searching)
volunteer(O)
return
@@ -215,10 +215,4 @@
playsound(get_turf(src), 'sound/items/posiping.ogg', 80, 0)
var/turf/T = get_turf_or_move(src.loc)
for(var/mob/M in viewers(T))
M.show_message("<span class='notice'>[src] pings softly.</span>")
/obj/item/mmi/posibrain/ipc
name = "positronic brain"
desc = "A cube of shining metal, four inches to a side and covered in shallow grooves."
silenced = 1
requires_master = FALSE
M.show_message("<span class='notice'>[src] pings softly.</span>")
+3 -3
View File
@@ -22,9 +22,9 @@
if(!istype(container, /obj/item/mmi))
. = FALSE
else if(istype(container, /obj/item/mmi/posibrain))
var/obj/item/mmi/posibrain/P = container
if(P && P.silenced)
else if(istype(container, /obj/item/mmi/robotic_brain))
var/obj/item/mmi/robotic_brain/R = container
if(R && R.silenced)
if(warning)
to_chat(usr, "<span class='warning'>You cannot speak, as your internal speaker is turned off.</span>")
. = FALSE
@@ -958,7 +958,7 @@
butt_sprite = "machine"
has_organ = list(
"brain" = /obj/item/organ/internal/brain/mmi_holder/posibrain,
"brain" = /obj/item/organ/internal/brain/posibrain,
"cell" = /obj/item/organ/internal/cell,
"optics" = /obj/item/organ/internal/eyes/optical_sensor, //Default darksight of 2.
"charger" = /obj/item/organ/internal/cyberimp/arm/power_cord
@@ -131,8 +131,8 @@ var/list/robot_verbs_default = list(
camera.status = 0
if(mmi == null)
mmi = new /obj/item/mmi/posibrain(src) //Give the borg an MMI if he spawns without for some reason. (probably not the correct way to spawn a posibrain, but it works)
mmi.icon_state="posibrain-occupied"
mmi = new /obj/item/mmi/robotic_brain(src) //Give the borg an MMI if he spawns without for some reason. (probably not the correct way to spawn a robotic brain, but it works)
mmi.icon_state = "boris"
initialize_components()
//if(!unfinished)
@@ -210,7 +210,7 @@ var/list/robot_verbs_default = list(
if(prefix)
modtype = prefix
if(mmi)
if(istype(mmi, /obj/item/mmi/posibrain))
if(istype(mmi, /obj/item/mmi/robotic_brain))
braintype = "Android"
else
braintype = "Cyborg"
@@ -157,7 +157,7 @@
if(istype(mmi, /obj/item/mmi))
icon_state = "spiderbot-chassis-mmi"
icon_living = "spiderbot-chassis-mmi"
if(istype(mmi, /obj/item/mmi/posibrain))
if(istype(mmi, /obj/item/mmi/robotic_brain))
icon_state = "spiderbot-chassis-posi"
icon_living = "spiderbot-chassis-posi"
+1 -1
View File
@@ -86,7 +86,7 @@
if(O.mind && O.mind.assigned_role == "Cyborg")
if(O.mind.role_alt_title == "Android")
O.mmi = new /obj/item/mmi/posibrain(O)
O.mmi = new /obj/item/mmi/robotic_brain(O)
else if(O.mind.role_alt_title == "Robot")
O.mmi = null //Robots do not have removable brains.
else