mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-13 11:43:31 +00:00
Merge pull request #2863 from Anewbe/brains_and_such
Circuits should work like posibrains now
This commit is contained in:
@@ -1,23 +1,5 @@
|
||||
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32
|
||||
|
||||
/obj/item/device/mmi/digital/New()
|
||||
src.brainmob = new(src)
|
||||
src.brainmob.add_language("Robot Talk")
|
||||
src.brainmob.add_language("Encoded Audio Language")
|
||||
src.brainmob.loc = src
|
||||
src.brainmob.container = src
|
||||
src.brainmob.stat = 0
|
||||
src.brainmob.silent = 0
|
||||
dead_mob_list -= src.brainmob
|
||||
|
||||
/obj/item/device/mmi/digital/transfer_identity(var/mob/living/carbon/H)
|
||||
brainmob.dna = H.dna
|
||||
brainmob.timeofhostdeath = H.timeofdeath
|
||||
brainmob.stat = 0
|
||||
if(H.mind)
|
||||
H.mind.transfer_to(brainmob)
|
||||
return
|
||||
|
||||
/obj/item/device/mmi
|
||||
name = "man-machine interface"
|
||||
desc = "The Warrior's bland acronym, MMI, obscures the true horror of this monstrosity."
|
||||
@@ -35,7 +17,7 @@
|
||||
var/obj/item/organ/internal/brain/brainobj = null //The current brain organ.
|
||||
var/obj/mecha = null//This does not appear to be used outside of reference in mecha.dm.
|
||||
|
||||
attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
/obj/item/device/mmi/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
if(istype(O,/obj/item/organ/internal/brain) && !brainmob) //Time to stick a brain in it --NEO
|
||||
|
||||
var/obj/item/organ/internal/brain/B = O
|
||||
@@ -82,7 +64,7 @@
|
||||
..()
|
||||
|
||||
//TODO: ORGAN REMOVAL UPDATE. Make the brain remain in the MMI so it doesn't lose organ data.
|
||||
attack_self(mob/user as mob)
|
||||
/obj/item/device/mmi/attack_self(mob/user as mob)
|
||||
if(!brainmob)
|
||||
user << "<span class='warning'>You upend the MMI, but there's nothing in it.</span>"
|
||||
else if(locked)
|
||||
@@ -105,8 +87,7 @@
|
||||
icon_state = "mmi_empty"
|
||||
name = "Man-Machine Interface"
|
||||
|
||||
proc
|
||||
transfer_identity(var/mob/living/carbon/human/H)//Same deal as the regular brain proc. Used for human-->robot people.
|
||||
/obj/item/device/mmi/proc/transfer_identity(var/mob/living/carbon/human/H)//Same deal as the regular brain proc. Used for human-->robot people.
|
||||
brainmob = new(src)
|
||||
brainmob.name = H.real_name
|
||||
brainmob.real_name = H.real_name
|
||||
@@ -185,3 +166,176 @@
|
||||
if(3)
|
||||
brainmob.emp_damage += rand(0,10)
|
||||
..()
|
||||
|
||||
/obj/item/device/mmi/digital
|
||||
var/searching = 0
|
||||
var/askDelay = 10 * 60 * 1
|
||||
req_access = list(access_robotics)
|
||||
locked = 0
|
||||
mecha = null//This does not appear to be used outside of reference in mecha.dm.
|
||||
|
||||
/obj/item/device/mmi/digital/New()
|
||||
src.brainmob = new(src)
|
||||
src.brainmob.add_language("Robot Talk")
|
||||
src.brainmob.add_language("Encoded Audio Language")
|
||||
src.brainmob.loc = src
|
||||
src.brainmob.container = src
|
||||
src.brainmob.stat = 0
|
||||
src.brainmob.silent = 0
|
||||
dead_mob_list -= src.brainmob
|
||||
|
||||
/obj/item/device/mmi/digital/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
return //Doesn't do anything right now because none of the things that can be done to a regular MMI make any sense for these
|
||||
|
||||
/obj/item/device/mmi/digital/examine(mob/user)
|
||||
if(!..(user))
|
||||
return
|
||||
|
||||
var/msg = "<span class='info'>*---------*</span>\nThis is \icon[src] \a <EM>[src]</EM>!\n[desc]\n"
|
||||
msg += "<span class='warning'>"
|
||||
|
||||
if(src.brainmob && src.brainmob.key)
|
||||
switch(src.brainmob.stat)
|
||||
if(CONSCIOUS)
|
||||
if(!src.brainmob.client) msg += "It appears to be in stand-by mode.\n" //afk
|
||||
if(UNCONSCIOUS) msg += "<span class='warning'>It doesn't seem to be responsive.</span>\n"
|
||||
if(DEAD) msg += "<span class='deadsay'>It appears to be completely inactive.</span>\n"
|
||||
else
|
||||
msg += "<span class='deadsay'>It appears to be completely inactive.</span>\n"
|
||||
msg += "</span><span class='info'>*---------*</span>"
|
||||
user << msg
|
||||
return
|
||||
|
||||
/obj/item/device/mmi/digital/emp_act(severity)
|
||||
if(!src.brainmob)
|
||||
return
|
||||
else
|
||||
switch(severity)
|
||||
if(1)
|
||||
src.brainmob.emp_damage += rand(20,30)
|
||||
if(2)
|
||||
src.brainmob.emp_damage += rand(10,20)
|
||||
if(3)
|
||||
src.brainmob.emp_damage += rand(0,10)
|
||||
..()
|
||||
|
||||
/obj/item/device/mmi/digital/transfer_identity(var/mob/living/carbon/H)
|
||||
brainmob.dna = H.dna
|
||||
brainmob.timeofhostdeath = H.timeofdeath
|
||||
brainmob.stat = 0
|
||||
if(H.mind)
|
||||
H.mind.transfer_to(brainmob)
|
||||
return
|
||||
|
||||
/obj/item/device/mmi/digital/attack_self(mob/user as mob)
|
||||
if(brainmob && !brainmob.key && searching == 0)
|
||||
//Start the process of searching for a new user.
|
||||
user << "\blue You carefully locate the manual activation switch and start the [src]'s boot process."
|
||||
src.searching = 1
|
||||
src.request_player()
|
||||
spawn(600) reset_search()
|
||||
|
||||
/obj/item/device/mmi/digital/proc/request_player()
|
||||
for(var/mob/observer/dead/O in player_list)
|
||||
if(!O.MayRespawn())
|
||||
continue
|
||||
if(jobban_isbanned(O, "AI") && jobban_isbanned(O, "Cyborg"))
|
||||
continue
|
||||
if(O.client)
|
||||
if(O.client.prefs.be_special & BE_AI)
|
||||
question(O.client)
|
||||
|
||||
/obj/item/device/mmi/digital/proc/reset_search() //We give the players sixty seconds to decide, then reset the timer.
|
||||
|
||||
if(src.brainmob && src.brainmob.key) return
|
||||
world.log << "Resetting [src.name]: [brainmob][brainmob ? ", [brainmob.key]" : ""]"
|
||||
|
||||
src.searching = 0
|
||||
|
||||
var/turf/T = get_turf_or_move(src.loc)
|
||||
for (var/mob/M in viewers(T))
|
||||
M.show_message("\blue The [src] buzzes quietly, and the golden lights fade away. Perhaps you could try again?")
|
||||
|
||||
/obj/item/device/mmi/digital/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")
|
||||
if(response == "Yes")
|
||||
response = alert(C, "Are you sure you want to play as a [src]?", "[src] request", "Yes", "No")
|
||||
if(!C || brainmob.key || 0 == searching) return //handle logouts that happen whilst the alert is waiting for a response, and responses issued after a brain has been located.
|
||||
if(response == "Yes")
|
||||
transfer_personality(C.mob)
|
||||
else if (response == "Never for this round")
|
||||
C.prefs.be_special ^= BE_AI
|
||||
|
||||
/obj/item/device/mmi/digital/proc/transfer_personality(var/mob/candidate)
|
||||
announce_ghost_joinleave(candidate, 0, "They are occupying a synthetic brain now.")
|
||||
src.searching = 0
|
||||
src.brainmob.mind = candidate.mind
|
||||
src.brainmob.ckey = candidate.ckey
|
||||
src.brainmob.mind.reset()
|
||||
src.name = "positronic brain ([src.brainmob.name])"
|
||||
src.brainmob << "<b>You are a [src], brought into existence on [station_name()].</b>"
|
||||
src.brainmob << "<b>As a synthetic intelligence, you answer to all crewmembers, as well as the AI.</b>"
|
||||
src.brainmob << "<b>Remember, the purpose of your existence is to serve the crew and the station. Above all else, do no harm.</b>"
|
||||
src.brainmob << "<b>Use say #b to speak to other artificial intelligences.</b>"
|
||||
src.brainmob.mind.assigned_role = "Positronic Brain"
|
||||
|
||||
var/turf/T = get_turf_or_move(src.loc)
|
||||
for (var/mob/M in viewers(T))
|
||||
M.show_message("\blue The [src] chimes quietly.")
|
||||
|
||||
/obj/item/device/mmi/digital/robot
|
||||
name = "robotic intelligence circuit"
|
||||
desc = "The pinnacle of artifical intelligence which can be achieved using classical computer science."
|
||||
icon = 'icons/obj/module.dmi'
|
||||
icon_state = "mainboard"
|
||||
w_class = ITEMSIZE_NORMAL
|
||||
origin_tech = list(TECH_ENGINEERING = 4, TECH_MATERIAL = 3, TECH_DATA = 4)
|
||||
|
||||
/obj/item/device/mmi/digital/robot/New()
|
||||
..()
|
||||
src.brainmob.name = "[pick(list("ADA","DOS","GNU","MAC","WIN"))]-[rand(1000, 9999)]"
|
||||
src.brainmob.real_name = src.brainmob.name
|
||||
src.name = "robotic intelligence circuit ([src.brainmob.name])"
|
||||
|
||||
/obj/item/device/mmi/digital/robot/transfer_identity(var/mob/living/carbon/H)
|
||||
..()
|
||||
if(brainmob.mind)
|
||||
brainmob.mind.assigned_role = "Robotic Intelligence"
|
||||
brainmob << "<span class='notify'>You feel slightly disoriented. That's normal when you're little more than a complex circuit.</span>"
|
||||
return
|
||||
|
||||
/obj/item/device/mmi/digital/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"
|
||||
w_class = ITEMSIZE_NORMAL
|
||||
origin_tech = list(TECH_ENGINEERING = 4, TECH_MATERIAL = 4, TECH_BLUESPACE = 2, TECH_DATA = 4)
|
||||
|
||||
/obj/item/device/mmi/digital/posibrain/attack_self(mob/user as mob)
|
||||
..()
|
||||
icon_state = "posibrain-searching"
|
||||
|
||||
|
||||
/obj/item/device/mmi/digital/posibrain/transfer_identity(var/mob/living/carbon/H)
|
||||
..()
|
||||
if(brainmob.mind)
|
||||
brainmob.mind.assigned_role = "Positronic Brain"
|
||||
brainmob << "<span class='notify'>You feel slightly disoriented. That's normal when you're just a metal cube.</span>"
|
||||
icon_state = "posibrain-occupied"
|
||||
return
|
||||
|
||||
/obj/item/device/mmi/digital/posibrain/transfer_personality(var/mob/candidate)
|
||||
..()
|
||||
icon_state = "posibrain-occupied"
|
||||
|
||||
/obj/item/device/mmi/digital/posibrain/reset_search() //We give the players sixty seconds to decide, then reset the timer.
|
||||
..()
|
||||
icon_state = "posibrain"
|
||||
|
||||
/obj/item/device/mmi/digital/posibrain/New()
|
||||
..()
|
||||
src.brainmob.name = "[pick(list("PBU","HIU","SINA","ARMA","OSI"))]-[rand(100, 999)]"
|
||||
src.brainmob.real_name = src.brainmob.name
|
||||
|
||||
@@ -1536,8 +1536,6 @@
|
||||
#include "code\modules\mob\living\carbon\brain\life.dm"
|
||||
#include "code\modules\mob\living\carbon\brain\login.dm"
|
||||
#include "code\modules\mob\living\carbon\brain\MMI.dm"
|
||||
#include "code\modules\mob\living\carbon\brain\posibrain.dm"
|
||||
#include "code\modules\mob\living\carbon\brain\robot.dm"
|
||||
#include "code\modules\mob\living\carbon\brain\say.dm"
|
||||
#include "code\modules\mob\living\carbon\human\appearance.dm"
|
||||
#include "code\modules\mob\living\carbon\human\death.dm"
|
||||
|
||||
Reference in New Issue
Block a user