mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-20 19:44:09 +01:00
Full Positronic Brain to Robotic Brain Refactor
This commit is contained in:
@@ -823,19 +823,6 @@ var/list/admin_verbs_ticket = list(
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
|
||||
if(!istype(H))
|
||||
if(istype(H, /mob/living/carbon/brain))
|
||||
var/mob/living/carbon/brain/B = H
|
||||
if(istype(B.container, /obj/item/mmi/posibrain/ipc))
|
||||
var/obj/item/mmi/posibrain/ipc/C = B.container
|
||||
var/obj/item/organ/internal/brain/mmi_holder/posibrain/P = C.loc
|
||||
if(istype(P.owner, /mob/living/carbon/human))
|
||||
H = P.owner
|
||||
else
|
||||
return
|
||||
else
|
||||
return
|
||||
|
||||
if(holder)
|
||||
admin_log_and_message_admins("is altering the appearance of [H].")
|
||||
H.change_appearance(APPEARANCE_ALL, usr, usr, check_species_whitelist = 0)
|
||||
@@ -849,19 +836,6 @@ var/list/admin_verbs_ticket = list(
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
|
||||
if(!istype(H))
|
||||
if(istype(H, /mob/living/carbon/brain))
|
||||
var/mob/living/carbon/brain/B = H
|
||||
if(istype(B.container, /obj/item/mmi/posibrain/ipc))
|
||||
var/obj/item/mmi/posibrain/ipc/C = B.container
|
||||
var/obj/item/organ/internal/brain/mmi_holder/posibrain/P = C.loc
|
||||
if(istype(P.owner, /mob/living/carbon/human))
|
||||
H = P.owner
|
||||
else
|
||||
return
|
||||
else
|
||||
return
|
||||
|
||||
if(!H.client)
|
||||
to_chat(usr, "Only mobs with clients can alter their own appearance.")
|
||||
return
|
||||
|
||||
@@ -116,7 +116,7 @@
|
||||
return 1
|
||||
|
||||
// Okay, it wasn't a terminal being touched, check for all the simple insertions.
|
||||
if(input_device.type in list(/obj/item/paicard, /obj/item/mmi, /obj/item/mmi/posibrain))
|
||||
if(input_device.type in list(/obj/item/paicard, /obj/item/mmi, /obj/item/mmi/robotic_brain))
|
||||
if(integrated_ai)
|
||||
integrated_ai.attackby(input_device,user)
|
||||
// If the transfer was successful, we can clear out our vars.
|
||||
|
||||
@@ -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)
|
||||
|
||||
+28
-34
@@ -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>")
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -103,15 +103,15 @@
|
||||
build_path = /obj/item/mass_spectrometer
|
||||
category = list("Medical")
|
||||
|
||||
/datum/design/posibrain
|
||||
/datum/design/robotic_brain
|
||||
name = "Robotic Brain"
|
||||
desc = "The latest in Artificial Intelligences."
|
||||
id = "mmi_posi"
|
||||
desc = "The latest in non-sentient Artificial Intelligences."
|
||||
id = "mmi_robotic"
|
||||
req_tech = list("programming" = 5, "biotech" = 4, "plasmatech" = 3)
|
||||
build_type = PROTOLATHE | MECHFAB
|
||||
materials = list(MAT_METAL = 1700, MAT_GLASS = 1350, MAT_GOLD = 500) //Gold, because SWAG.
|
||||
construction_time = 75
|
||||
build_path = /obj/item/mmi/posibrain
|
||||
build_path = /obj/item/mmi/robotic_brain
|
||||
category = list("Misc","Medical")
|
||||
|
||||
/datum/design/mmi_radio_upgrade
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
// Used for an MMI or robotic brain being installed into a human.
|
||||
/obj/item/organ/internal/brain/mmi_holder
|
||||
name = "Man-Machine Interface"
|
||||
parent_organ = "chest"
|
||||
status = ORGAN_ROBOT
|
||||
var/obj/item/mmi/stored_mmi
|
||||
|
||||
/obj/item/organ/internal/brain/mmi_holder/Destroy()
|
||||
QDEL_NULL(stored_mmi)
|
||||
return ..()
|
||||
|
||||
/obj/item/organ/internal/brain/mmi_holder/insert(mob/living/target, special = 0)
|
||||
..()
|
||||
// To supersede the over-writing of the MMI's name from `insert`
|
||||
update_from_mmi()
|
||||
|
||||
/obj/item/organ/internal/brain/mmi_holder/remove(mob/living/user, special = 0)
|
||||
if(!special)
|
||||
if(stored_mmi)
|
||||
. = stored_mmi
|
||||
if(owner.mind)
|
||||
owner.mind.transfer_to(stored_mmi.brainmob)
|
||||
stored_mmi.forceMove(get_turf(owner))
|
||||
stored_mmi = null
|
||||
..()
|
||||
if(!QDELETED(src))
|
||||
qdel(src)
|
||||
|
||||
/obj/item/organ/internal/brain/mmi_holder/proc/update_from_mmi()
|
||||
if(!stored_mmi)
|
||||
return
|
||||
name = stored_mmi.name
|
||||
desc = stored_mmi.desc
|
||||
icon = stored_mmi.icon
|
||||
icon_state = stored_mmi.icon_state
|
||||
set_dna(stored_mmi.brainmob.dna)
|
||||
@@ -136,60 +136,12 @@
|
||||
|
||||
. = ..()
|
||||
|
||||
// Used for an MMI or posibrain being installed into a human.
|
||||
/obj/item/organ/internal/brain/mmi_holder
|
||||
name = "brain"
|
||||
organ_tag = "brain"
|
||||
/obj/item/organ/internal/brain/posibrain
|
||||
name = "positronic 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-occupied"
|
||||
dead_icon = "posibrain"
|
||||
parent_organ = "chest"
|
||||
vital = TRUE
|
||||
max_damage = 200
|
||||
slot = "brain"
|
||||
status = ORGAN_ROBOT
|
||||
species = "Machine"
|
||||
var/obj/item/mmi/stored_mmi
|
||||
|
||||
/obj/item/organ/internal/brain/mmi_holder/Destroy()
|
||||
QDEL_NULL(stored_mmi)
|
||||
return ..()
|
||||
|
||||
/obj/item/organ/internal/brain/mmi_holder/insert(var/mob/living/target,special = 0)
|
||||
..()
|
||||
// To supersede the over-writing of the MMI's name from `insert`
|
||||
update_from_mmi()
|
||||
|
||||
/obj/item/organ/internal/brain/mmi_holder/remove(var/mob/living/user,special = 0)
|
||||
if(!special)
|
||||
if(stored_mmi)
|
||||
. = stored_mmi
|
||||
if(owner.mind)
|
||||
owner.mind.transfer_to(stored_mmi.brainmob)
|
||||
stored_mmi.forceMove(get_turf(owner))
|
||||
stored_mmi = null
|
||||
..()
|
||||
if(!QDELETED(src))
|
||||
qdel(src)
|
||||
|
||||
/obj/item/organ/internal/brain/mmi_holder/proc/update_from_mmi()
|
||||
if(!stored_mmi)
|
||||
return
|
||||
name = stored_mmi.name
|
||||
desc = stored_mmi.desc
|
||||
icon = stored_mmi.icon
|
||||
icon_state = stored_mmi.icon_state
|
||||
set_dna(stored_mmi.brainmob.dna)
|
||||
|
||||
/obj/item/organ/internal/brain/mmi_holder/posibrain/New()
|
||||
robotize()
|
||||
stored_mmi = new /obj/item/mmi/posibrain/ipc(src)
|
||||
..()
|
||||
spawn(1)
|
||||
if(!QDELETED(src))
|
||||
if(owner)
|
||||
stored_mmi.name = "positronic brain ([owner.real_name])"
|
||||
stored_mmi.brainmob.real_name = owner.real_name
|
||||
stored_mmi.brainmob.name = stored_mmi.brainmob.real_name
|
||||
stored_mmi.icon_state = "posibrain-occupied"
|
||||
update_from_mmi()
|
||||
else
|
||||
stored_mmi.loc = get_turf(src)
|
||||
qdel(src)
|
||||
species = "Machine"
|
||||
Reference in New Issue
Block a user