mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
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
283 lines
7.5 KiB
Plaintext
283 lines
7.5 KiB
Plaintext
/mob/living/carbon/human/proc/monkeyize()
|
|
if (monkeyizing)
|
|
return
|
|
for(var/obj/item/W in src)
|
|
if (W==w_uniform) // will be torn
|
|
continue
|
|
drop_from_inventory(W)
|
|
regenerate_icons()
|
|
monkeyizing = 1
|
|
canmove = 0
|
|
stunned = 1
|
|
icon = null
|
|
invisibility = 101
|
|
for(var/t in organs)
|
|
del(t)
|
|
var/atom/movable/overlay/animation = new /atom/movable/overlay( loc )
|
|
animation.icon_state = "blank"
|
|
animation.icon = 'icons/mob/mob.dmi'
|
|
animation.master = src
|
|
flick("h2monkey", animation)
|
|
sleep(48)
|
|
//animation = null
|
|
var/mob/living/carbon/monkey/O = new /mob/living/carbon/monkey( loc )
|
|
del(animation)
|
|
|
|
O.name = "monkey"
|
|
O.UI = UI
|
|
O.dna = dna
|
|
dna = null
|
|
O.dna.uni_identity = "00600200A00E0110148FC01300B009"
|
|
//O.dna.struc_enzymes = "0983E840344C39F4B059D5145FC5785DC6406A4BB8"
|
|
O.dna.struc_enzymes = "[copytext(O.dna.struc_enzymes,1,1+3*13)]BB8"
|
|
O.loc = loc
|
|
O.viruses = viruses
|
|
viruses = list()
|
|
for(var/datum/disease/D in O.viruses)
|
|
D.affected_mob = O
|
|
|
|
if (client)
|
|
client.mob = O
|
|
if(mind)
|
|
mind.transfer_to(O)
|
|
O.a_intent = "hurt"
|
|
O << "<B>You are now a monkey.</B>"
|
|
spawn(0)//To prevent the proc from returning null.
|
|
del(src)
|
|
return O
|
|
|
|
/mob/new_player/AIize()
|
|
spawning = 1
|
|
return ..()
|
|
|
|
/mob/living/carbon/human/AIize()
|
|
if (monkeyizing)
|
|
return
|
|
for(var/t in organs)
|
|
del(t)
|
|
|
|
return ..()
|
|
|
|
/mob/living/carbon/AIize()
|
|
if (monkeyizing)
|
|
return
|
|
for(var/obj/item/W in src)
|
|
drop_from_inventory(W)
|
|
regenerate_icons()
|
|
monkeyizing = 1
|
|
canmove = 0
|
|
icon = null
|
|
invisibility = 101
|
|
return ..()
|
|
|
|
/mob/proc/AIize()
|
|
if(client)
|
|
src << sound(null, repeat = 0, wait = 0, volume = 85, channel = 1) // stop the jams for AIs
|
|
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
|
|
|
|
if(mind)
|
|
mind.transfer_to(O)
|
|
O.mind.original = O
|
|
else
|
|
O.key = key
|
|
|
|
var/obj/loc_landmark
|
|
for(var/obj/effect/landmark/start/sloc in world)
|
|
if (sloc.name != "AI")
|
|
continue
|
|
if (locate(/mob/living) in sloc.loc)
|
|
continue
|
|
loc_landmark = sloc
|
|
if (!loc_landmark)
|
|
for(var/obj/effect/landmark/tripai in world)
|
|
if (tripai.name == "tripai")
|
|
if(locate(/mob/living) in tripai.loc)
|
|
continue
|
|
loc_landmark = tripai
|
|
if (!loc_landmark)
|
|
O << "Oh god sorry we can't find an unoccupied AI spawn location, so we're spawning you on top of someone."
|
|
for(var/obj/effect/landmark/start/sloc in world)
|
|
if (sloc.name == "AI")
|
|
loc_landmark = sloc
|
|
|
|
O.loc = loc_landmark.loc
|
|
for (var/obj/item/device/radio/intercom/comm in O.loc)
|
|
comm.ai += O
|
|
|
|
O << "<B>You are playing the station's AI. The AI cannot move, but can interact with many objects while viewing them (through cameras).</B>"
|
|
O << "<B>To look at other parts of the station, click on yourself to get a camera menu.</B>"
|
|
O << "<B>While observing through a camera, you can use most (networked) devices which you can see, such as computers, APCs, intercoms, doors, etc.</B>"
|
|
O << "To use something, simply click on it."
|
|
O << {"Use say ":b to speak to your cyborgs through binary."}
|
|
if (!(ticker && ticker.mode && (O.mind in ticker.mode.malf_ai)))
|
|
O.show_laws()
|
|
O << "<b>These laws may be changed by other players, or by you being the traitor.</b>"
|
|
|
|
O.verbs += /mob/living/silicon/ai/proc/ai_call_shuttle
|
|
O.verbs += /mob/living/silicon/ai/proc/show_laws_verb
|
|
O.verbs += /mob/living/silicon/ai/proc/ai_camera_track
|
|
O.verbs += /mob/living/silicon/ai/proc/ai_alerts
|
|
O.verbs += /mob/living/silicon/ai/proc/ai_camera_list
|
|
O.verbs += /mob/living/silicon/ai/proc/ai_statuschange
|
|
O.verbs += /mob/living/silicon/ai/proc/ai_roster
|
|
|
|
// O.verbs += /mob/living/silicon/ai/proc/ai_cancel_call
|
|
O.job = "AI"
|
|
O.UI = UI
|
|
|
|
if(O.mind)
|
|
ticker.mode.remove_cultist(O.mind, 1)
|
|
ticker.mode.remove_revolutionary(O.mind, 1)
|
|
|
|
spawn(0)
|
|
ainame(O)
|
|
world << text("<b>[O.real_name] is the AI!</b>")
|
|
|
|
spawn(50)
|
|
world << sound('newAI.ogg')
|
|
|
|
del(src)
|
|
|
|
return O
|
|
|
|
//human -> robot
|
|
/mob/living/carbon/human/proc/Robotize()
|
|
if (monkeyizing)
|
|
return
|
|
for(var/obj/item/W in src)
|
|
drop_from_inventory(W)
|
|
regenerate_icons()
|
|
monkeyizing = 1
|
|
canmove = 0
|
|
icon = null
|
|
invisibility = 101
|
|
for(var/t in organs)
|
|
del(t)
|
|
|
|
var/mob/living/silicon/robot/O = new /mob/living/silicon/robot( loc )
|
|
|
|
// cyborgs produced by Robotize get an automatic power cell
|
|
O.cell = new(O)
|
|
O.cell.maxcharge = 7500
|
|
O.cell.charge = 7500
|
|
|
|
|
|
O.gender = gender
|
|
O.invisibility = 0
|
|
|
|
O.UI = UI
|
|
|
|
if(mind) //TODO
|
|
mind.transfer_to(O)
|
|
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
|
|
O.key = key
|
|
|
|
O.loc = loc
|
|
O.job = "Cyborg"
|
|
|
|
O.mmi = new /obj/item/device/mmi(O)
|
|
O.mmi.transfer_identity(src)//Does not transfer key/client.
|
|
|
|
|
|
spawn(0)//To prevent the proc from returning null.
|
|
del(src)
|
|
return O
|
|
|
|
//human -> alien
|
|
/mob/living/carbon/human/proc/Alienize()
|
|
if (monkeyizing)
|
|
return
|
|
for(var/obj/item/W in src)
|
|
drop_from_inventory(W)
|
|
regenerate_icons()
|
|
monkeyizing = 1
|
|
canmove = 0
|
|
icon = null
|
|
invisibility = 101
|
|
for(var/t in organs)
|
|
del(t)
|
|
|
|
var/alien_caste = pick("Hunter","Sentinel","Drone")
|
|
var/mob/living/carbon/alien/humanoid/new_xeno
|
|
switch(alien_caste)
|
|
if("Hunter")
|
|
new_xeno = new /mob/living/carbon/alien/humanoid/hunter(loc)
|
|
if("Sentinel")
|
|
new_xeno = new /mob/living/carbon/alien/humanoid/sentinel(loc)
|
|
if("Drone")
|
|
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)
|
|
return
|
|
|
|
/mob/living/carbon/human/proc/Metroidize(adult as num, reproduce as num)
|
|
if (monkeyizing)
|
|
return
|
|
for(var/obj/item/W in src)
|
|
drop_from_inventory(W)
|
|
regenerate_icons()
|
|
monkeyizing = 1
|
|
canmove = 0
|
|
icon = null
|
|
invisibility = 101
|
|
for(var/t in organs)
|
|
del(t)
|
|
|
|
var/mob/living/carbon/metroid/new_metroid
|
|
if(reproduce)
|
|
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++)
|
|
var/mob/living/carbon/metroid/M = new/mob/living/carbon/metroid(loc)
|
|
M.nutrition = round(nutrition/number)
|
|
step_away(M,src)
|
|
babies += M
|
|
new_metroid = pick(babies)
|
|
else
|
|
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 << "<B>You are now a Metroid. Skreee!</B>"
|
|
spawn(0)//To prevent the proc from returning null.
|
|
del(src)
|
|
return
|
|
|
|
/mob/living/carbon/human/proc/corgize()
|
|
if (monkeyizing)
|
|
return
|
|
for(var/obj/item/W in src)
|
|
drop_from_inventory(W)
|
|
regenerate_icons()
|
|
monkeyizing = 1
|
|
canmove = 0
|
|
icon = null
|
|
invisibility = 101
|
|
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.a_intent = "hurt"
|
|
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 |