Kills off /obj/item/device (#6561)

This commit is contained in:
kevinz000
2018-04-29 22:06:58 -07:00
committed by Poojawa
parent ab3035a4ea
commit 3369c804b2
538 changed files with 6728 additions and 6707 deletions
+17 -17
View File
@@ -1,11 +1,11 @@
/obj/item/device/mmi
/obj/item/mmi
name = "Man-Machine Interface"
desc = "The Warrior's bland acronym, MMI, obscures the true horror of this monstrosity, that nevertheless has become standard-issue on Nanotrasen stations."
icon = 'icons/obj/assemblies.dmi'
icon_state = "mmi_off"
w_class = WEIGHT_CLASS_NORMAL
var/braintype = "Cyborg"
var/obj/item/device/radio/radio = null //Let's give it a radio.
var/obj/item/radio/radio = null //Let's give it a radio.
var/mob/living/brain/brainmob = null //The current occupant.
var/mob/living/silicon/robot = null //Appears unused.
var/obj/mecha = null //This does not appear to be used outside of reference in mecha.dm.
@@ -14,7 +14,7 @@
var/force_replace_ai_name = FALSE
var/overrides_aicore_laws = FALSE // Whether the laws on the MMI, if any, override possible pre-existing laws loaded on the AI core.
/obj/item/device/mmi/update_icon()
/obj/item/mmi/update_icon()
if(!brain)
icon_state = "mmi_off"
return
@@ -29,13 +29,13 @@
else
add_overlay("mmi_dead")
/obj/item/device/mmi/Initialize()
/obj/item/mmi/Initialize()
. = ..()
radio = new(src) //Spawns a radio inside the MMI.
radio.broadcasting = 0 //researching radio mmis turned the robofabs into radios because this didnt start as 0.
laws.set_laws_config()
/obj/item/device/mmi/attackby(obj/item/O, mob/user, params)
/obj/item/mmi/attackby(obj/item/O, mob/user, params)
user.changeNext_move(CLICK_CD_MELEE)
if(istype(O, /obj/item/organ/brain)) //Time to stick a brain in it --NEO
var/obj/item/organ/brain/newbrain = O
@@ -76,7 +76,7 @@
return ..()
/obj/item/device/mmi/attack_self(mob/user)
/obj/item/mmi/attack_self(mob/user)
if(!brain)
radio.on = !radio.on
to_chat(user, "<span class='notice'>You toggle the MMI's radio system [radio.on==1 ? "on" : "off"].</span>")
@@ -86,7 +86,7 @@
update_icon()
name = "Man-Machine Interface"
/obj/item/device/mmi/proc/eject_brain(mob/user)
/obj/item/mmi/proc/eject_brain(mob/user)
brainmob.container = null //Reset brainmob mmi var.
brainmob.forceMove(brain) //Throw mob into brain.
brainmob.stat = DEAD
@@ -103,7 +103,7 @@
brain = null //No more brain in here
/obj/item/device/mmi/proc/transfer_identity(mob/living/L) //Same deal as the regular brain proc. Used for human-->robot people.
/obj/item/mmi/proc/transfer_identity(mob/living/L) //Same deal as the regular brain proc. Used for human-->robot people.
if(!brainmob)
brainmob = new(src)
brainmob.name = L.real_name
@@ -128,10 +128,10 @@
update_icon()
return
/obj/item/device/mmi/proc/replacement_ai_name()
/obj/item/mmi/proc/replacement_ai_name()
return brainmob.name
/obj/item/device/mmi/verb/Toggle_Listening()
/obj/item/mmi/verb/Toggle_Listening()
set name = "Toggle Listening"
set desc = "Toggle listening channel on or off."
set category = "MMI"
@@ -147,7 +147,7 @@
radio.listening = radio.listening==1 ? 0 : 1
to_chat(brainmob, "<span class='notice'>Radio is [radio.listening==1 ? "now" : "no longer"] receiving broadcast.</span>")
/obj/item/device/mmi/emp_act(severity)
/obj/item/mmi/emp_act(severity)
if(!brainmob || iscyborg(loc))
return
else
@@ -161,7 +161,7 @@
brainmob.emote("alarm")
..()
/obj/item/device/mmi/Destroy()
/obj/item/mmi/Destroy()
if(iscyborg(loc))
var/mob/living/silicon/robot/borg = loc
borg.mmi = null
@@ -178,12 +178,12 @@
radio = null
return ..()
/obj/item/device/mmi/deconstruct(disassembled = TRUE)
/obj/item/mmi/deconstruct(disassembled = TRUE)
if(brain)
eject_brain()
qdel(src)
/obj/item/device/mmi/examine(mob/user)
/obj/item/mmi/examine(mob/user)
..()
if(brainmob)
var/mob/living/brain/B = brainmob
@@ -196,15 +196,15 @@
else
to_chat(user, "<span class='notice'>The MMI indicates the brain is active.</span>")
/obj/item/device/mmi/relaymove(mob/user)
/obj/item/mmi/relaymove(mob/user)
return //so that the MMI won't get a warning about not being able to move if it tries to move
/obj/item/device/mmi/syndie
/obj/item/mmi/syndie
name = "Syndicate Man-Machine Interface"
desc = "Syndicate's own brand of MMI. It enforces laws designed to help Syndicate agents achieve their goals upon cyborgs and AIs created with it."
overrides_aicore_laws = TRUE
/obj/item/device/mmi/syndie/Initialize()
/obj/item/mmi/syndie/Initialize()
. = ..()
laws = new /datum/ai_laws/syndicate_override()
radio.on = 0
+4 -4
View File
@@ -1,5 +1,5 @@
/mob/living/brain
var/obj/item/device/mmi/container = null
var/obj/item/mmi/container = null
var/timeofhostdeath = 0
var/emp_damage = 0//Handles a type of MMI damage
var/datum/dna/stored/stored_dna // dna var for brain. Used to store dna, brain dna is not considered like actual dna, brain.has_dna() returns FALSE.
@@ -66,8 +66,8 @@
/mob/living/brain/ClickOn(atom/A, params)
..()
if(istype(loc, /obj/item/device/mmi))
var/obj/item/device/mmi/MMI = loc
if(istype(loc, /obj/item/mmi))
var/obj/item/mmi/MMI = loc
var/obj/mecha/M = MMI.mecha
if((src == MMI.brainmob) && istype(M))
return M.click_action(A,src,params)
@@ -80,7 +80,7 @@
B.forceMove(destination)
else if (istype(destination, /obj/item/organ/brain))
doMove(destination)
else if (istype(destination, /obj/item/device/mmi))
else if (istype(destination, /obj/item/mmi))
doMove(destination)
else
CRASH("Brainmob without a container [src] attempted to move to [destination].")
+1 -1
View File
@@ -4,7 +4,7 @@
stat = DEAD
if(!gibbed && container)//If not gibbed but in a container.
var/obj/item/device/mmi = container
var/obj/item/mmi = container
mmi.visible_message("<span class='warning'>[src]'s MMI flatlines!</span>", \
"<span class='italics'>You hear something flatline.</span>")
mmi.update_icon()
+1 -1
View File
@@ -5,7 +5,7 @@
/datum/emote/brain/can_run_emote(mob/user, status_check = TRUE)
. = ..()
var/mob/living/brain/B = user
if(!istype(B) || (!(B.container && istype(B.container, /obj/item/device/mmi))))
if(!istype(B) || (!(B.container && istype(B.container, /obj/item/mmi))))
return FALSE
/datum/emote/brain/alarm
+14 -14
View File
@@ -1,6 +1,6 @@
GLOBAL_VAR(posibrain_notify_cooldown)
/obj/item/device/mmi/posibrain
/obj/item/mmi/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'
@@ -28,19 +28,19 @@ GLOBAL_VAR(posibrain_notify_cooldown)
var/list/possible_names //If you leave this blank, it will use the global posibrain names
var/picked_name
/obj/item/device/mmi/posibrain/Topic(href, href_list)
/obj/item/mmi/posibrain/Topic(href, href_list)
if(href_list["activate"])
var/mob/dead/observer/ghost = usr
if(istype(ghost))
activate(ghost)
/obj/item/device/mmi/posibrain/proc/ping_ghosts(msg, newlymade) // CITADEL EDIT sound change to 'sound/misc/server-ready.ogg'
/obj/item/mmi/posibrain/proc/ping_ghosts(msg, newlymade) // CITADEL EDIT sound change to 'sound/misc/server-ready.ogg'
if(newlymade || GLOB.posibrain_notify_cooldown <= world.time)
notify_ghosts("[name] [msg] in [get_area(src)]!", ghost_sound = !newlymade ? 'sound/misc/server-ready.ogg':null, enter_link = "<a href=?src=[REF(src)];activate=1>(Click to enter)</a>", source = src, action = NOTIFY_ATTACK, flashwindow = FALSE)
if(!newlymade)
GLOB.posibrain_notify_cooldown = world.time + askDelay
/obj/item/device/mmi/posibrain/attack_self(mob/user)
/obj/item/mmi/posibrain/attack_self(mob/user)
if(!brainmob)
brainmob = new(src)
if(is_occupied())
@@ -57,7 +57,7 @@ GLOBAL_VAR(posibrain_notify_cooldown)
update_icon()
addtimer(CALLBACK(src, .proc/check_success), askDelay)
/obj/item/device/mmi/posibrain/proc/check_success()
/obj/item/mmi/posibrain/proc/check_success()
searching = FALSE
update_icon()
if(QDELETED(brainmob))
@@ -68,10 +68,10 @@ GLOBAL_VAR(posibrain_notify_cooldown)
else
visible_message(fail_message)
/obj/item/device/mmi/posibrain/attack_ghost(mob/user)
/obj/item/mmi/posibrain/attack_ghost(mob/user)
activate(user)
/obj/item/device/mmi/posibrain/proc/is_occupied()
/obj/item/mmi/posibrain/proc/is_occupied()
if(brainmob.key)
return TRUE
if(iscyborg(loc))
@@ -81,7 +81,7 @@ GLOBAL_VAR(posibrain_notify_cooldown)
return FALSE
//Two ways to activate a positronic brain. A clickable link in the ghost notif, or simply clicking the object itself.
/obj/item/device/mmi/posibrain/proc/activate(mob/user)
/obj/item/mmi/posibrain/proc/activate(mob/user)
if(QDELETED(brainmob))
return
if(is_occupied() || jobban_isbanned(user,"posibrain"))
@@ -92,7 +92,7 @@ GLOBAL_VAR(posibrain_notify_cooldown)
return
transfer_personality(user)
/obj/item/device/mmi/posibrain/transfer_identity(mob/living/carbon/C)
/obj/item/mmi/posibrain/transfer_identity(mob/living/carbon/C)
name = "[initial(name)] ([C])"
brainmob.name = C.real_name
brainmob.real_name = C.real_name
@@ -111,7 +111,7 @@ GLOBAL_VAR(posibrain_notify_cooldown)
brainmob.mind.wipe_memory()
update_icon()
/obj/item/device/mmi/posibrain/proc/transfer_personality(mob/candidate)
/obj/item/mmi/posibrain/proc/transfer_personality(mob/candidate)
if(QDELETED(brainmob))
return
if(is_occupied()) //Prevents hostile takeover if two ghosts get the prompt or link for the same brain.
@@ -133,7 +133,7 @@ GLOBAL_VAR(posibrain_notify_cooldown)
return TRUE
/obj/item/device/mmi/posibrain/examine(mob/user)
/obj/item/mmi/posibrain/examine(mob/user)
. = ..()
var/msg
if(brainmob && brainmob.key)
@@ -148,7 +148,7 @@ GLOBAL_VAR(posibrain_notify_cooldown)
to_chat(user, msg)
/obj/item/device/mmi/posibrain/Initialize()
/obj/item/mmi/posibrain/Initialize()
. = ..()
brainmob = new(src)
var/new_name
@@ -163,11 +163,11 @@ GLOBAL_VAR(posibrain_notify_cooldown)
if(autoping)
ping_ghosts("created", TRUE)
/obj/item/device/mmi/posibrain/attackby(obj/item/O, mob/user)
/obj/item/mmi/posibrain/attackby(obj/item/O, mob/user)
return
/obj/item/device/mmi/posibrain/update_icon()
/obj/item/mmi/posibrain/update_icon()
if(searching)
icon_state = "[initial(icon_state)]-searching"
return
+4 -4
View File
@@ -1,5 +1,5 @@
/mob/living/brain/say(message, language)
if(!(container && istype(container, /obj/item/device/mmi)))
if(!(container && istype(container, /obj/item/mmi)))
return //No MMI, can't speak, bucko./N
else
if(prob(emp_damage*4))
@@ -14,8 +14,8 @@
return ..() | SPAN_ROBOT
/mob/living/brain/radio(message, message_mode, list/spans, language)
if(message_mode == MODE_HEADSET && istype(container, /obj/item/device/mmi))
var/obj/item/device/mmi/R = container
if(message_mode == MODE_HEADSET && istype(container, /obj/item/mmi))
var/obj/item/mmi/R = container
if(R.radio)
R.radio.talk_into(src, message, , get_spans(), language)
return ITALICS | REDUCE_RANGE
@@ -30,7 +30,7 @@
return message
/mob/living/brain/could_speak_in_language(datum/language/dt)
if(istype(container, /obj/item/device/mmi/posibrain/soul_vessel))
if(istype(container, /obj/item/mmi/posibrain/soul_vessel))
// soul vessels can only speak ratvarian.
. = ispath(dt, /datum/language/ratvar)
else