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

@@ -419,7 +419,8 @@ client
break
M.real_name = new_name
M.name = new_name
M.original_name = new_name
if(M.mind)
M.mind.name = new_name
href_list["datumrefresh"] = href_list["rename"]
else if (href_list["varnameedit"])

View File

@@ -69,26 +69,19 @@
affected_mob.updatehealth()
if(prob(40))
if(gibbed != 0) return 0
var/list/candidates = list() // Picks a random ghost in the world to shove in the larva -- TLE
var/list/candidates = list() //List of candidate KEYS to assume control of the new larva ~Carn
for(var/mob/dead/observer/G in player_list)
if(G.client)
if(G.client.be_alien)
if(((G.client.inactivity/10)/60) <= 5)
if(G.corpse)
if(G.corpse.stat==DEAD)
candidates.Add(G)
else
candidates.Add(G)
if(G.client.be_alien)
if(((G.client.inactivity/10)/60) <= 5)
if(!(G.mind && G.mind.current && G.mind.current.stat != DEAD))
candidates += G.key
var/mob/living/carbon/alien/larva/new_xeno = new(affected_mob.loc)
if(candidates.len)
var/mob/dead/observer/G = pick(candidates)
new_xeno.mind_initialize(G,"Larva")
new_xeno.key = G.key
del(G)
new_xeno.key = pick(candidates)
else
if(affected_mob.client)
affected_mob.client.mob = new_xeno
new_xeno.key = affected_mob.key
new_xeno << sound('hiss5.ogg',0,0,0,100) //To get the player's attention
affected_mob.gib()
src.cure(0)

View File

@@ -642,7 +642,7 @@ var/global/datum/tension/tension_master
sleep(300)
for(var/mob/dead/observer/G in candidates)
if(!G.client || !G.key)
if(!G.key)
candidates.Remove(G)
if(candidates.len)
@@ -657,7 +657,6 @@ var/global/datum/tension/tension_master
var/mob/living/carbon/human/new_syndicate_commando = create_syndicate_death_commando(L, syndicate_leader_selected)
while((!theghost || !theghost.client) && candidates.len)
theghost = pick(candidates)
candidates.Remove(theghost)
@@ -666,7 +665,6 @@ var/global/datum/tension/tension_master
del(new_syndicate_commando)
break
new_syndicate_commando.mind.key = theghost.key//For mind stuff.
new_syndicate_commando.key = theghost.key
new_syndicate_commando.internal = new_syndicate_commando.s_store
new_syndicate_commando.internals.icon_state = "internal1"
@@ -741,7 +739,6 @@ var/global/datum/tension/tension_master
del(new_borg_deathsquad)
break
new_borg_deathsquad.mind.key = theghost.key//For mind stuff.
new_borg_deathsquad.key = theghost.key
//So they don't forget their code or mission.
@@ -762,148 +759,26 @@ var/global/datum/tension/tension_master
return 1 // Has to return one before it knows if there's a wizard to prevent the parent from automatically selecting another game mode.
proc/makeBody(var/mob/dead/observer/G_found) // Uses stripped down and bastardized code from respawn character
if(!G_found)
return
if(!G_found || !G_found.key) return
//First we spawn a dude.
var/mob/living/carbon/human/new_character = new(src)//The mob being spawned.
var/mob/living/carbon/human/new_character = new(pick(latejoin))//The mob being spawned.
//Second, we check if they are an alien or monkey.
G_found.mind=null//Null their mind so we don't screw things up ahead.
G_found.real_name="[pick(pick(first_names_male,first_names_female))] [pick(last_names)]"//Give them a random real name.
new_character.gender = pick(MALE,FEMALE)
new_character.mind = new()
ticker.minds += new_character.mind//And we'll add it to the minds database.
new_character.mind.original = new_character//If they are respawning with a new character.
new_character.mind.assigned_role = "Assistant"//Defaults to assistant.
new_character.mind.key = G_found.key//In case it's someone else playing as that character.
new_character.mind.current = new_character//So that it can properly reference later if needed.
new_character.mind.memory = ""//Memory erased so it doesn't get clunkered up with useless info. This means they may forget their previous mission--this is usually handled through objective code and recalling memory.
var/datum/data/record/record_found//Referenced to later to either randomize or not randomize the character.
if(G_found.mind)//They must have a mind to reference the record. Here we also double check for aliens.
var/id = md5("[G_found.real_name][G_found.mind.assigned_role]")
for(var/datum/data/record/t in data_core.locked)
if(t.fields["id"]==id)
record_found = t//We shall now reference the record.
break
//Here we either load their saved appearance or randomize it.
var/datum/preferences/A = new()
if(A.savefile_load(G_found))//If they have a save file. This will automatically load their parameters.
//Note: savefile appearances are overwritten later on if the character has a data_core entry. By appearance, I mean the physical appearance.
var/name_safety = G_found.real_name//Their saved parameters may include a random name. Also a safety in case they are playing a character that got their name after round start.
A.copy_to(new_character)
new_character.real_name = name_safety
new_character.name = name_safety
A.randomize_appearance_for(new_character)
if(new_character.gender == MALE)
new_character.real_name = "[pick(first_names_male)] [pick(last_names)]"
else
if(record_found)//If they have a record we can determine a few things.
new_character.real_name = record_found.fields["name"]//Not necessary to reference the record but I like to keep things uniform.
new_character.name = record_found.fields["name"]
new_character.gender = record_found.fields["sex"]//Sex
new_character.age = record_found.fields["age"]//Age
new_character.b_type = record_found.fields["b_type"]//Blood type
//We will update their appearance when determining DNA.
else
new_character.gender = FEMALE
var/name_safety = G_found.real_name//Default is a random name so we want to save this.
A.randomize_appearance_for(new_character)//Now we will randomize their appearance since we have no way of knowing what they look/looked like.
new_character.real_name = name_safety
new_character.name = name_safety
new_character.real_name = "[pick(first_names_female)] [pick(last_names)]"
new_character.name = new_character.real_name
new_character.age = rand(17,45)
//After everything above, it's time to initialize their DNA.
if(record_found)//Pull up their name from database records if they did have a mind.
new_character.dna = new()//Let's first give them a new DNA.
new_character.dna.unique_enzymes = record_found.fields["b_dna"]//Enzymes are based on real name but we'll use the record for conformity.
new_character.dna.struc_enzymes = record_found.fields["enzymes"]//This is the default of enzymes so I think it's safe to go with.
new_character.dna.uni_identity = record_found.fields["identity"]//DNA identity is carried over.
updateappearance(new_character,new_character.dna.uni_identity)//Now we configure their appearance based on their unique identity, same as with a DNA machine or somesuch.
else//If they have no records, we just do a random DNA for them, based on their random appearance/savefile.
new_character.dna.ready_dna(new_character)
new_character.dna.ready_dna(new_character)
new_character.key = G_found.key
var/player_key = G_found.key
//Here we need to find where to spawn them.
var/spawn_here = pick(latejoin)//"JoinLate" is a landmark which is deleted on round start. So, latejoin has to be used instead.
new_character.loc = spawn_here
//If they need to spawn elsewhere, they will be transferred there momentarily.
/*
The code below functions with the assumption that the mob is already a traitor if they have a special role.
So all it does is re-equip the mob with powers and/or items. Or not, if they have no special role.
If they don't have a mind, they obviously don't have a special role.
*/
new_character.key = player_key//Throw them into the mob.
/*
//Now for special roles and equipment.
switch(new_character.mind.special_role)
if("Changeling")
job_master.EquipRank(new_character, new_character.mind.assigned_role, 1)
new_character.make_changeling()
if("traitor")
job_master.EquipRank(new_character, new_character.mind.assigned_role, 1)
ticker.mode.equip_traitor(new_character)
if("Wizard")
new_character.loc = pick(wizardstart)
//ticker.mode.learn_basic_spells(new_character)
ticker.mode.equip_wizard(new_character)
if("Syndicate")
var/obj/effect/landmark/synd_spawn = locate("landmark*Syndicate-Spawn")
if(synd_spawn)
new_character.loc = get_turf(synd_spawn)
call(/datum/game_mode/proc/equip_syndicate)(new_character)
if("Space Ninja")
var/ninja_spawn[] = list()
for(var/obj/effect/landmark/L in world)
if(L.name=="carpspawn")
ninja_spawn += L
new_character.equip_space_ninja()
new_character.internal = new_character.s_store
new_character.internals.icon_state = "internal1"
if(ninja_spawn.len)
var/obj/effect/landmark/ninja_spawn_here = pick(ninja_spawn)
new_character.loc = ninja_spawn_here.loc
if("Death Commando")//Leaves them at late-join spawn.
new_character.equip_death_commando()
new_character.internal = new_character.s_store
new_character.internals.icon_state = "internal1"
else//They may also be a cyborg or AI.
switch(new_character.mind.assigned_role)
if("Cyborg")//More rigging to make em' work and check if they're traitor.
new_character = new_character.Robotize()
if(new_character.mind.special_role=="traitor")
call(/datum/game_mode/proc/add_law_zero)(new_character)
if("AI")
new_character = new_character.AIize()
if(new_character.mind.special_role=="traitor")
call(/datum/game_mode/proc/add_law_zero)(new_character)
//Add aliens.
else
job_master.EquipRank(new_character, new_character.mind.assigned_role, 1)//Or we simply equip them.
//Announces the character on all the systems, based on the record.
if(!issilicon(new_character))//If they are not a cyborg/AI.
if(!record_found&&new_character.mind.assigned_role!="MODE")//If there are no records for them. If they have a record, this info is already in there. MODE people are not announced anyway.
//Power to the user!
if(alert(new_character,"Warning: No data core entry detected. Would you like to announce the arrival of this character by adding them to various databases, such as medical records?",,"No","Yes")=="Yes")
call(/mob/new_player/proc/ManifestLateSpawn)(new_character)
if(alert(new_character,"Would you like an active AI to announce this character?",,"No","Yes")=="Yes")
call(/mob/new_player/proc/AnnounceArrival)(new_character, new_character.mind.assigned_role)
*/
del(G_found)//Don't want to leave ghosts around.
return new_character
/proc/create_syndicate_death_commando(obj/spawn_location, syndicate_leader_selected = 0)
@@ -918,22 +793,20 @@ var/global/datum/tension/tension_master
A.randomize_appearance_for(new_syndicate_commando)
new_syndicate_commando.real_name = "[!syndicate_leader_selected ? syndicate_commando_rank : syndicate_commando_leader_rank] [syndicate_commando_name]"
new_syndicate_commando.name = new_syndicate_commando.real_name
new_syndicate_commando.age = !syndicate_leader_selected ? rand(23,35) : rand(35,45)
new_syndicate_commando.dna.ready_dna(new_syndicate_commando)//Creates DNA.
//Creates mind stuff.
new_syndicate_commando.mind = new
new_syndicate_commando.mind.current = new_syndicate_commando
new_syndicate_commando.mind.original = new_syndicate_commando
new_syndicate_commando.mind_initialize()
new_syndicate_commando.mind.assigned_role = "MODE"
new_syndicate_commando.mind.special_role = "Syndicate Commando"
if(!(new_syndicate_commando.mind in ticker.minds))
ticker.minds += new_syndicate_commando.mind//Adds them to regular mind list.
if(!(new_syndicate_commando.mind in ticker.mode.traitors))//If they weren't already an extra traitor.
ticker.mode.traitors += new_syndicate_commando.mind//Adds them to current traitor list. Which is really the extra antagonist list.
//Adds them to current traitor list. Which is really the extra antagonist list.
ticker.mode.traitors += new_syndicate_commando.mind
new_syndicate_commando.equip_syndicate_commando(syndicate_leader_selected)
//del(spawn_location) // Commenting this out for multiple commando teams.
return new_syndicate_commando
@@ -948,15 +821,12 @@ var/global/datum/tension/tension_master
new_borg_deathsquad.name = name
//Creates mind stuff.
new_borg_deathsquad.mind = new
new_borg_deathsquad.mind.current = new_borg_deathsquad
new_borg_deathsquad.mind.original = new_borg_deathsquad
new_borg_deathsquad.mind_initialize()
new_borg_deathsquad.mind.assigned_role = "MODE"
new_borg_deathsquad.mind.special_role = "Borg Commando"
if(!(new_borg_deathsquad.mind in ticker.minds))
ticker.minds += new_borg_deathsquad.mind//Adds them to regular mind list.
if(!(new_borg_deathsquad.mind in ticker.mode.traitors))//If they weren't already an extra traitor.
ticker.mode.traitors += new_borg_deathsquad.mind//Adds them to current traitor list. Which is really the extra antagonist list.
//Adds them to current traitor list. Which is really the extra antagonist list.
ticker.mode.traitors += new_borg_deathsquad.mind
//del(spawn_location) // Commenting this out for multiple commando teams.
return new_borg_deathsquad

View File

@@ -1,7 +1,40 @@
/* Note from Carnie:
The way datum/mind stuff works has been changed a lot.
Minds now represent IC characters rather than following a client around constantly.
Guidelines for using minds properly:
- Never mind.transfer_to(ghost). The var/current and var/original of a mind must always be of type mob/living!
ghost.mind is however used as a reference to the ghost's corpse
- When creating a new mob for an existing IC character (e.g. cloning a dead guy or borging a brain of a human)
the existing mind of the old mob should be transfered to the new mob like so:
mind.transfer_to(new_mob)
- You must not assign key= or ckey= after transfer_to() since the transfer_to transfers the client for you.
By setting key or ckey explicitly after transfering the mind with transfer_to you will cause bugs like DCing
the player.
- IMPORTANT NOTE 2, if you want a player to become a ghost, use mob.ghostize() It does all the hard work for you.
- When creating a new mob which will be a new IC character (e.g. putting a shade in a construct or randomly selecting
a ghost to become a xeno during an event). Simply assign the key or ckey like you've always done.
new_mob.key = key
The Login proc will handle making a new mob for that mobtype (including setting up stuff like mind.name). Simple!
However if you want that mind to have any special properties like being a traitor etc you will have to do that
yourself.
*/
datum/mind
var/key
var/name //TODO: this will replace mob.original_name
var/mob/living/current
var/mob/living/original
var/active = 0
var/memory
//TODO: store original name --rastaf0
@@ -18,14 +51,23 @@ datum/mind
var/datum/faction/faction // associated faction
proc/transfer_to(mob/new_character)
if(current)
New(var/key)
src.key = key
proc/transfer_to(mob/living/new_character)
if(!istype(new_character))
world.log << "## Some idiot has tried to transfer_to() a non mob/living mob. Please inform Carn"
if(current) //remove ourself from our old body's mind variable
current.mind = null
if(new_character.mind) //remove any mind currently in our new body's mind variable
new_character.mind.current = null
new_character.mind = src
current = new_character
current = new_character //link ourself to our new body
new_character.mind = src //and link our new body to ourself
new_character.key = key
if(active)
new_character.key = key //now transfer the key to link the client to our new body
proc/store_memory(new_text)
memory += "[new_text]<BR>"
@@ -1046,3 +1088,104 @@ datum/mind
//Initialisation procs
/mob/living/proc/mind_initialize()
if(mind)
if(mind.key != key)
world.log << "## DEBUG: mind_initialize(): [key] took possession of [mind.key]'s mind"
mind.key = key
else
mind = new /datum/mind(key)
mind.original = src
if(ticker)
ticker.minds += mind
else
world.log << "## No ticker ready yet! Please inform Carn"
mind.name = real_name
mind.current = src
//HUMAN
/mob/living/carbon/human/mind_initialize()
..()
if(!mind.assigned_role) mind.assigned_role = "Assistant" //defualt
//MONKEY
/mob/living/carbon/monkey/mind_initialize()
..()
//METROID
/mob/living/carbon/metroid/mind_initialize()
..()
mind.assigned_role = "Metroid"
//XENO
/mob/living/carbon/alien/mind_initialize()
..()
mind.assigned_role = "Alien"
//XENO HUMANOID
/mob/living/carbon/alien/humanoid/queen/mind_initialize()
..()
mind.special_role = "Queen"
/mob/living/carbon/alien/humanoid/hunter/mind_initialize()
..()
mind.special_role = "Hunter"
/mob/living/carbon/alien/humanoid/drone/mind_initialize()
..()
mind.special_role = "Drone"
/mob/living/carbon/alien/humanoid/sentinel/mind_initialize()
..()
mind.special_role = "Sentinel"
//XENO LARVA
/mob/living/carbon/alien/larva/mind_initialize()
..()
mind.special_role = "Larva"
//AI
/mob/living/silicon/ai/mind_initialize()
..()
mind.assigned_role = "AI"
//BORG
/mob/living/silicon/robot/mind_initialize()
..()
mind.assigned_role = "Cyborg"
//PAI
/mob/living/silicon/pai/mind_initialize()
..()
mind.assigned_role = "pAI"
mind.special_role = ""
//Animals
/mob/living/simple_animal/mind_initialize()
..()
mind.assigned_role = "Animal"
/mob/living/simple_animal/corgi/mind_initialize()
..()
mind.assigned_role = "Corgi"
/mob/living/simple_animal/shade/mind_initialize()
..()
mind.assigned_role = "Shade"
/mob/living/simple_animal/constructbuilder/mind_initialize()
..()
mind.assigned_role = "Artificer"
mind.special_role = "Cultist"
/mob/living/simple_animal/constructwraith/mind_initialize()
..()
mind.assigned_role = "Wraith"
mind.special_role = "Cultist"
/mob/living/simple_animal/constructarmoured/mind_initialize()
..()
mind.assigned_role = "Juggernaut"
mind.special_role = "Cultist"

View File

@@ -41,13 +41,12 @@ Also, you never added distance checking after target is selected. I've went ahea
user << "Their mind isn't compatible with yours."
return
if(target.stat == 2)
if(target.stat == DEAD)
user << "You didn't study necromancy back at the Space Wizard Federation academy."
return
if(!target.client || !target.mind)
//if(!target.mind)//Good for testing.
user << "They appear to be brain-dead."
if(!target.key || !target.mind)
user << "They appear to be catatonic. Not even magic can affect their vacant mind."
return
if(target.mind.special_role in protected_roles)
@@ -56,8 +55,6 @@ Also, you never added distance checking after target is selected. I've went ahea
var/mob/victim = target//The target of the spell whos body will be transferred to.
var/mob/caster = user//The wizard/whomever doing the body transferring.
//To properly transfer clients so no-one gets kicked off the game, we need a host mob.
var/mob/dead/observer/temp_ghost = new(victim)
//SPELL LOSS BEGIN
//NOTE: The caster must ALWAYS keep mind transfer, even when other spells are lost.
@@ -89,31 +86,25 @@ Also, you never added distance checking after target is selected. I've went ahea
for(var/V in victim.mind.special_verbs)
victim.verbs -= V
temp_ghost.key = victim.key//Throw the victim into the ghost temporarily.
temp_ghost.mind = victim.mind//Tranfer the victim's mind into the ghost.
temp_ghost.spell_list = victim.spell_list//If they have spells, transfer them. Now we basically have a backup mob.
var/mob/dead/observer/ghost = victim.ghostize(0)
ghost.spell_list = victim.spell_list//If they have spells, transfer them. Now we basically have a backup mob.
victim.key = caster.key//Now we throw the caste into the victim's body.
victim.mind = caster.mind//Do the same for their mind and spell list.
caster.mind.transfer_to(victim)
victim.spell_list = caster.spell_list//Now they are inside the victim's body.
if(victim.mind.special_verbs.len)//To add all the special verbs for the original caster.
for(var/V in caster.mind.special_verbs)//Not too important but could come into play.
caster.verbs += V
caster.key = temp_ghost.key//Tranfer the original victim, now in a ghost, into the caster's body.
caster.mind = temp_ghost.mind//Along with their mind and spell list.
caster.spell_list = temp_ghost.spell_list
ghost.mind.transfer_to(caster)
caster.key = ghost.key //have to transfer the key since the mind was not active
caster.spell_list = ghost.spell_list
if(caster.mind.special_verbs.len)//If they had any special verbs, we add them here.
for(var/V in caster.mind.special_verbs)
caster.verbs += V
//MIND TRANSFER END
//Now we update mind current mob so we know what body they are in for end round reporting.
caster.mind.current = caster
victim.mind.current = victim
//Here we paralyze both mobs and knock them out for a time.
caster.Paralyse(paralysis_amount_caster)
victim.Paralyse(paralysis_amount_victim)
@@ -121,5 +112,3 @@ Also, you never added distance checking after target is selected. I've went ahea
//After a certain amount of time the victim gets a message about being in a different body.
spawn(msg_wait)
caster << "\red You feel woozy and lightheaded. <b>Your body doesn't seem like your own.</b>"
del(temp_ghost)

View File

@@ -9,6 +9,7 @@
canmove = 0
blinded = 0
anchored = 1 // don't get pushed around
var/mob/corpse = null // observer mode
// var/mob/corpse = null // observer mode //we use mind.current as the 'corpse' now
var/can_reenter_corpse
var/datum/hud/living/carbon/hud = null // hud
var/bootime = 0

View File

@@ -1,5 +1,6 @@
/mob/living/carbon/alien/larva
name = "alien larva"
real_name = "alien larva"
icon_state = "larva"
pass_flags = PASSTABLE

View File

@@ -297,6 +297,7 @@ proc
if(T.opacity)
return 0
return 1
#undef SIGN
proc/isInSight(var/atom/A, var/atom/B)
var/turf/Aturf = get_turf(A)

View File

@@ -509,7 +509,7 @@
O.loc = M.loc
if(M.mind)
M.mind.transfer_to(O)
M.mind.transfer_to(O) //transfer our mind to the cute little monkey
if (connected) //inside dna thing
var/obj/machinery/dna_scannernew/C = connected
@@ -578,7 +578,7 @@
O.loc = M.loc
if(M.mind)
M.mind.transfer_to(O)
M.mind.transfer_to(O) //transfer our mind to the human
if (connected) //inside dna thing
var/obj/machinery/dna_scannernew/C = connected
@@ -696,19 +696,14 @@
user << "\blue <B>Subject cannot have abiotic items on.</B>"
return
var/mob/M = G.affecting
if (M.client)
if(M.client)
M.client.perspective = EYE_PERSPECTIVE
M.client.eye = src
M.loc = src
src.occupant = M
src.icon_state = "scanner_1"
/*
for(var/obj/O in src) // this is stupid too
O.loc = src.loc
//Foreach goto(154)
*/
src.add_fingerprint(user)
//G = null
// search for ghosts, if the corpse is empty and the scanner is connected to a cloner
if(locate(/obj/machinery/computer/cloning, get_step(src, NORTH)) \
@@ -716,9 +711,9 @@
|| locate(/obj/machinery/computer/cloning, get_step(src, EAST)) \
|| locate(/obj/machinery/computer/cloning, get_step(src, WEST)))
if (!M.client)
if(!M.client && M.mind)
for(var/mob/dead/observer/ghost in player_list)
if(ghost.corpse == M && ghost.client)
if(ghost.mind == M.mind)
ghost << "<b><font color = #330033><font size = 3>Your corpse has been placed into a cloning scanner. Return to your body if you want to be resurrected/cloned!</b> (Verbs -> Ghost -> Re-enter corpse)</font color>"
break
del(G)

View File

@@ -42,20 +42,14 @@
var/list/candidates = list()
for(var/mob/dead/observer/G in player_list)
if(G.client.be_alien)
if(G.corpse)
if(G.corpse.stat==2)
candidates.Add(G)
else
candidates.Add(G)
if(!(G.mind && G.mind.current && G.mind.current.stat != DEAD))
candidates += G.key
for(var/i = 0 to wave_size)
if(!candidates.len) break
var/mob/dead/observer/G = pick(candidates)
var/mob/living/blob/B = new/mob/living/blob(src.loc)
if(G.client)
G.client.screen.len = null
B.ghost_name = G.real_name
B.key = G.key
if(candidates.len)
for(var/i = 0 to wave_size)
var/mob/living/blob/B = new/mob/living/blob(src.loc)
B.key = pick(candidates)
candidates -= B.key
/*
Pulse(var/pulse = 0, var/origin_dir = 0)//Todo: Fix spaceblob expand

View File

@@ -480,17 +480,12 @@
for(var/mob/dead/observer/G in player_list)
candidates += G
for(var/mob/dead/observer/G in candidates)
if(!G.client || !G.key)
candidates.Remove(G)
for(var/obj/structure/stool/bed/chair/C in locate(/area/shuttle/escape/transit))
var/mob/living/carbon/human/new_commando = create_death_commando(C, 0)
if(candidates.len)
var/mob/dead/observer/G = pick(candidates)
new_commando.mind.key = G.key//For mind stuff.
new_commando.key = G.key
new_commando.internal = new_commando.s_store
new_commando.internals.icon_state = "internal1"

View File

@@ -241,32 +241,26 @@
var/list/vents = list()
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in world)
if(temp_vent.loc.z == 1 && !temp_vent.welded)
vents.Add(temp_vent)
vents += temp_vent
if(prob(10)) spawncount++ //rarely, have two larvae spawn instead of one
while(spawncount >= 1)
var/list/candidates = list() //List of candidate KEYs to control the new larvae. ~Carn
for(var/mob/dead/observer/G in player_list)
if(G.client.be_alien)
if(((G.client.inactivity/10)/60) <= 5)
if(!(G.mind && G.mind.current && G.mind.current != DEAD))
candidates += G.key
if(prob(33)) spawncount++ //sometimes, have two larvae spawn instead of one
while((spawncount >= 1) && vents.len && candidates.len)
var/obj/vent = pick(vents)
var/candidate = pick(candidates)
var/list/candidates = list() // Picks a random ghost in the world to shove in the larva -- TLE; If there's no ghost... well, sucks. Wasted event. -- Urist
var/mob/living/carbon/alien/larva/new_xeno = new(vent.loc)
new_xeno.key = candidate
for(var/mob/dead/observer/G in player_list)
if(G.client)
if(G.client.be_alien)
if(((G.client.inactivity/10)/60) <= 5)
if(G.corpse)
if(G.corpse.stat==2)
candidates.Add(G)
if(!G.corpse)
candidates.Add(G)
if(candidates.len)
var/mob/dead/observer/G = pick(candidates)
var/mob/living/carbon/alien/larva/new_xeno = new(vent.loc)
new_xeno.mind_initialize(G,"Larva")
new_xeno.key = G.key
vents.Remove(vent)
spawncount -= 1
candidates -= candidate
vents -= vent
spawncount--
spawn(rand(3000, 6000)) //Delayed announcements to keep the crew on their toes.
command_alert("Unidentified lifesigns detected coming aboard [station_name()]. Secure any exterior access, including ducting and ventilation.", "Lifesign Alert")

View File

@@ -134,28 +134,25 @@ Malf AIs/silicons aren't added. Monkeys aren't added. Messes with objective comp
//Here we pick a location and spawn the ninja.
var/list/spawn_list = list()
for(var/obj/effect/landmark/L in world)
if (L.name == "carpspawn")
if(L.name == "carpspawn")
spawn_list.Add(L)
var/mob/dead/observer/G
var/list/candidates = list()
for(G in player_list)
if(((G.client.inactivity/10)/60) <= 5)
candidates.Add(G)
var/list/candidates = list() //list of candidate keys
for(var/mob/dead/observer/G in player_list)
if(!G.client.holder && ((G.client.inactivity/10)/60) <= 5)
if(!(G.mind && G.mind.current && G.mind.current.stat != DEAD))
candidates += G.key
if(!candidates.len) return
//The ninja will be created on the right spawn point or at late join.
var/mob/living/carbon/human/new_ninja = create_space_ninja(pick(spawn_list.len ? spawn_list : latejoin ))
new_ninja.key = pick(candidates)
new_ninja.wear_suit:randomize_param()//Give them a random set of suit parameters.
new_ninja.internal = new_ninja.s_store //So the poor ninja has something to breath when they spawn in spess.
new_ninja.internals.icon_state = "internal1"
if(candidates.len)
G = pick(candidates)
new_ninja.key = G.key
new_ninja.mind.key = new_ninja.key
new_ninja.wear_suit:randomize_param()//Give them a random set of suit parameters.
new_ninja.internal = new_ninja.s_store //So the poor ninja has something to breath when they spawn in spess.
new_ninja.internals.icon_state = "internal1"
else
del(new_ninja)
return
//Now for the rest of the stuff.
var/datum/mind/ninja_mind = new_ninja.mind//For easier reference.
@@ -437,7 +434,6 @@ As such, it's hard-coded for now. No reason for it not to be, really.
var/mob/living/carbon/human/new_ninja = create_space_ninja(pick(spawn_list.len ? spawn_list : latejoin ))
new_ninja.wear_suit:randomize_param()
new_ninja.mind.key = G.key
new_ninja.key = G.key
new_ninja.mind.store_memory("<B>Mission:</B> \red [mission].<br>")
@@ -471,19 +467,12 @@ As such, it's hard-coded for now. No reason for it not to be, really.
return new_ninja
/mob/living/carbon/human/proc/create_mind_space_ninja()
if(mind)
mind.assigned_role = "MODE"
mind.special_role = "Space Ninja"
else
mind = new
mind.current = src
mind.original = src
mind.assigned_role = "MODE"
mind.special_role = "Space Ninja"
if(!(mind in ticker.minds))
ticker.minds += mind//Adds them to regular mind list.
if(!(mind in ticker.mode.traitors))//If they weren't already an extra traitor.
ticker.mode.traitors += mind//Adds them to current traitor list. Which is really the extra antagonist list.
mind_initialize()
mind.assigned_role = "MODE"
mind.special_role = "Space Ninja"
//Adds them to current traitor list. Which is really the extra antagonist list.
ticker.mode.traitors |= mind
return 1
/mob/living/carbon/human/proc/equip_space_ninja(safety=0)//Safety in case you need to unequip stuff for existing characters.

View File

@@ -167,18 +167,13 @@
switch(construct_class)
if("Juggernaut")
var/mob/living/simple_animal/constructarmoured/Z = new /mob/living/simple_animal/constructarmoured (get_turf(T.loc))
if (A.client)
A.client.mob = Z
Z.mind_initialize(Z)
if(iscultist(U))
if (ticker.mode.name == "cult")
ticker.mode:add_cultist(Z.mind)
Z.mind.special_role = "Cultist"
ticker.mode.update_cult_icons_added(Z.mind)
else
ticker.mode.cult+=Z.mind
Z.mind.special_role = "Cultist"
ticker.mode.update_cult_icons_added(Z.mind)
Z.key = A.key
if(iscultist(U))
if(ticker.mode.name == "cult")
ticker.mode:add_cultist(Z.mind)
else
ticker.mode.cult+=Z.mind
ticker.mode.update_cult_icons_added(Z.mind)
del(T)
Z << "<B>You are playing a Juggernaut. Though slow, you can withstand extreme punishment, and rip apart enemies and walls alike.</B>"
Z << "<B>You are still bound to serve your creator, follow their orders and help them complete their goals at all costs.</B>"
@@ -188,18 +183,13 @@
if("Wraith")
var/mob/living/simple_animal/constructwraith/Z = new /mob/living/simple_animal/constructwraith (get_turf(T.loc))
if (A.client)
A.client.mob = Z
Z.mind_initialize(Z)
if(iscultist(U))
if (ticker.mode.name == "cult")
ticker.mode:add_cultist(Z.mind)
Z.mind.special_role = "Cultist"
ticker.mode.update_cult_icons_added(Z.mind)
else
ticker.mode.cult+=Z.mind
Z.mind.special_role = "Cultist"
ticker.mode.update_cult_icons_added(Z.mind)
Z.key = A.key
if(iscultist(U))
if(ticker.mode.name == "cult")
ticker.mode:add_cultist(Z.mind)
else
ticker.mode.cult+=Z.mind
ticker.mode.update_cult_icons_added(Z.mind)
del(T)
Z << "<B>You are playing a Wraith. Though relatively fragile, you are fast, deadly, and even able to phase through walls.</B>"
Z << "<B>You are still bound to serve your creator, follow their orders and help them complete their goals at all costs.</B>"
@@ -209,18 +199,13 @@
if("Artificer")
var/mob/living/simple_animal/constructbuilder/Z = new /mob/living/simple_animal/constructbuilder (get_turf(T.loc))
if (A.client)
A.client.mob = Z
Z.mind_initialize(Z)
if(iscultist(U))
if (ticker.mode.name == "cult")
ticker.mode:add_cultist(Z.mind)
Z.mind.special_role = "Cultist"
ticker.mode.update_cult_icons_added(Z.mind)
else
ticker.mode.cult+=Z.mind
Z.mind.special_role = "Cultist"
ticker.mode.update_cult_icons_added(Z.mind)
Z.key = A.key
if(iscultist(U))
if(ticker.mode.name == "cult")
ticker.mode:add_cultist(Z.mind)
else
ticker.mode.cult+=Z.mind
ticker.mode.update_cult_icons_added(Z.mind)
del(T)
Z << "<B>You are playing an Artificer. You are incredibly weak and fragile, but you are able to construct fortifications, repair allied constructs (by clicking on them), and even create new constructs</B>"
Z << "<B>You are still bound to serve your creator, follow their orders and help them complete their goals at all costs.</B>"

View File

@@ -549,21 +549,17 @@
U.verbs -= V
if(H.mind.special_verbs.len)
for(var/V in H.mind.special_verbs)
H.verbs -= V
H.verbs -= V
//empty out H
var/mob/dead/observer/G = new /mob/dead/observer(H) //Temp-mob
G.key = H.key //Stops H.key getting kicked
var/datum/mind/temp_mind = H.mind //ghosts shouldn't hold minds
temp_mind.current = null
H.mind = null
var/mob/dead/observer/G = H.ghostize(0) //Transfers H to a temporary mob
//Start the Transfer
U.mind.transfer_to(H)
temp_mind.transfer_to(U)
//Re-add those special verbs and stuff
G.mind.transfer_to(U)
U.key = G.key //has to be called explicitly since ghostize() set the datum/mind/var/active = 0
//Re-add those special verbs and stuff
if(H.mind.special_verbs.len)
var/spell_loss = 1//Can lose only one spell during transfer.
var/probability = 95 //To determine the chance of wizard losing their spell.

View File

@@ -113,13 +113,25 @@
//Clonepod
//Start growing a human clone in the pod!
/obj/machinery/clonepod/proc/growclone(mob/ghost as mob, var/clonename, var/ui, var/se, var/mindref, var/mrace, var/UI, var/datum/changeling/changelingClone)
if(!(ghost && ghost.client) || src.mess || src.attempting)
/obj/machinery/clonepod/proc/growclone(var/ckey, var/clonename, var/ui, var/se, var/mindref, var/mrace, var/UI, var/datum/changeling/changelingClone)
if(mess || attempting)
return 0
var/datum/mind/clonemind = locate(mindref)
if(!istype(clonemind,/datum/mind)) //not a mind
return 0
if( clonemind.current && clonemind.current.stat != DEAD ) //mind is associated with a non-dead body
return 0
if(clonemind.active) //somebody is using that mind
if( ckey(clonemind.key)!=ckey )
return 0
else
for(var/mob/dead/observer/G in player_list)
if(G.ckey == ckey)
if(G.can_reenter_corpse)
break
else
return 0
var/datum/mind/clonemind = locate(mindref) in ticker.minds
if( !(istype(clonemind,/datum/mind) && (!clonemind.current || clonemind.current.stat==DEAD)) )
return 0
src.heal_level = rand(75,100) //Randomizes what health the clone is when ejected
@@ -149,9 +161,9 @@
H.updatehealth()
clonemind.transfer_to(H)
H.ckey = ckey
H << "<span class='notice'><b>Consciousness slowly creeps over you as your body regenerates.</b><br><i>So this is what cloning feels like. I wonder what happened to the old me... My memories are kinda fuzzy.</i></span>"
// -- Mode/mind specific stuff goes here
switch(ticker.mode.name)

View File

@@ -369,16 +369,25 @@
var/datum/data/record/C = locate(href_list["clone"])
//Look for that player! They better be dead!
if(istype(C))
var/mob/selected = find_dead_player("[C.fields["ckey"]]")
//Can't clone without someone to clone. Or a pod. Or if the pod is busy. Or full of gibs.
if ((!selected) || (!src.pod1) || (src.pod1.occupant) || (src.pod1.mess) || !config.revival_cloning)
src.temp = "Unable to initiate cloning cycle." // most helpful error message in THE HISTORY OF THE WORLD
else if (src.pod1.growclone(selected, C.fields["name"], C.fields["UI"], C.fields["SE"], C.fields["mind"], C.fields["mrace"], C.fields["interface"],C.fields["changeling"]))
src.temp = "Cloning cycle activated."
src.records.Remove(C)
//Can't clone without someone to clone. Or a pod. Or if the pod is busy. Or full of gibs.
if(!pod1)
temp = "Error: No Clonepod detected."
else if(pod1.occupant)
temp = "Error: Clonepod is currently occupied."
else if(pod1.mess)
temp = "Error: Clonepod malfunction."
else if(!config.revival_cloning)
temp = "Error: Unable to initiate cloning cycle."
else if(pod1.growclone(C.fields["ckey"], C.fields["name"], C.fields["UI"], C.fields["SE"], C.fields["mind"], C.fields["mrace"], C.fields["interface"],C.fields["changeling"]))
temp = "Initiating cloning cycle..."
records.Remove(C)
del(C)
src.menu = 1
menu = 1
else
temp = "Initiating cloning cycle...<br>Error: Post-initialisation failed. Cloning cycle aborted."
else
temp = "Error: Data corruption."
else if (href_list["menu"])
src.menu = text2num(href_list["menu"])

View File

@@ -890,7 +890,7 @@ obj/machinery/hydroponics/attackby(var/obj/item/O as obj, var/mob/user as mob)
else
podman.real_name = "Pod Person [rand(0,999)]"
podman.original_name = podman.real_name
mind.transfer_to(podman)
// -- Mode/mind specific stuff goes here. TODO! Broken :( Should be merged into mob/living/Login
switch(ticker.mode.name)

View File

@@ -216,60 +216,53 @@ var/list/sacrificed = list()
raise()
var/mob/living/carbon/human/corpse_to_raise
var/mob/living/carbon/human/body_to_sacrifice
var/mob/living/carbon/human/ghost
var/unsuitable_corpse_found = 0
var/corpse_is_target = 0
var/is_sacrifice_target = 0
for(var/mob/living/carbon/human/M in src.loc)
if (M.stat>=2)
if (M.key)
unsuitable_corpse_found = 1
else if (ticker.mode.name == "cult" && M.mind == ticker.mode:sacrifice_target)
corpse_is_target = 1
if(M.stat == DEAD)
if(ticker.mode.name == "cult" && M.mind == ticker.mode:sacrifice_target)
is_sacrifice_target = 1
else
corpse_to_raise = M
if(M.key)
M.ghostize(1) //kick them out of their body
break
if (!corpse_to_raise)
if (unsuitable_corpse_found)
usr << "\red The body still has some earthly ties. It must sever them, if only for them to grow again later."
if (corpse_is_target)
if(!corpse_to_raise)
if(is_sacrifice_target)
usr << "\red The Geometer of blood wants this mortal for himself."
return fizzle()
var/sacrifice_is_target = 0
is_sacrifice_target = 0
find_sacrifice:
for(var/obj/effect/rune/R in world)
if(R.word1==wordblood && R.word2==wordjoin && R.word3==wordhell)
for(var/mob/living/carbon/human/N in R.loc)
if (ticker.mode.name == "cult" && N.mind && N.mind == ticker.mode:sacrifice_target)
sacrifice_is_target = 1
if(ticker.mode.name == "cult" && N.mind && N.mind == ticker.mode:sacrifice_target)
is_sacrifice_target = 1
else
if(N.stat<2)
if(N.stat!= DEAD)
body_to_sacrifice = N
break find_sacrifice
if (!body_to_sacrifice)
if (sacrifice_is_target)
if(!body_to_sacrifice)
if (is_sacrifice_target)
usr << "\red The Geometer of blood wants that corpse for himself."
else
usr << "\red You need a dead corpse as source of energy to put soul in new body."
usr << "\red The sacrifical corpse is not dead. You must free it from this world of illusions before it may be used."
return fizzle()
for(var/mob/dead/observer/O in src.loc)
if(!O.client)
continue
var/mob/dead/observer/ghost
for(var/mob/dead/observer/O in loc)
if(!O.client) continue
if(O.mind && O.mind.current && O.mind.current.stat != DEAD) continue
ghost = O
break
if (!ghost)
usr << "\red You do not feel an ethernal immaterial soul here."
if(!ghost)
usr << "\red You require a restless spirit which clings to this world. Beckon their prescence with the sacred chants of Nar-Sie."
return fizzle()
// rejuvenatedheal(M)
corpse_to_raise.mind = new//Mind initialize stuff.
corpse_to_raise.mind.current = corpse_to_raise
corpse_to_raise.mind.original = corpse_to_raise
corpse_to_raise.mind.key = ghost.key
corpse_to_raise.key = ghost.key
for(var/datum/organ/external/affecting in corpse_to_raise.organs)
affecting.heal_damage(1000, 1000)
corpse_to_raise.setToxLoss(0)
@@ -278,15 +271,16 @@ var/list/sacrificed = list()
corpse_to_raise.SetStunned(0)
corpse_to_raise.SetWeakened(0)
corpse_to_raise.radiation = 0
corpse_to_raise.buckled = null
if (corpse_to_raise.handcuffed)
del(corpse_to_raise.handcuffed)
corpse_to_raise.update_inv_handcuffed(0)
corpse_to_raise.stat=0
// corpse_to_raise.buckled = null
// if(corpse_to_raise.handcuffed)
// del(corpse_to_raise.handcuffed)
// corpse_to_raise.update_inv_handcuffed(0)
corpse_to_raise.stat = CONSCIOUS
corpse_to_raise.updatehealth()
corpse_to_raise.UpdateDamageIcon()
corpse_to_raise.key = ghost.key //the corpse will keep its old mind! but a new player takes ownership of it (they are essentially possessed)
//This means, should that player leave the body, the original may re-enter
usr.say("Pasnar val'keriam usinar. Savrae ines amutan. Yam'toth remium il'tarat!")
corpse_to_raise.visible_message("\red [corpse_to_raise]'s eyes glow with a faint red as he stands up, slowly starting to breathe again.", \
"\red Life... I'm alive again...", \
@@ -295,10 +289,12 @@ var/list/sacrificed = list()
"\red You feel as your blood boils, tearing you apart.", \
"\red You hear a thousand voices, all crying in pain.")
body_to_sacrifice.gib()
if (ticker.mode.name == "cult")
ticker.mode:add_cultist(body_to_sacrifice.mind)
else
ticker.mode.cult+=body_to_sacrifice.mind
// if(ticker.mode.name == "cult")
// ticker.mode:add_cultist(corpse_to_raise.mind)
// else
// ticker.mode.cult |= corpse_to_raise.mind
corpse_to_raise << "<font color=\"purple\"><b><i>Your blood pulses. Your head throbs. The world goes red. All at once you are aware of a horrible, horrible truth. The veil of reality has been ripped away and in the festering wound left behind something sinister takes root.</b></i></font>"
corpse_to_raise << "<font color=\"purple\"><b><i>Assist your new compatriots in their dark dealings. Their goal is yours, and yours is theirs. You serve the Dark One above all else. Bring It back.</b></i></font>"
return
@@ -344,14 +340,15 @@ var/list/sacrificed = list()
usr.visible_message("\red [usr]'s eyes glow blue as \he freezes in place, absolutely motionless.", \
"\red The shadow that is your spirit separates itself from your body. You are now in the realm beyond. While this is a great sight, being here strains your mind and body. Hurry...", \
"\red You hear only complete silence for a moment.")
usr.ghostize()
for(L.ajourn=1,L.ajourn)
sleep(10)
usr.ghostize(1)
L.ajourn = 1
while(L)
if(L.key)
L.ajourn=0
return
else
L.take_organ_damage(1, 0)
L.take_organ_damage(10, 0)
sleep(100)
return fizzle()
@@ -366,8 +363,8 @@ var/list/sacrificed = list()
return this_rune.fizzle()
var/mob/dead/observer/ghost
for(var/mob/dead/observer/O in this_rune.loc)
if (!O.client)
continue
if(!O.client) continue
if(O.mind && O.mind.current && O.mind.current.stat != DEAD) continue
ghost = O
break
if(!ghost)
@@ -380,38 +377,30 @@ var/list/sacrificed = list()
"\red You hear liquid flowing.")
D.real_name = "Unknown"
for(var/obj/item/weapon/paper/P in this_rune.loc)
/*
if(length(P.info)<=24)
D.real_name = P.info
break
*/
if(length(P.name)<=24)
D.real_name = P.name
break
D.universal_speak = 1
D.nodamage = 0
D.mind = new//Mind initialize stuff.
D.mind.current = D
D.mind.original = D
D.mind.key = ghost.key
D.key = ghost.key
ghost.invisibility = 101
if (ticker.mode.name == "cult")
if(ticker.mode.name == "cult")
ticker.mode:add_cultist(D.mind)
else
ticker.mode.cult+=D.mind
D << "<font color=\"purple\"><b><i>Your blood pulses. Your head throbs. The world goes red. All at once you are aware of a horrible, horrible truth. The veil of reality has been ripped away and in the festering wound left behind something sinister takes root.</b></i></font>"
D << "<font color=\"purple\"><b><i>Assist your new compatriots in their dark dealings. Their goal is yours, and yours is theirs. You serve the Dark One above all else. Bring It back.</b></i></font>"
var/mob/living/user = usr
while(this_rune && user && user.stat==0 && user.client && user.loc==this_rune.loc)
while(this_rune && user && user.stat==CONSCIOUS && user.client && user.loc==this_rune.loc)
user.take_organ_damage(1, 0)
sleep(30)
if(D)
D.visible_message("\red [D] slowly dissipates into dust and bones.", \
"\red You feel pain, as bonds formed between your soul and this homunculus break.", \
"\red You hear faint rustle.")
ghost.invisibility = INVISIBILITY_OBSERVER
ghost.key = D.key
D.dust()
return

View File

@@ -77,17 +77,16 @@
if(L && L.implanted)
revsafe = 1
break
M:update_mind() //give them a mind datum if they don't have one. won't work if they are logged out/ghosted or something.
if(M.mind)
if(M.mind.has_been_rev)
revsafe = 2
if(!revsafe)
M.mind.has_been_rev = 1
ticker.mode.add_revolutionary(M.mind)
else if(revsafe == 1)
user << "<span class='warning'>Something seems to be blocking the flash!</span>"
else
user << "<span class='warning'>This mind seems resistant to the flash!</span>"
M.mind_initialize() //give them a mind datum if they don't have one.
if(M.mind.has_been_rev)
revsafe = 2
if(!revsafe)
M.mind.has_been_rev = 1
ticker.mode.add_revolutionary(M.mind)
else if(revsafe == 1)
user << "<span class='warning'>Something seems to be blocking the flash!</span>"
else
user << "<span class='warning'>This mind seems resistant to the flash!</span>"
user << "<span class='warning'>This mind is so vacant that it is not susceptible to influence!</span>"
else
flashfail = 1

View File

@@ -167,10 +167,11 @@
return
if(!M.brainmob.key)
var/ghost_can_reenter = 0
for(var/mob/dead/observer/G in dead_mob_list)
if(G.corpse == M.brainmob)
ghost_can_reenter = 1
break
if(M.brainmob.mind)
for(var/mob/dead/observer/G in player_list)
if(G.can_reenter_corpse && G.mind == M.brainmob.mind)
ghost_can_reenter = 1
break
if(!ghost_can_reenter)
user << "<span class='notice'>The mmi indicates that their mind is completely unresponsive; there's no point.</span>"
return
@@ -198,13 +199,9 @@
M.brainmob.mind.transfer_to(O)
if(O.mind && O.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")
O.job = "Cyborg"
O.cell = chest.cell

View File

@@ -49,16 +49,16 @@
/obj/item/borg/upgrade/restart/action(var/mob/living/silicon/robot/R)
if(!R.key)
for(var/mob/dead/observer/ghost in player_list)
if(ghost.corpse == R)
ghost.client.mob = ghost.corpse
if(R.health < 0)
usr << "You have to repair the borg before using this module!"
return 0
R.stat = 0
if(!R.key)
for(var/mob/dead/observer/ghost in player_list)
if(ghost.mind && ghost.mind.current == R)
R.key = ghost.key
R.stat = CONSCIOUS
return 1

View File

@@ -246,34 +246,28 @@ proc/cmd_admin_mute(mob/M as mob, mute_type, automute = 0)
else
return 0
// Picks a random ghost for the role if none is specified. Mostly a copy of alien burst code.
var/candidates_list[] = list()
if(G)//If G exists through a passed argument.
candidates_list += G.client
else//Else we need to find them.
var/selected_key
if(G && G.key)
selected_key = G.key
else
var/list/candidates = list() //List of candidate KEYS to assume control of the new larva ~Carn
for(G in player_list)
if(!G.client.holder && ((G.client.inactivity/10)/60) <= 5)
candidates_list += G.client//We want their client, not their ghost.
if(candidates_list.len)//If there are people to spawn.
if(!G)//If G was not passed through an argument.
var/client/G_client = input("Pick the client you want to respawn as a xeno.", "Active Players") as null|anything in candidates_list//It will auto-pick a person when there is only one candidate.
if(G_client)//They may have logged out when the admin was choosing people. Or were not chosen. Would run time error otherwise.
G = G_client.mob
else
return 0
if(G)//If G exists.
message_admins("\blue [key_name_admin(usr)] has spawned [G.key] as a filthy xeno.", 1)
new_xeno.mind_initialize(G, alien_caste)
new_xeno.key = G.key
else//We won't be reporting duds.
del(new_xeno)
if(G.client.be_alien)
if(((G.client.inactivity/10)/60) <= 5)
if(!(G.mind && G.mind.current && G.mind.current.stat != DEAD))
candidates += G.key
if(candidates.len)
selected_key = input("Pick the client you want to respawn as a xeno.", "Suitable Candidates") as null|anything in candidates
if(selected_key)
new_xeno.key = selected_key
message_admins("\blue [key_name_admin(usr)] has spawned [selected_key] as a filthy xeno.", 1)
return 1
alert("There are no available ghosts to throw into the xeno. Aborting command.")
del(new_xeno)
return 0
else
//we couldn't find a candidate
usr << "<font color='red'>Error: create_xeno(): no suitable players.</font>"
del(new_xeno)
return 0
/*
If a guy was gibbed and you want to revive him, this is a good way to do so.
@@ -287,130 +281,96 @@ Traitors and the like can also be revived with the previous role mostly intact.
if(!holder)
src << "Only administrators may use this command."
return
var/input = input(src, "Please specify which key will be respawned.", "Key", "")
var/input = ckey(input(src, "Please specify which key will be respawned.", "Key", ""))
if(!input)
return
var/mob/dead/observer/G_found
for(var/mob/dead/observer/G in player_list)
if(G.client&&G.ckey==ckey(input))
if(G.ckey == input)
G_found = G
break
if(!G_found)//If a ghost was not found.
alert("There is no active key like that in the game or the person is not currently a ghost. Aborting command.")
usr << "<font color='red'>There is no active key like that in the game or the person is not currently a ghost.</font>"
return
//First we spawn a dude.
var/mob/living/carbon/human/new_character = new(src)//The mob being spawned.
if(G_found.mind && !G_found.mind.active) //mind isn't currently in use by someone/something
//Check if they were an alien
if(G_found.mind.assigned_role=="Alien")
if(alert("This character appears to have been an alien. Would you like to respawn them as such?",,"Yes","No")=="Yes")
var/turf/T
if(xeno_spawn.len) T = pick(xeno_spawn)
else T = pick(latejoin)
//Second, we check if they are an alien or monkey.
var/adj_name = copytext(G_found.real_name,1,7)//What is their name?
if(G_found.mind&&G_found.mind.special_role=="Alien")//If they have a mind, are they an alien?
adj_name="alien "
if( adj_name==("alien "||"monkey"))
if(alert("This character appears to either be an an alien or monkey. Would you like to respawn them as such?",,"Yes","No")=="Yes")//If you do.
switch(adj_name)//Let's check based on adjusted name.
if("monkey")//A monkey. Monkeys don't have a mind, so we can safely spawn them here if needed.
//TO DO: Monkeys may have a mind now. May need retooling.
var/mob/living/carbon/monkey/M = new(pick(latejoin))//Spawn a monkey at latejoin.
M.mind = G_found.mind
if(M.mind)//If the mind is not null.
M.mind.current = M
M.key = G_found.key//They are now a monkey. Nothing else needs doing.
if("alien ")//An alien. Aliens can have a mind which can be used to determine a few things.
if(G_found.mind)
var/turf/location = xeno_spawn.len ? pick(xeno_spawn) : pick(latejoin)//Location where they will be spawned.
var/mob/living/carbon/alien/new_xeno//Null alien mob first.
switch(G_found.mind.special_role)//If they have a mind, we can determine which caste they were.
if("Hunter")
new_xeno = new/mob/living/carbon/alien/humanoid/hunter(location)
if("Sentinel")
new_xeno = new/mob/living/carbon/alien/humanoid/sentinel(location)
if("Drone")
new_xeno = new/mob/living/carbon/alien/humanoid/drone(location)
if("Queen")
new_xeno = new/mob/living/carbon/alien/humanoid/queen(location)
else//If we don't know what special role they have, for whatever reason, or they're a larva.
create_xeno(G_found)
return
//Now to give them a new mind.
new_xeno.mind = new
new_xeno.mind.assigned_role = "Alien"
new_xeno.mind.special_role = G_found.mind.special_role
new_xeno.mind.key = G_found.key
new_xeno.mind.current = new_xeno
new_xeno.key = G_found.key
new_xeno << "You have been fully respawned. Enjoy the game."
message_admins("\blue [key_name_admin(usr)] has respawned [new_xeno.key] as a filthy xeno.", 1)
//And we're done. Announcing other stuff is handled by spawn_xeno.
else
create_xeno(G_found)//Else we default to the standard command for spawning a xenomorph.
var/mob/living/carbon/alien/new_xeno
switch(G_found.mind.special_role)//If they have a mind, we can determine which caste they were.
if("Hunter") new_xeno = new /mob/living/carbon/alien/humanoid/hunter(T)
if("Sentinel") new_xeno = new /mob/living/carbon/alien/humanoid/sentinel(T)
if("Drone") new_xeno = new /mob/living/carbon/alien/humanoid/drone(T)
if("Queen") new_xeno = new /mob/living/carbon/alien/humanoid/queen(T)
else//If we don't know what special role they have, for whatever reason, or they're a larva.
create_xeno(G_found)
return
del(G_found)
return
//Monkeys aren't terribly important so we won't be announcing them. The proc basically ends here.
else//Or not.
G_found.mind=null//Null their mind so we don't screw things up ahead.
G_found.real_name="[pick(pick(first_names_male,first_names_female))] [pick(last_names)]"//Give them a random real name.
/*Third, we try and locate a record for the person being respawned through data_core.
This isn't an exact science but it does the trick more often than not.*/
var/datum/data/record/record_found//Referenced to later to either randomize or not randomize the character.
if(G_found.mind)//They must have a mind to reference the record. Here we also double check for aliens.
//Now to give them their mind back.
G_found.mind.transfer_to(new_xeno) //be careful when doing stuff like this! I've already checked the mind isn't in use
new_xeno.key = G_found.key
new_xeno << "You have been fully respawned. Enjoy the game."
message_admins("\blue [key_name_admin(usr)] has respawned [new_xeno.key] as a filthy xeno.", 1)
return //all done. The ghost is auto-deleted
//check if they were a monkey
else if(findtext(G_found.real_name,"monkey"))
if(alert("This character appears to have been a monkey. Would you like to respawn them as such?",,"Yes","No")=="Yes")
var/mob/living/carbon/monkey/new_monkey = new(pick(latejoin))
G_found.mind.transfer_to(new_monkey) //be careful when doing stuff like this! I've already checked the mind isn't in use
new_monkey.key = G_found.key
new_monkey << "You have been fully respawned. Enjoy the game."
message_admins("\blue [key_name_admin(usr)] has respawned [new_monkey.key] as a filthy xeno.", 1)
return //all done. The ghost is auto-deleted
//Ok, it's not a xeno or a monkey. So, spawn a human.
var/mob/living/carbon/human/new_character = new(pick(latejoin))//The mob being spawned.
var/datum/data/record/record_found //Referenced to later to either randomize or not randomize the character.
if(G_found.mind && !G_found.mind.active) //mind isn't currently in use by someone/something
/*Try and locate a record for the person being respawned through data_core.
This isn't an exact science but it does the trick more often than not.*/
var/id = md5("[G_found.real_name][G_found.mind.assigned_role]")
for(var/datum/data/record/t in data_core.locked)
if(t.fields["id"]==id)
record_found = t//We shall now reference the record.
break
//Now we do some mind locating to see how to set up the rest of the character.
if(G_found.mind)//If they had a previous mind.
new_character.mind = G_found.mind
new_character.mind.special_verbs = list()//New list because they will receive them again.
if(record_found)//If they have a record we can determine a few things.
new_character.real_name = record_found.fields["name"]
new_character.gender = record_found.fields["sex"]
new_character.age = record_found.fields["age"]
new_character.b_type = record_found.fields["b_type"]
else
new_character.mind = new()
ticker.minds += new_character.mind//And we'll add it to the minds database.
new_character.mind.original = new_character//If they are respawning with a new character.
if(!record_found)//We have to pick their role if they have no record.
if(G_found.mind&&G_found.mind.assigned_role)//But they may have an assigned role already.
new_character.mind.assigned_role = G_found.mind.assigned_role//Also makes sure our MODE people are equipped right later on.
else
var/assigned_role = input("Please specify which job the character will be respawned as.", "Assigned role") as null|anything in get_all_jobs()
if(!assigned_role) new_character.mind.assigned_role = "Assistant"//Defaults to assistant.
else new_character.mind.assigned_role = assigned_role
new_character.gender = pick(MALE,FEMALE)
var/datum/preferences/A = new()
A.randomize_appearance_for(new_character)
new_character.real_name = G_found.real_name
if(!new_character.real_name)
if(new_character.gender == MALE)
new_character.real_name = capitalize(pick(first_names_male)) + " " + capitalize(pick(last_names))
else
new_character.real_name = capitalize(pick(first_names_female)) + " " + capitalize(pick(last_names))
new_character.name = new_character.real_name
new_character.original_name = new_character.real_name
if(G_found.mind && !G_found.mind.active)
G_found.mind.transfer_to(new_character) //be careful when doing stuff like this! I've already checked the mind isn't in use
new_character.mind.special_verbs = list()
else
new_character.mind_initialize()
if(!new_character.mind.assigned_role) new_character.mind.assigned_role = "Assistant"//If they somehow got a null assigned role.
new_character.mind.key = G_found.key//In case it's someone else playing as that character.
new_character.mind.current = new_character//So that it can properly reference later if needed.
new_character.mind.memory = ""//Memory erased so it doesn't get clunkered up with useless info. This means they may forget their previous mission--this is usually handled through objective code and recalling memory.
//Here we either load their saved appearance or randomize it.
var/datum/preferences/A = new()
if(A.savefile_load(G_found))//If they have a save file. This will automatically load their parameters.
//Note: savefile appearances are overwritten later on if the character has a data_core entry. By appearance, I mean the physical appearance.
var/name_safety = G_found.real_name//Their saved parameters may include a random name. Also a safety in case they are playing a character that got their name after round start.
A.copy_to(new_character)
new_character.real_name = name_safety
new_character.name = name_safety
else
if(record_found)//If they have a record we can determine a few things.
new_character.real_name = record_found.fields["name"]//Not necessary to reference the record but I like to keep things uniform.
new_character.name = record_found.fields["name"]
new_character.gender = record_found.fields["sex"]//Sex
new_character.age = record_found.fields["age"]//Age
new_character.b_type = record_found.fields["b_type"]//Blood type
//We will update their appearance when determining DNA.
else
new_character.gender = MALE
if(alert("Save file not detected. Record data not detected. Please specify [G_found.real_name]'s gender.",,"Male","Female")=="Female")
new_character.gender = FEMALE
var/name_safety = G_found.real_name//Default is a random name so we want to save this.
A.randomize_appearance_for(new_character)//Now we will randomize their appearance since we have no way of knowing what they look/looked like.
new_character.real_name = name_safety
new_character.name = name_safety
//After everything above, it's time to initialize their DNA.
//DNA
if(record_found)//Pull up their name from database records if they did have a mind.
new_character.dna = new()//Let's first give them a new DNA.
new_character.dna.unique_enzymes = record_found.fields["b_dna"]//Enzymes are based on real name but we'll use the record for conformity.
@@ -420,10 +380,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
else//If they have no records, we just do a random DNA for them, based on their random appearance/savefile.
new_character.dna.ready_dna(new_character)
//Here we need to find where to spawn them.
var/spawn_here = pick(latejoin)//"JoinLate" is a landmark which is deleted on round start. So, latejoin has to be used instead.
new_character.loc = spawn_here
//If they need to spawn elsewhere, they will be transferred there momentarily.
new_character.key = G_found.key
/*
The code below functions with the assumption that the mob is already a traitor if they have a special role.
@@ -435,8 +392,6 @@ Traitors and the like can also be revived with the previous role mostly intact.
var/admin = key_name_admin(src)
var/player_key = G_found.key
new_character.key = player_key//Throw them into the mob.
//Now for special roles and equipment.
switch(new_character.mind.special_role)
if("Changeling")
@@ -497,7 +452,6 @@ Traitors and the like can also be revived with the previous role mostly intact.
new_character << "You have been fully respawned. Enjoy the game."
del(G_found)//Don't want to leave ghosts around.
feedback_add_details("admin_verb","RSPCH") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
return new_character

View File

@@ -51,32 +51,28 @@ var/global/sent_strike_team = 0
break
//Generates a list of commandos from active ghosts. Then the user picks which characters to respawn as the commandos.
var/mob/dead/observer/G//Basic variable to search for later.
var/candidates_list[] = list()//candidates for being a commando out of all the active ghosts in world.
var/commandos_list[] = list()//actual commando ghosts as picked by the user.
for(G in dead_mob_list)
if(!G.client.holder && ((G.client.inactivity/10)/60) <= 5) //Whoever called/has the proc won't be added to the list.
// if(((G.client.inactivity/10)/60) <= 5) //Removing it allows even the caller to jump in. Good for testing.
candidates_list += G//Add their client to list.
for(var/i=commandos_possible,(i>0&&candidates_list.len),i--)//Decrease with every commando selected.
var/client/G_client = input("Pick characters to spawn as the commandos. This will go on until there either no more ghosts to pick from or the slots are full.", "Active Players") as null|anything in candidates_list//It will auto-pick a person when there is only one candidate.
if(G_client)//They may have logged out when the admin was choosing people. Or were not chosen. Would run time error otherwise.
candidates_list -= G_client//Subtract from candidates.
commandos_list += G_client.mob//Add their ghost to commandos.
var/list/candidates = list() //candidates for being a commando out of all the active ghosts in world.
var/list/commandos = list() //actual commando ghosts as picked by the user.
for(var/mob/dead/observer/G in player_list)
if(!G.client.holder && ((G.client.inactivity/10)/60) <= 5) //Whoever called/has the proc won't be added to the list.
if(!(G.mind && G.mind.current && G.mind.current.stat != DEAD))
candidates += G.key
for(var/i=commandos_possible,(i>0&&candidates.len),i--)//Decrease with every commando selected.
var/candidate = input("Pick characters to spawn as the commandos. This will go on until there either no more ghosts to pick from or the slots are full.", "Active Players") as null|anything in candidates //It will auto-pick a person when there is only one candidate.
candidates -= candidate //Subtract from candidates.
commandos += candidate//Add their ghost to commandos.
//Spawns commandos and equips them.
for (var/obj/effect/landmark/L in world)
for(var/obj/effect/landmark/L in world)
if(commando_number<=0) break
if (L.name == "Commando")
leader_selected = commando_number == 1?1:0
var/mob/living/carbon/human/new_commando = create_death_commando(L, leader_selected)
if(commandos_list.len)
G = pick(commandos_list)
commandos_list -= G
new_commando.mind.key = G.key//For mind stuff.
new_commando.key = G.key
if(commandos.len)
new_commando.key = pick(commandos)
commandos -= new_commando.key
new_commando.internal = new_commando.s_store
new_commando.internals.icon_state = "internal1"
@@ -123,17 +119,11 @@ var/global/sent_strike_team = 0
new_commando.dna.ready_dna(new_commando)//Creates DNA.
//Creates mind stuff.
new_commando.mind = new
new_commando.mind.current = new_commando
new_commando.mind.original = new_commando
new_commando.mind_initialize()
new_commando.mind.assigned_role = "MODE"
new_commando.mind.special_role = "Death Commando"
if(!(new_commando.mind in ticker.minds))
ticker.minds += new_commando.mind//Adds them to regular mind list.
if(!(new_commando.mind in ticker.mode.traitors))//If they weren't already an extra traitor.
ticker.mode.traitors += new_commando.mind//Adds them to current traitor list. Which is really the extra antagonist list.
ticker.mode.traitors |= new_commando.mind//Adds them to current traitor list. Which is really the extra antagonist list.
new_commando.equip_death_commando(leader_selected)
// del(spawn_location)
return new_commando
/mob/living/carbon/human/proc/equip_death_commando(leader_selected = 0)

View File

@@ -51,35 +51,30 @@ var/global/sent_syndicate_strike_team = 0
break
//Generates a list of commandos from active ghosts. Then the user picks which characters to respawn as the commandos.
var/mob/dead/observer/G//Basic variable to search for later.
var/candidates_list[] = list()//candidates for being a commando out of all the active ghosts in world.
var/syndicate_commandos_list[] = list()//actual commando ghosts as picked by the user.
for(G in dead_mob_list)
if(!G.client.holder && ((G.client.inactivity/10)/60) <= 5) //Whoever called/has the proc won't be added to the list.
// if(((G.client.inactivity/10)/60) <= 5) //Removing it allows even the caller to jump in. Good for testing.
candidates_list += G//Add their client to list.
for(var/i=syndicate_commandos_possible,(i>0&&candidates_list.len),i--)//Decrease with every commando selected.
var/client/G_client = input("Pick characters to spawn as the commandos. This will go on until there either no more ghosts to pick from or the slots are full.", "Active Players") as null|anything in candidates_list//It will auto-pick a person when there is only one candidate.
if(G_client)//They may have logged out when the admin was choosing people. Or were not chosen. Would run time error otherwise.
candidates_list -= G_client//Subtract from candidates.
syndicate_commandos_list += G_client.mob//Add their ghost to commandos.
var/list/candidates = list() //candidates for being a commando out of all the active ghosts in world.
var/list/commandos = list() //actual commando ghosts as picked by the user.
for(var/mob/dead/observer/G in player_list)
if(!G.client.holder && ((G.client.inactivity/10)/60) <= 5) //Whoever called/has the proc won't be added to the list.
if(!(G.mind && G.mind.current && G.mind.current.stat != DEAD))
candidates += G.key
for(var/i=commandos_possible,(i>0&&candidates.len),i--)//Decrease with every commando selected.
var/candidate = input("Pick characters to spawn as the commandos. This will go on until there either no more ghosts to pick from or the slots are full.", "Active Players") as null|anything in candidates //It will auto-pick a person when there is only one candidate.
candidates -= candidate //Subtract from candidates.
commandos += candidate//Add their ghost to commandos.
//Spawns commandos and equips them.
for (var/obj/effect/landmark/L in world)
for(var/obj/effect/landmark/L in world)
if(syndicate_commando_number<=0) break
if (L.name == "Syndicate-Commando")
syndicate_leader_selected = syndicate_commando_number == 1?1:0
var/mob/living/carbon/human/new_syndicate_commando = create_syndicate_death_commando(L, syndicate_leader_selected)
if(syndicate_commandos_list.len)
G = pick(syndicate_commandos_list)
new_syndicate_commando.mind.key = G.key//For mind stuff.
new_syndicate_commando.key = G.key
if(commandos.len)
new_syndicate_commando.key = pick(commandos)
commandos -= new_syndicate_commando.key
new_syndicate_commando.internal = new_syndicate_commando.s_store
new_syndicate_commando.internals.icon_state = "internal1"
syndicate_commandos_list -= G
del(G)
//So they don't forget their code or mission.
if(nuke_code)
@@ -124,15 +119,10 @@ var/global/sent_syndicate_strike_team = 0
new_syndicate_commando.dna.ready_dna(new_syndicate_commando)//Creates DNA.
//Creates mind stuff.
new_syndicate_commando.mind = new
new_syndicate_commando.mind.current = new_syndicate_commando
new_syndicate_commando.mind.original = new_syndicate_commando
new_syndicate_commando.mind_initialize()
new_syndicate_commando.mind.assigned_role = "MODE"
new_syndicate_commando.mind.special_role = "Syndicate Commando"
if(!(new_syndicate_commando.mind in ticker.minds))
ticker.minds += new_syndicate_commando.mind//Adds them to regular mind list.
if(!(new_syndicate_commando.mind in ticker.mode.traitors))//If they weren't already an extra traitor.
ticker.mode.traitors += new_syndicate_commando.mind//Adds them to current traitor list. Which is really the extra antagonist list.
ticker.mode.traitors |= new_syndicate_commando.mind //Adds them to current traitor list. Which is really the extra antagonist list.
new_syndicate_commando.equip_syndicate_commando(syndicate_leader_selected)
del(spawn_location)
return new_syndicate_commando

View File

@@ -1,4 +1,4 @@
/mob/dead/observer/New(mob/body, var/can_reenter_corpse = 1)
/mob/dead/observer/New(mob/body)
invisibility = INVISIBILITY_OBSERVER
sight |= SEE_TURFS | SEE_MOBS | SEE_OBJS | SEE_SELF
see_invisible = SEE_INVISIBLE_OBSERVER
@@ -14,26 +14,27 @@
T = get_turf(body) //Where is the body located?
attack_log = body.attack_log //preserve our attack logs by copying them to our ghost
gender = body.gender
if(body.original_name)
original_name = body.original_name
name = body.original_name
else
if(body.real_name)
original_name = body.real_name
name = body.real_name
else
original_name = capitalize(pick(first_names_male)) + " " + capitalize(pick(last_names))
if(gender == MALE)
name = capitalize(pick(first_names_male)) + " " + capitalize(pick(last_names))
else
name = capitalize(pick(first_names_female)) + " " + capitalize(pick(last_names))
name = original_name
if(can_reenter_corpse)
corpse = body
mind = body.mind //we don't transfer the mind but we keep a reference to it.
if(!T) T = pick(latejoin) //Safety in case we cannot find the body's position
loc = T
if(!name) //To prevent nameless ghosts
if(!name) //To prevent nameless ghosts
name = capitalize(pick(first_names_male)) + " " + capitalize(pick(last_names))
real_name = name
original_name = name
real_name = name
original_name = name
return
/mob/dead/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
@@ -45,9 +46,10 @@ Works together with spawning an observer, noted above.
/mob/proc/ghostize(var/can_reenter_corpse = 1)
if(key)
var/mob/dead/observer/ghost = new(src,can_reenter_corpse) //Transfer safety to observer spawning proc.
var/mob/dead/observer/ghost = new(src) //Transfer safety to observer spawning proc.
ghost.can_reenter_corpse = can_reenter_corpse
ghost.key = key
return
return ghost
/*
This is the proc mobs get to turn into a ghost. Forked from ghostize due to compatibility issues.
@@ -119,25 +121,25 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
set category = "Ghost"
set name = "Re-enter Corpse"
if(!client) return
if(!corpse)
if(!(mind && mind.current && can_reenter_corpse))
src << "<span class='warning'>You have no body.</span>"
return
if(client.holder && client.holder.state == 2)
if(mind.current.key) //makes sure we don't accidentally kick any clients
usr << "<span class='warning'>Another consciousness is in your body...It is resisting you.</span>"
return
if(mind.current.ajourn && mind.current.stat != DEAD) //check if the corpse is astral-journeying (it's client ghosted using a cultist rune).
var/obj/effect/rune/R = locate() in mind.current.loc //whilst corpse is alive, we can only reenter the body if it's on the rune
if(!(R && R.word1 == wordhell && R.word2 == wordtravel && R.word3 == wordself)) //astral journeying rune
usr << "<span class='warning'>The astral cord that ties your body and your spirit has been severed. You are likely to wander the realm beyond until your body is finally dead and thus reunited with you.</span>"
return
mind.current.ajourn=0
if(client.holder && client.holder.state == 2) //TODO: should be handled by Login/Logout ~Carn
var/rank = client.holder.rank
client.clear_admin_verbs()
client.holder.state = 1
client.update_admins(rank)
if(corpse.ajourn && corpse.stat != DEAD) //check if the corpse is astral-journeying (it's client ghosted using a cultist rune).
var/obj/effect/rune/R = locate() in corpse.loc //whilst corpse is alive, we can only reenter the body if it's on the rune
if(!(R.word1 == wordhell && R.word2 == wordtravel && R.word3 == wordself)) //astral journeying rune
usr << "<span class='warning'>The astral cord that ties your body and your spirit has been severed. You are likely to wander the realm beyond until your body is finally dead and thus reunited with you.</span>"
return
corpse.ajourn=0
if(corpse.key) //makes sure we don't accidentally kick any clients
usr << "<span class='warning'>Another consciousness is in your body...It is resisting you.</span>"
return
corpse.key = key
mind.current.key = key
/mob/dead/observer/proc/dead_tele()
set category = "Ghost"

View File

@@ -22,8 +22,7 @@
for(var/mob/O in viewers(src, null))
O.show_message(text("\green <B>[src] begins to twist and contort!</B>"), 1)
var/mob/living/carbon/alien/humanoid/queen/new_xeno = new (loc)
new_xeno.mind_initialize(src, "Queen")
new_xeno.key = key
new_xeno.UI = UI
mind.transfer_to(new_xeno)
del(src)
return

View File

@@ -8,13 +8,6 @@
real_name = name
..()
/mob/living/carbon/alien/humanoid/proc/mind_initialize(mob/G, alien_caste)
mind = new
mind.current = src
mind.assigned_role = "Alien"
mind.special_role = alien_caste
mind.key = G.key
//This is fine, works the same as a human
/mob/living/carbon/alien/humanoid/Bump(atom/movable/AM as mob|obj, yes)
spawn( 0 )

View File

@@ -36,9 +36,6 @@
//Disease Check
//handle_virus_updates() There is no disease that affects aliens
//Update mind
update_mind()
//Handle temperature/pressure differences between body and environment
handle_environment()
@@ -60,13 +57,6 @@
/mob/living/carbon/alien/humanoid
proc/update_mind()
if(!mind && client)
mind = new
mind.current = src
mind.assigned_role = "Hunter"
mind.key = key
proc/breathe()
if(reagents)
if(reagents.has_reagent("lexorin")) return

View File

@@ -4,18 +4,11 @@
reagents = R
R.my_atom = src
if(name == "alien larva")
name = text("alien larva ([rand(1, 1000)])")
name = "alien larva ([rand(1, 1000)])"
real_name = name
regenerate_icons()
..()
/mob/living/carbon/alien/larva/proc/mind_initialize(mob/G, alien_caste)
mind = new
mind.current = src
mind.assigned_role = "Alien"
mind.special_role = alien_caste
mind.key = G.key
//This is fine, works the same as a human
/mob/living/carbon/alien/larva/Bump(atom/movable/AM as mob|obj, yes)

View File

@@ -39,9 +39,6 @@
//to find it.
blinded = null
//Mind update
update_mind()
//Disease Check
//handle_virus_updates() There is no disease that affects larva
@@ -66,7 +63,7 @@
/mob/living/carbon/alien/larva
proc/handle_mutations_and_radiation()
if(amount_grown == 200)
if(amount_grown == 200) //TODO ~Carn
src << "\green You are growing into a beautiful alien! It is time to choose a caste."
src << "\green There are three to choose from:"
src << "\green <B>Hunters</B> are strong and agile, able to hunt away from the hive and rapidly move through ventilation shafts. Hunters generate plasma slowly and have low reserves."
@@ -77,20 +74,19 @@
var/mob/living/carbon/alien/humanoid/new_xeno
switch(alien_caste)
if("Hunter")
new_xeno = new /mob/living/carbon/alien/humanoid/hunter (loc)
new_xeno = new /mob/living/carbon/alien/humanoid/hunter(loc)
if("Sentinel")
new_xeno = new /mob/living/carbon/alien/humanoid/sentinel (loc)
new_xeno = new /mob/living/carbon/alien/humanoid/sentinel(loc)
if("Drone")
new_xeno = new /mob/living/carbon/alien/humanoid/drone (loc)
new_xeno.mind_initialize(src, alien_caste)
new_xeno.key = key
new_xeno = new /mob/living/carbon/alien/humanoid/drone(loc)
new_xeno.UI = UI
if(mind) mind.transfer_to(new_xeno)
del(src)
return
//grow!! but not if metroid or dead
if(health>-100)
amount_grown++
else
//grow!! but not if metroid or dead
if(health>-100)
amount_grown++
if (radiation)
if (radiation > 100)
@@ -124,13 +120,6 @@
adjustToxLoss(3)
updatehealth()
proc/update_mind()
if(!mind && client)
mind = new
mind.current = src
mind.assigned_role = "Larva"
mind.key = key
proc/breathe()
if(reagents.has_reagent("lexorin")) return

View File

@@ -189,12 +189,13 @@
if(stat == DEAD || (changeling && (changeling.changeling_fakedeath == 1)))
msg += "<span class='deadsay'>[t_He] [t_is] limp and unresponsive; there are no signs of life"
if(!client)
if(!key)
var/foundghost = 0
for(var/mob/dead/observer/G in player_list)
if(G.corpse == src)
foundghost++
break
if(mind)
for(var/mob/dead/observer/G in player_list)
if(G.mind == mind)
foundghost = 1
break
if(!foundghost)
msg += " and [t_his] soul has departed"
msg += "...</span>\n"

View File

@@ -58,9 +58,6 @@
//Random events (vomiting etc)
handle_random_events()
//Update Mind
update_mind()
//Handle temperature/pressure differences between body and environment
handle_environment(environment)
@@ -101,15 +98,6 @@
return ONE_ATMOSPHERE - pressure_difference
/mob/living/carbon/human
proc/update_mind()
if(!mind && client)
mind = new
mind.current = src
mind.assigned_role = job
if(!mind.assigned_role)
mind.assigned_role = "Assistant"
mind.key = key
proc/handle_disabilities()
if (disabilities & EPILEPSY)

View File

@@ -143,14 +143,6 @@
AIproc = 0
update_mind()
if(!mind && client)
mind = new
mind.current = src
mind.assigned_role = "Metroid"
mind.key = key
handle_environment(datum/gas_mixture/environment)
if(!environment)
adjustFireLoss(rand(10,20))

View File

@@ -16,13 +16,6 @@
verbs.Remove(/mob/living/carbon/metroid/verb/ventcrawl)
..()
/mob/living/carbon/metroid/proc/mind_initialize(mob/G)
mind = new
mind.current = src
mind.assigned_role = "Metroid"
//mind.special_role = alien_caste
mind.key = G.key
/mob/living/carbon/metroid/movement_delay()
var/tally = 0

View File

@@ -172,13 +172,12 @@
return
if(!istype(src, /mob/living/carbon/metroid/adult))
if(amount_grown >= 10)
var/mob/living/carbon/metroid/adult/new_metroid = new /mob/living/carbon/metroid/adult (loc)
new_metroid.mind_initialize(src)
new_metroid.key = key
var/mob/living/carbon/metroid/adult/new_metroid = new /mob/living/carbon/metroid/adult(loc)
new_metroid.nutrition = nutrition
new_metroid.powerlevel = max(0, powerlevel-1)
new_metroid.a_intent = "hurt"
new_metroid.key = key
new_metroid << "<B>You are now an adult Metroid.</B>"
del(src)
else
@@ -196,31 +195,28 @@
if(istype(src, /mob/living/carbon/metroid/adult))
if(amount_grown >= 10)
switch(input("Are you absolutely sure you want to reproduce? Your current body will cease to be, but your consciousness will be transferred into a produced metroid.") in list("Yes","No"))
if("Yes")
if(input("Are you absolutely sure you want to reproduce? Your current body will cease to be, but your consciousness will be transferred into a produced metroid.") in list("Yes","No")=="Yes")
if(stat)
src << "<i>I must be conscious to do this...</i>"
return
if(stat)
src << "<i>I must be conscious to do this...</i>"
return
var/list/babies = list()
var/number = pick(14;2,3,4)
var/new_nutrition = round(nutrition * 0.9)
var/new_powerlevel = round(powerlevel / number)
for(var/i=1,i<=number,i++) // reproduce (has a small chance of producing 3 or 4 offspring)
var/mob/living/carbon/metroid/M = new/mob/living/carbon/metroid(loc)
M.nutrition = new_nutrition
M.powerlevel = new_powerlevel
if(i != 1) step_away(M,src)
babies += M
var/number = pick(2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,4)
var/list/babies = list()
for(var/i=1,i<=number,i++) // reproduce (has a small chance of producing 3 or 4 offspring)
var/mob/living/carbon/metroid/M = new/mob/living/carbon/metroid(loc)
M.nutrition = round(nutrition * 0.9)
M.powerlevel = round(powerlevel / number)
if(i != 1) step_away(M,src)
babies += M
var/mob/living/carbon/metroid/new_metroid = pick(babies)
new_metroid.a_intent = "hurt"
new_metroid.key = key
var/mob/living/carbon/metroid/new_metroid = pick(babies)
new_metroid.mind_initialize(src)
new_metroid.key = key
new_metroid.a_intent = "hurt"
new_metroid << "<B>You are now a baby Metroid.</B>"
del(src)
new_metroid << "<B>You are now a Metroid. Skree!</B>"
del(src)
else
src << "<i>I am not ready to reproduce yet...</i>"
else

View File

@@ -101,12 +101,6 @@
if (prob(10))
stuttering = max(10, stuttering)
proc/update_mind()
if(!mind && client)
mind = new
mind.current = src
mind.key = key
proc/handle_mutations_and_radiation()
if(getFireLoss())

View File

@@ -1,6 +1,10 @@
/mob/living/Login()
ticker.minds |= mind //failsafe whilst I track down all the inconsistencies ~Carn.
..()
//Mind updates
mind_initialize() //updates the mind (or creates and initializes one if one doesn't exist)
mind.active = 1 //indicates that the mind is currently synced with a client
//Round specific stuff like hud updates
if(ticker && ticker.mode)
switch(ticker.mode.name)
if("sandbox")
@@ -11,6 +15,9 @@
if("cult")
if(mind in ticker.mode:cult)
ticker.mode.update_cult_icons_added(src.mind)
if("nuclear emergency")
if(mind in ticker.mode:syndicates)
ticker.mode.update_all_synd_icons()
//This stuff needs to be merged from cloning.dm but I'm not in the mood to be shouted at for breaking all the things :< ~Carn
/* clones
@@ -31,16 +38,20 @@
/* Plantpeople
switch(ticker.mode.name)
if("revolution")
if(src.occupant.mind in ticker.mode:revolutionaries)
if ("revolution")
if (podman.mind in ticker.mode:revolutionaries)
ticker.mode:add_revolutionary(podman.mind)
ticker.mode:update_all_rev_icons() //So the icon actually appears
if(src.occupant.mind in ticker.mode:head_revolutionaries)
if (podman.mind in ticker.mode:head_revolutionaries)
ticker.mode:update_all_rev_icons()
if("nuclear emergency")
if (src.occupant.mind in ticker.mode:syndicates)
if ("nuclear emergency")
if (podman.mind in ticker.mode:syndicates)
ticker.mode:update_all_synd_icons()
if("cult")
if (src.occupant.mind in ticker.mode:cult)
ticker.mode:add_cultist(src.occupant.mind)
if ("cult")
if (podman.mind in ticker.mode:cult)
ticker.mode:add_cultist(podman.mind)
ticker.mode:update_all_cult_icons() //So the icon actually appears
if ("changeling")
if (podman.mind in ticker.mode:changelings)
podman.make_changeling()
*/

View File

@@ -0,0 +1,4 @@
/mob/living/Logout()
..()
if(!key && mind) //key and mind have become seperated.
mind.active = 0 //This is to stop say, a mind.transfer_to call on a corpse causing a ghost to re-enter its body.

View File

@@ -12,8 +12,6 @@
src.updatehealth()
src.update_mind()
if(aiPDA && aiPDA.name != name)
aiPDA.owner = name
aiPDA.name = name + " (" + aiPDA.ownjob + ")"
@@ -185,10 +183,3 @@
else
src.health = 100
src.stat = 0
/mob/living/silicon/ai/proc/update_mind()
if(!mind && client)
mind = new
mind.current = src
mind.assigned_role = "AI"
mind.key = key

View File

@@ -35,17 +35,13 @@ var/datum/paiController/paiController // Global handler for pAI candidates
pai.real_name = pai.name
pai.key = candidate.key
pai.mind = new()//Make a new mind for the pai
pai.mind.current = pai
pai.mind.assigned_role = "Assistant"//Default to an assistant.
card.setPersonality(pai)
card.looking_for_personality = 0
ticker.mode.update_cult_icons_removed(card.pai.mind)
ticker.mode.update_rev_icons_removed(card.pai.mind)
pai_candidates.Remove(candidate)
pai_candidates -= candidate
usr << browse(null, "window=findPai")
if(href_list["new"])

View File

@@ -22,7 +22,6 @@
process_locks()
update_canmove()
update_mind()
@@ -66,13 +65,6 @@
uneq_all()
src.stat = 1
update_mind()
if(!mind && client)
mind = new
mind.current = src
mind.assigned_role = "Hunter"
mind.key = key
handle_regular_status_updates()

View File

@@ -21,18 +21,7 @@
add_to_mob_list(mmi.brainmob)
var/turf/T = get_turf(loc)//To hopefully prevent run time errors.
if(T) mmi.loc = T
if(key && !mind) //failsafe in case we've somehow lost our mind! (code will do that to you!)
if(mmi.brainmob.mind)
mind = mmi.brainmob.mind
else
mind = new /datum/mind()
mind.assigned_role = "Cyborg"
mind.key = key
if(mind)
mind.transfer_to(mmi.brainmob)
if(mind) mind.transfer_to(mmi.brainmob)
mmi = null
..()

View File

@@ -133,11 +133,7 @@
usr << msg
return
/mob/living/simple_animal/constructarmoured/proc/mind_initialize(mob/G)
mind = new
mind.current = src
mind.assigned_role = "Juggernaut"
mind.key = G.key
////////////////////////Wraith/////////////////////////////////////////////
@@ -267,12 +263,6 @@
usr << msg
return
/mob/living/simple_animal/constructwraith/proc/mind_initialize(mob/G)
mind = new
mind.current = src
mind.assigned_role = "Wraith"
mind.key = G.key
/////////////////////////////Artificer/////////////////////////
/mob/living/simple_animal/constructbuilder
@@ -348,10 +338,4 @@
msg += "*---------*</span>"
usr << msg
return
/mob/living/simple_animal/constructbuilder/proc/mind_initialize(mob/G)
mind = new
mind.current = src
mind.assigned_role = "Artificer"
mind.key = G.key
return

View File

@@ -354,13 +354,6 @@
return
//PC stuff-Sieve
/mob/living/simple_animal/corgi/proc/mind_initialize(mob/G)
mind = new
mind.current = src
mind.assigned_role = "Corgi"
mind.key = G.key
/mob/living/simple_animal/corgi/attackby(var/obj/item/O as obj, var/mob/user as mob) //Marker -Agouri
if(istype(O, /obj/item/weapon/newspaper))
if(!stat)

View File

@@ -54,9 +54,3 @@
if ((M.client && !( M.blinded )))
M.show_message("\red [user] gently taps [src] with the [O]. ")
return
/mob/living/simple_animal/shade/proc/mind_initialize(mob/G)
mind = new
mind.current = src
mind.assigned_role = "Shade"
mind.key = G.key

View File

@@ -1,12 +1,9 @@
/mob/Logout()
player_list -= src
log_access("Logout: [key_name(src)]")
if (admins[src.ckey])
if(admins[src.ckey])
if (ticker && ticker.current_state == GAME_STATE_PLAYING) //Only report this stuff if we are currently playing.
var/admins_number = 0
for(var/client/C)
if(C.holder)
admins_number++
var/admins_number = admin_list.len
message_admins("Admin logout: [key_name(src)]")
if(admins_number == 0) //Apparently the admin logging out is no longer an admin at this point, so we have to check this towards 0 and not towards 1. Awell.

View File

@@ -7,8 +7,8 @@
preferences = new
if(!mind)
mind = new
mind.key = key
mind = new /datum/mind(key)
mind.active = 1
mind.current = src
spawn() Playmusic() // git some tunes up in heeyaa~

View File

@@ -254,7 +254,7 @@
if(character.mind.assigned_role != "Cyborg")
ManifestLateSpawn(character,char_icon)
ticker.minds += character.mind//Cyborgs and AIs handle this in the transform proc.
ticker.minds += character.mind//Cyborgs and AIs handle this in the transform proc. //TODO!!!!! ~Carn
else
character.Robotize()
del(src)
@@ -274,7 +274,7 @@
proc/ManifestLateSpawn(var/mob/living/carbon/human/H, icon/H_icon) // Attempted fix to add late joiners to various databases -- TLE
// This is basically ripped wholesale from the normal code for adding people to the databases during a fresh round
if (!isnull(H.mind) && (H.mind.assigned_role != "MODE"))
if (H.mind && (H.mind.assigned_role != "MODE"))
var/datum/data/record/G = new()
var/datum/data/record/M = new()
var/datum/data/record/S = new()
@@ -379,8 +379,8 @@
new_character.dna.ready_dna(new_character)
new_character.dna.b_type = preferences.b_type
if(mind)
mind.original = new_character
mind.transfer_to(new_character)
mind.original = new_character
return new_character

View File

@@ -76,20 +76,13 @@
var/mob/living/silicon/ai/O = new (loc, /datum/ai_laws/asimov,,1)//No MMI but safety is in effect.
O.invisibility = 0
O.aiRestorePowerRoutine = 0
O.lastKnownIP = client.address
if(mind)
mind.transfer_to(O)
O.mind.original = O
else
O.mind = new
O.mind.current = O
O.mind.original = O
O.mind.assigned_role = "AI"
O.key = key
var/obj/loc_landmark
for(var/obj/effect/landmark/start/sloc in world)
if (sloc.name != "AI")
@@ -176,19 +169,14 @@
O.UI = UI
if (mind)
if(mind) //TODO
mind.transfer_to(O)
if (mind.assigned_role == "Cyborg")
mind.original = O
else if (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")
if(O.mind.assigned_role == "Cyborg")
O.mind.original = O
else if(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
mind = new /datum/mind( )
mind.key = key
mind.current = O
mind.original = O
mind.transfer_to(O)
O.key = key
O.loc = loc
O.job = "Cyborg"
@@ -219,25 +207,16 @@
var/mob/living/carbon/alien/humanoid/new_xeno
switch(alien_caste)
if("Hunter")
new_xeno = new /mob/living/carbon/alien/humanoid/hunter (loc)
new_xeno = new /mob/living/carbon/alien/humanoid/hunter(loc)
if("Sentinel")
new_xeno = new /mob/living/carbon/alien/humanoid/sentinel (loc)
new_xeno = new /mob/living/carbon/alien/humanoid/sentinel(loc)
if("Drone")
new_xeno = new /mob/living/carbon/alien/humanoid/drone (loc)
//Honestly not sure why it's giving them DNA.
/*
new_xeno.dna = dna
dna = null
new_xeno.dna.uni_identity = "00600200A00E0110148FC01300B009"
new_xeno.dna.struc_enzymes = "0983E840344C39F4B059D5145FC5785DC6406A4BB8"
*/
new_xeno.mind_initialize(src, alien_caste)
new_xeno.key = key
new_xeno.UI = UI
new_xeno = new /mob/living/carbon/alien/humanoid/drone(loc)
new_xeno.a_intent = "hurt"
new_xeno.UI = UI
new_xeno.key = key
new_xeno << "<B>You are now an alien.</B>"
spawn(0)//To prevent the proc from returning null.
del(src)
@@ -256,43 +235,26 @@
for(var/t in organs)
del(t)
var/mob/living/carbon/metroid/new_metroid
if(reproduce)
var/number = pick(2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,4)
var/number = pick(14;2,3,4) //reproduce (has a small chance of producing 3 or 4 offspring)
var/list/babies = list()
for(var/i=1,i<=number,i++) // reproduce (has a small chance of producing 3 or 4 offspring)
for(var/i=1,i<=number,i++)
var/mob/living/carbon/metroid/M = new/mob/living/carbon/metroid(loc)
M.nutrition = round(nutrition/number)
step_away(M,src)
babies += M
var/mob/living/carbon/metroid/new_metroid = pick(babies)
new_metroid.mind_initialize(src)
new_metroid.key = key
new_metroid.UI = UI
new_metroid.a_intent = "hurt"
new_metroid << "<B>You are now a baby Metroid.</B>"
if(adult)
var/mob/living/carbon/metroid/adult/new_metroid = new /mob/living/carbon/metroid/adult (loc)
new_metroid.mind_initialize(src)
new_metroid.key = key
new_metroid.UI = UI
new_metroid.a_intent = "hurt"
new_metroid << "<B>You are now an adult Metroid.</B>"
new_metroid = pick(babies)
else
var/mob/living/carbon/metroid/new_metroid = new /mob/living/carbon/metroid (loc)
if(adult)
new_metroid = new /mob/living/carbon/metroid/adult(loc)
else
new_metroid = new /mob/living/carbon/metroid(loc)
new_metroid.a_intent = "hurt"
new_metroid.UI = UI
new_metroid.key = key
new_metroid.mind_initialize(src)
new_metroid.key = key
new_metroid.UI = UI
new_metroid.a_intent = "hurt"
new_metroid << "<B>You are now a baby Metroid.</B>"
new_metroid << "<B>You are now a Metroid. Skreee!</B>"
spawn(0)//To prevent the proc from returning null.
del(src)
return
@@ -307,17 +269,15 @@
canmove = 0
icon = null
invisibility = 101
for(var/t in organs)
for(var/t in organs) //this really should not be necessary
del(t)
var/mob/living/simple_animal/corgi/new_corgi = new /mob/living/simple_animal/corgi (loc)
new_corgi.mind_initialize(src)
new_corgi.key = key
new_corgi.UI = UI
new_corgi.a_intent = "hurt"
new_corgi << "<B>You are now a Corgi!.</B>"
new_corgi.UI = UI
new_corgi.key = key
new_corgi << "<B>You are now a Corgi. Yap Yap!</B>"
spawn(0)//To prevent the proc from returning null.
del(src)
return

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

View File

@@ -940,6 +940,7 @@
#include "code\modules\mob\living\living_defense.dm"
#include "code\modules\mob\living\living_defines.dm"
#include "code\modules\mob\living\login.dm"
#include "code\modules\mob\living\logout.dm"
#include "code\modules\mob\living\say.dm"
#include "code\modules\mob\living\blob\blob.dm"
#include "code\modules\mob\living\carbon\carbon.dm"