Important!

Minds part2 - Carn loses her mind.

The way datum/mind stuff works has been changed a lot. I really can't explain everything. If you have any questions it'd just be easier if you leave a comment or ask me in coderbus.
Generally, minds now represent IC characters rather than following a client around constantly. Minds can change owners, mobs, (names WIP).

Technical babble:
The var/current and var/original variables of the mind datum must always be of type mob/living (or null). Please do not mind.transfer_to(ghost_mob). If you want to ghost somebody use ghostize()! It will do all the technical stuff for you.

mob/dead/observer/var/corpse was removed. mob/dead/observer/var/mind is now used as a reference to the last mind the player had (so respawning code has something to reference), but also because mind.current is a far more useful way of tracking a corpse. If somebody triggers a mind.transfer_to() call on your corpse, your mind will be tranfered to another mob/living or something...that will then be considered your corpse. This could allow for more interesting mind_transfers. For instance, the "raise corpse" rune ghostizes any player in the corpse to be raised and selectes a random dead player to take possesion of their character! The person possesing them will have all of their memories, objectives, etc. The poor guy who was originally the owner cannot re-enter body if there is another player in his body...but if that player is ghosted he can once again return. Exorcisms anybody?

Changes to cloning and hydroponics. I will likely have to rework these later as they're hacky as hell right now.

A lot of stuff is now handled by Login/Logout rather than in hundreds of different places. One such example, mind datums get their variables updated at Login and Logout.

Fixed a few minor bugs. I'll update the issues manually in a bit because I literally cannot think atm.

TL;DR guide:
-If you want to make somebody a ghost use ghostize(). Or you will need to find a doctor to stitch your bits back on. :)
-You don't have to worry about making minds. Simply doing key="carnwennan" or whatever will either: A) make a new mind and initialise it if there isn't one or B) take possession of the mind currently attached to the mob.
-It's safe to transfer a mind even if a key isn't in-body (e.g. they are ghosted/admin-observing etc!) Minds have an active variable which tracks whether they are currently synced with a key. This is to avoid dragging ghosts back into their bodies when say, a wizard mind_transfers them.
-Transferring a mind whilst var/active=1 will cause the following: mob.key = mind.key. So no need to do that separately (in fact you'll lag things if you do, so don't)
-If you do want to initialize a mind manually, say if you don't have a client to login to the mob yet, simply do new_mob.mind_initialize(). Simple! When someody is logged into that mob they will take ownership of the mind and it will sync up.

NOTE: a lot is probably broken since this is a pretty massive change. Please let me know asap (with actual info! Shouting at me, "IT BORKED HALP", doesn't help)

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4342 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
elly1989@rocketmail.com
2012-08-08 20:51:55 +00:00
parent 0225ed33b7
commit 81bff7c5f5
52 changed files with 691 additions and 1054 deletions

View File

@@ -19,171 +19,79 @@
/obj/item/projectile/change/proc/wabbajack (mob/M as mob in living_mob_list)
if(istype(M, /mob/living) && M.stat != 2)
for(var/obj/item/W in M)
if (istype(M, /mob/living/silicon/robot)||istype(W, /obj/item/weapon/implant))
del (W)
M.drop_from_inventory(W)
var/randomize = pick("monkey","robot","metroid","alien","human")
if(istype(M, /mob/living) && M.stat != DEAD)
if(M.monkeyizing) return
M.monkeyizing = 1
M.canmove = 0
M.icon = null
M.overlays = null
M.invisibility = 101
if(istype(M, /mob/living/silicon/robot))
var/mob/living/silicon/robot/Robot = M
if(Robot.mmi) del(Robot.mmi)
else
for(var/obj/item/W in M)
if(istype(W, /obj/item/weapon/implant)) //TODO: Carn. give implants a dropped() or something
del(W)
W.layer = initial(W.layer)
W.loc = M.loc
W.dropped(src)
var/mob/living/new_mob
var/randomize = pick("monkey","robot","metroid","xeno","human")
switch(randomize)
if("monkey")
if (M.monkeyizing)
return
// M.regenerate_icons()
M.monkeyizing = 1
M.canmove = 0
M.icon = null
M.invisibility = 101
var/mob/living/carbon/monkey/O = new /mob/living/carbon/monkey( M.loc )
O.name = "monkey"
if (M.client)
M.client.mob = O
if(M.mind)
M.mind.transfer_to(O)
O.a_intent = "hurt"
O.universal_speak = 1
O << "<B>You are now a monkey.</B>"
del(M)
return O
new_mob = new /mob/living/carbon/monkey(M.loc)
new_mob.universal_speak = 1
if("robot")
if (M.monkeyizing)
return
// M.regenerate_icons()
M.monkeyizing = 1
M.canmove = 0
M.icon = null
M.invisibility = 101
if(M.client)
M.client.screen -= M.hud_used.contents
M.client.screen -= M.hud_used.adding
M.client.screen -= list( M.oxygen, M.throw_icon, M.i_select, M.m_select, M.toxin, M.internals, M.fire, M.hands, M.healths, M.pullin, M.blind, M.flash, M.rest, M.sleep, M.mach )
M.client.screen -= list( M.zone_sel, M.oxygen, M.throw_icon, M.i_select, M.m_select, M.toxin, M.internals, M.fire, M.hands, M.healths, M.pullin, M.blind, M.flash, M.rest, M.sleep, M.mach )
var/mob/living/silicon/robot/O = new /mob/living/silicon/robot( M.loc )
O.cell = new(O)
O.cell.maxcharge = 7500
O.cell.charge = 7500
O.gender = M.gender
O.invisibility = 0
O.name = "Cyborg"
O.real_name = "Cyborg"
if (M.mind)
M.mind.transfer_to(O)
if (M.mind.assigned_role == "Cyborg")
M.mind.original = O
else if (M.mind.special_role) O.mind.store_memory("In case you look at this after being borged, the objectives are only here until I find a way to make them not show up for you, as I can't simply delete them without screwing up round-end reporting. --NeoFite")
else
M.mind = new /datum/mind( )
M.mind.key = M.key
M.mind.current = O
M.mind.original = O
M.mind.transfer_to(O)
if(!(O.mind in ticker.minds))
ticker.minds += O.mind//Adds them to regular mind list.
O.loc = loc
//O << "<B>You are playing a Cyborg. A Cyborg can interact with most electronic objects in its view point.</B>"
//O << "<B>You must follow the laws that the AI has. You must follow orders the AI gives you.</B>"
//O << "To use something, simply click on it."
//O << {"Use say ":s to speak to fellow cyborgs and the AI through binary."}
O.job = "Cyborg"
O.mmi = new /obj/item/device/mmi(O)
O.mmi.transfer_identity(M)//Does not transfer key/client.
del(M)
return O
new_mob = new /mob/living/silicon/robot(M.loc)
new_mob.gender = M.gender
new_mob.invisibility = 0
new_mob.job = "Cyborg"
var/mob/living/silicon/robot/Robot = new_mob
Robot.mmi = new /obj/item/device/mmi(new_mob)
Robot.mmi.transfer_identity(M) //Does not transfer key/client.
if("metroid")
if (M.monkeyizing)
return
// M.regenerate_icons()
M.monkeyizing = 1
M.canmove = 0
M.icon = null
M.invisibility = 101
if(prob(50))
var/mob/living/carbon/metroid/adult/new_metroid = new /mob/living/carbon/metroid/adult (M.loc)
if (M.client)
M.client.mob = new_metroid
if(M.mind)
M.mind.transfer_to(new_metroid)
new_metroid.a_intent = "hurt"
new_metroid << "<B>You are now an adult Metroid.</B>"
new_metroid.universal_speak = 1
del(M)
return new_metroid
new_mob = new /mob/living/carbon/metroid/adult(M.loc)
else
var/mob/living/carbon/metroid/new_metroid = new /mob/living/carbon/metroid (M.loc)
if (M.client)
M.client.mob = new_metroid
if(M.mind)
M.mind.transfer_to(new_metroid)
new_metroid.a_intent = "hurt"
new_metroid.universal_speak = 1
new_metroid << "<B>You are now a baby Metroid.</B>"
del(M)
return new_metroid
new_mob = new /mob/living/carbon/metroid(M.loc)
new_mob.universal_speak = 1
if("alien")
if (M.monkeyizing)
return
// M.regenerate_icons()
M.monkeyizing = 1
M.canmove = 0
M.icon = null
M.invisibility = 101
var/alien_caste = pick("Hunter","Sentinel","Drone")
var/mob/living/carbon/alien/humanoid/new_xeno
var/alien_caste = pick("Hunter","Sentinel","Drone","Larva")
switch(alien_caste)
if("Hunter")
new_xeno = new /mob/living/carbon/alien/humanoid/hunter (M.loc)
if("Sentinel")
new_xeno = new /mob/living/carbon/alien/humanoid/sentinel (M.loc)
if("Drone")
new_xeno = new /mob/living/carbon/alien/humanoid/drone (M.loc)
if (M.client)
M.client.mob = new_xeno
if(M.mind)
M.mind.transfer_to(new_xeno)
new_xeno.a_intent = "hurt"
new_xeno.universal_speak = 1
new_xeno << "<B>You are now an alien.</B>"
del(M)
return new_xeno
if("Hunter") new_mob = new /mob/living/carbon/alien/humanoid/hunter(M.loc)
if("Sentinel") new_mob = new /mob/living/carbon/alien/humanoid/sentinel(M.loc)
if("Drone") new_mob = new /mob/living/carbon/alien/humanoid/drone(M.loc)
if("Larva") new_mob = new /mob/living/carbon/alien/larva(M.loc)
new_mob.universal_speak = 1
if("human")
if (M.monkeyizing)
return
// M.regenerate_icons()
M.monkeyizing = 1
M.canmove = 0
M.icon = null
M.invisibility = 101
var/mob/living/carbon/human/O = new /mob/living/carbon/human( M.loc )
new_mob = new /mob/living/carbon/human(M.loc)
if(M.gender == MALE)
new_mob.gender = MALE
new_mob.name = pick(first_names_male)
else
new_mob.gender = FEMALE
new_mob.name = pick(first_names_female)
new_mob.name += " [pick(last_names)]"
new_mob.real_name = new_mob.name
var/first = pick(first_names_male)
var/last = pick(last_names)
O.name = "[first] [last]"
O.real_name = "[first] [last]"
var/race = pick("lizard","golem","metroid","plant","normal")
switch(race)
if("lizard")
O.mutantrace = "lizard"
if("golem")
O.mutantrace = "golem"
if("metroid")
O.mutantrace = "metroid"
if("plant")
O.mutantrace = "plant"
if("normal")
O.mutantrace = ""
if (M.client)
M.client.mob = O
if(M.mind)
M.mind.transfer_to(O)
O.a_intent = "hurt"
O << "<B>You are now a human.</B>"
del(M)
return O
return
var/datum/preferences/A = new() //Randomize appearance for the human
A.randomize_appearance_for(new_mob)
var/mob/living/carbon/human/Human = new_mob
Human.mutantrace = pick("lizard","golem","metroid","plant",4;"")
new_mob.a_intent = "hurt"
if(M.mind)
M.mind.transfer_to(new_mob)
else
new_mob.key = M.key
new_mob << "<B>Your form morphs into that of a [randomize].</B>"
del(M)
return new_mob