diff --git a/code/game/objects/items/item.dm b/code/game/objects/items/item.dm
index 76c5cd86fae..10fa0ea348f 100644
--- a/code/game/objects/items/item.dm
+++ b/code/game/objects/items/item.dm
@@ -157,9 +157,13 @@
/obj/item/proc/attack(mob/M as mob, mob/user as mob, def_zone)
+
if (!M) // not sure if this is the right thing...
return
+ var/messagesource = M
+ if (istype(M,/mob/living/carbon/brain))
+ messagesource = M:container
if (src.hitsound)
playsound(src.loc, hitsound, 50, 1, -1)
/////////////////////////
@@ -169,7 +173,7 @@
// M.lastattacker = null
/////////////////////////
if(!istype(M, /mob/living/carbon/human))
- for(var/mob/O in viewers(M, null))
+ for(var/mob/O in viewers(messagesource, null))
O.show_message(text("\red [] has been attacked with [][] ", M, src, (user ? text(" by [].", user) : ".")), 1)
var/power = src.force
if (istype(M, /mob/living/carbon/human))
diff --git a/code/modules/mob/living/carbon/brain/MMI.dm b/code/modules/mob/living/carbon/brain/MMI.dm
index 1cad3c4b6e8..0501b18bb3d 100644
--- a/code/modules/mob/living/carbon/brain/MMI.dm
+++ b/code/modules/mob/living/carbon/brain/MMI.dm
@@ -9,24 +9,41 @@
var/mob/living/carbon/brain/brainmob = null
var/mob/living/silicon/robot = null
var/obj/mecha = null
-
+ var/locked = 0
+ req_access = list(access_robotics)
attackby(var/obj/item/O as obj, var/mob/user as mob)
- if(istype(O,/obj/item/brain) && !brain)
+ if(istype(O,/obj/item/brain) && !brain) //Time to stick a brain in it --NEO
+
for(var/mob/V in viewers(src, null))
V.show_message(text("\blue [user] sticks \a [O] into \the [src]."))
- src.brain = O
+ brain = O
user.drop_item()
O.loc = src
- icon_state = "mmi_full"
+
+ //Adding the actual mob the brain's player gets moved to. --NEO
brainmob = new /mob/living/carbon/brain
brainmob.loc = src
brainmob.name = brain.owner.real_name
brainmob.real_name = brain.owner.real_name
brainmob.container = src
brain.owner.mind.transfer_to(brainmob)
- src.brainmob.client.screen.len = null
- src.name = "Man-Machine Interface:[brainmob.real_name]"
+ brainmob.client.screen.len = null
+
+ name = "Man-Machine Interface:[brainmob.real_name]"
+ icon_state = "mmi_full"
+ locked = 1
+ return
+ if((istype(O,/obj/item/weapon/card/id)||istype(O,/obj/item/device/pda)) && brain)
+ if(allowed(user))
+ locked = !locked
+ user << "\blue You [locked ? "lock" : "unlock"] the brain holder."
+ else
+ user << "\red Access denied."
+ return
+ if(brain)
+ O.attack(brainmob, user)
return
..()
+
diff --git a/code/modules/mob/living/carbon/brain/brain.dm b/code/modules/mob/living/carbon/brain/brain.dm
index c78d972110a..3ead33ac25e 100644
--- a/code/modules/mob/living/carbon/brain/brain.dm
+++ b/code/modules/mob/living/carbon/brain/brain.dm
@@ -1,6 +1,12 @@
/mob/living/carbon/brain
var/obj/item/device/mmi/container = null
+ New()
+ spawn(1)
+ var/datum/reagents/R = new/datum/reagents(1000)
+ reagents = R
+ R.my_atom = src
+
say_understands(var/other)
if (istype(other, /mob/living/silicon/ai))
return 1
diff --git a/code/modules/mob/living/carbon/brain/death.dm b/code/modules/mob/living/carbon/brain/death.dm
new file mode 100644
index 00000000000..eeede342a22
--- /dev/null
+++ b/code/modules/mob/living/carbon/brain/death.dm
@@ -0,0 +1,35 @@
+/mob/living/carbon/brain/death(gibbed)
+ var/cancel
+ if (!gibbed)
+ for(var/mob/O in viewers(src.container, null))
+ O.show_message(text("\red []'s MMI flatlines!", src), 1, "\red You hear something flatline.", 2)
+ src.container.icon_state = "mmi_dead"
+ src.stat = 2
+
+ if(src.blind)
+ src.blind.layer = 0
+ src.sight |= SEE_TURFS
+ src.sight |= SEE_MOBS
+ src.sight |= SEE_OBJS
+
+ src.see_in_dark = 8
+ src.see_invisible = 2
+
+ var/tod = time2text(world.realtime,"hh:mm:ss") //weasellos time of death patch
+ store_memory("Time of death: [tod]", 0)
+
+ for(var/mob/M in world)
+ if ((M.client && !( M.stat )))
+ cancel = 1
+ break
+ if (!( cancel ))
+ world << "Everyone is dead! Resetting in 30 seconds!"
+ spawn( 300 )
+ log_game("Rebooting because of no live players")
+ world.Reboot()
+ return
+ if (src.client)
+ spawn(50)
+ if(src.client && src.stat == 2)
+ src.verbs += /mob/proc/ghostize
+ return ..(gibbed)
\ No newline at end of file
diff --git a/code/modules/mob/living/carbon/brain/life.dm b/code/modules/mob/living/carbon/brain/life.dm
index 31e7cdeca4e..48d5fd6ba5d 100644
--- a/code/modules/mob/living/carbon/brain/life.dm
+++ b/code/modules/mob/living/carbon/brain/life.dm
@@ -73,10 +73,10 @@
stunned = max(stunned,0)
paralysis = max(paralysis, 0)
weakened = max(weakened, 0)
- bruteloss = min(bruteloss, 0)
- fireloss = min(fireloss, 0)
- oxyloss = min(oxyloss, 0)
- toxloss = min(toxloss, 0)
+ bruteloss = max(bruteloss, 0)
+ fireloss = max(fireloss, 0)
+ oxyloss = max(oxyloss, 0)
+ toxloss = max(toxloss, 0)
handle_disabilities()
@@ -190,7 +190,7 @@
if(src.resting)
src.weakened = max(src.weakened, 5)
- if(health < -100)
+ if(health < -100 && stat != 2)
death()
else if(src.health < 0)
if(src.health <= 20 && prob(1)) spawn(0) emote("gasp")
diff --git a/code/modules/mob/living/carbon/monkey/life.dm b/code/modules/mob/living/carbon/monkey/life.dm
index 90a05d41695..2cfd8f8a633 100644
--- a/code/modules/mob/living/carbon/monkey/life.dm
+++ b/code/modules/mob/living/carbon/monkey/life.dm
@@ -77,7 +77,7 @@
for(var/obj/item/weapon/grab/G in src)
G.process()
- if(!client)
+ if(!client && !stat)
if(prob(33) && canmove && isturf(loc))
step(src, pick(cardinal))
if(prob(1))
diff --git a/icons/obj/assemblies.dmi b/icons/obj/assemblies.dmi
index 086e4ca7e36..abadc860832 100644
Binary files a/icons/obj/assemblies.dmi and b/icons/obj/assemblies.dmi differ
diff --git a/tgstation.dme b/tgstation.dme
index e7dfc06a6cd..52d5a110cfe 100644
--- a/tgstation.dme
+++ b/tgstation.dme
@@ -652,6 +652,7 @@
#include "code\modules\mob\living\carbon\beast\bodypart.dm"
#include "code\modules\mob\living\carbon\beast\death.dm"
#include "code\modules\mob\living\carbon\brain\brain.dm"
+#include "code\modules\mob\living\carbon\brain\death.dm"
#include "code\modules\mob\living\carbon\brain\life.dm"
#include "code\modules\mob\living\carbon\brain\MMI.dm"
#include "code\modules\mob\living\carbon\human\death.dm"