mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-01-09 09:01:44 +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
270 lines
7.8 KiB
Plaintext
270 lines
7.8 KiB
Plaintext
/obj/item/robot_parts
|
|
name = "robot parts"
|
|
icon = 'icons/obj/robot_parts.dmi'
|
|
item_state = "buildpipe"
|
|
icon_state = "blank"
|
|
flags = FPRINT | TABLEPASS | CONDUCT
|
|
slot_flags = SLOT_BELT
|
|
var/construction_time = 100
|
|
var/list/construction_cost = list("metal"=20000,"glass"=5000)
|
|
|
|
/obj/item/robot_parts/l_arm
|
|
name = "Cyborg Left Arm"
|
|
desc = "A skeletal limb wrapped in pseudomuscles, with a low-conductivity case."
|
|
icon_state = "l_arm"
|
|
construction_time = 200
|
|
construction_cost = list("metal"=18000)
|
|
|
|
/obj/item/robot_parts/r_arm
|
|
name = "Cyborg Right Arm"
|
|
desc = "A skeletal limb wrapped in pseudomuscles, with a low-conductivity case."
|
|
icon_state = "r_arm"
|
|
construction_time = 200
|
|
construction_cost = list("metal"=18000)
|
|
|
|
/obj/item/robot_parts/l_leg
|
|
name = "Cyborg Left Leg"
|
|
desc = "A skeletal limb wrapped in pseudomuscles, with a low-conductivity case."
|
|
icon_state = "l_leg"
|
|
construction_time = 200
|
|
construction_cost = list("metal"=15000)
|
|
|
|
/obj/item/robot_parts/r_leg
|
|
name = "Cyborg Right Leg"
|
|
desc = "A skeletal limb wrapped in pseudomuscles, with a low-conductivity case."
|
|
icon_state = "r_leg"
|
|
construction_time = 200
|
|
construction_cost = list("metal"=15000)
|
|
|
|
/obj/item/robot_parts/chest
|
|
name = "Cyborg Torso"
|
|
desc = "A heavily reinforced case containing cyborg logic boards, with space for a standard power cell."
|
|
icon_state = "chest"
|
|
construction_time = 350
|
|
construction_cost = list("metal"=40000)
|
|
var/wires = 0.0
|
|
var/obj/item/weapon/cell/cell = null
|
|
|
|
/obj/item/robot_parts/head
|
|
name = "Cyborg Head"
|
|
desc = "A standard reinforced braincase, with spine-plugged neural socket and sensor gimbals."
|
|
icon_state = "head"
|
|
construction_time = 350
|
|
construction_cost = list("metal"=25000)
|
|
var/obj/item/device/flash/flash1 = null
|
|
var/obj/item/device/flash/flash2 = null
|
|
|
|
/obj/item/robot_parts/robot_suit
|
|
name = "Cyborg Endoskeleton"
|
|
desc = "A complex metal backbone with standard limb sockets and pseudomuscle anchors."
|
|
icon_state = "robo_suit"
|
|
construction_time = 500
|
|
construction_cost = list("metal"=50000)
|
|
var/obj/item/robot_parts/l_arm/l_arm = null
|
|
var/obj/item/robot_parts/r_arm/r_arm = null
|
|
var/obj/item/robot_parts/l_leg/l_leg = null
|
|
var/obj/item/robot_parts/r_leg/r_leg = null
|
|
var/obj/item/robot_parts/chest/chest = null
|
|
var/obj/item/robot_parts/head/head = null
|
|
var/created_name = "Cyborg"
|
|
|
|
/obj/item/robot_parts/robot_suit/New()
|
|
..()
|
|
src.updateicon()
|
|
|
|
/obj/item/robot_parts/robot_suit/proc/updateicon()
|
|
src.overlays = null
|
|
if(src.l_arm)
|
|
src.overlays += "l_arm+o"
|
|
if(src.r_arm)
|
|
src.overlays += "r_arm+o"
|
|
if(src.chest)
|
|
src.overlays += "chest+o"
|
|
if(src.l_leg)
|
|
src.overlays += "l_leg+o"
|
|
if(src.r_leg)
|
|
src.overlays += "r_leg+o"
|
|
if(src.head)
|
|
src.overlays += "head+o"
|
|
|
|
/obj/item/robot_parts/robot_suit/proc/check_completion()
|
|
if(src.l_arm && src.r_arm)
|
|
if(src.l_leg && src.r_leg)
|
|
if(src.chest && src.head)
|
|
feedback_inc("cyborg_frames_built",1)
|
|
return 1
|
|
return 0
|
|
|
|
/obj/item/robot_parts/robot_suit/attackby(obj/item/W as obj, mob/user as mob)
|
|
..()
|
|
if(istype(W, /obj/item/stack/sheet/metal))
|
|
var/obj/item/weapon/ed209_assembly/B = new /obj/item/weapon/ed209_assembly
|
|
B.loc = get_turf(src)
|
|
user << "You armed the robot frame"
|
|
W:use(1)
|
|
if (user.get_inactive_hand()==src)
|
|
user.before_take_item(src)
|
|
user.put_in_inactive_hand(B)
|
|
del(src)
|
|
if(istype(W, /obj/item/robot_parts/l_leg))
|
|
if(src.l_leg) return
|
|
user.drop_item()
|
|
W.loc = src
|
|
src.l_leg = W
|
|
src.updateicon()
|
|
|
|
if(istype(W, /obj/item/robot_parts/r_leg))
|
|
if(src.r_leg) return
|
|
user.drop_item()
|
|
W.loc = src
|
|
src.r_leg = W
|
|
src.updateicon()
|
|
|
|
if(istype(W, /obj/item/robot_parts/l_arm))
|
|
if(src.l_arm) return
|
|
user.drop_item()
|
|
W.loc = src
|
|
src.l_arm = W
|
|
src.updateicon()
|
|
|
|
if(istype(W, /obj/item/robot_parts/r_arm))
|
|
if(src.r_arm) return
|
|
user.drop_item()
|
|
W.loc = src
|
|
src.r_arm = W
|
|
src.updateicon()
|
|
|
|
if(istype(W, /obj/item/robot_parts/chest))
|
|
if(src.chest) return
|
|
if(W:wires && W:cell)
|
|
user.drop_item()
|
|
W.loc = src
|
|
src.chest = W
|
|
src.updateicon()
|
|
else if(!W:wires)
|
|
user << "\blue You need to attach wires to it first!"
|
|
else
|
|
user << "\blue You need to attach a cell to it first!"
|
|
|
|
if(istype(W, /obj/item/robot_parts/head))
|
|
if(src.head) return
|
|
if(W:flash2 && W:flash1)
|
|
user.drop_item()
|
|
W.loc = src
|
|
src.head = W
|
|
src.updateicon()
|
|
else
|
|
user << "\blue You need to attach a flash to it first!"
|
|
|
|
if(istype(W, /obj/item/device/mmi))
|
|
var/obj/item/device/mmi/M = W
|
|
if(check_completion())
|
|
if(!istype(loc,/turf))
|
|
user << "\red You can't put the MMI in, the frame has to be standing on the ground to be perfectly precise."
|
|
return
|
|
if(!M.brainmob)
|
|
user << "\red Sticking an empty MMI into the frame would sort of defeat the purpose."
|
|
return
|
|
if(!M.brainmob.key)
|
|
var/ghost_can_reenter = 0
|
|
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
|
|
|
|
if(M.brainmob.stat == DEAD)
|
|
user << "\red Sticking a dead brain into the frame would sort of defeat the purpose."
|
|
return
|
|
|
|
if(M.brainmob.mind in ticker.mode.head_revolutionaries)
|
|
user << "\red The frame's firmware lets out a shrill sound, and flashes 'Abnormal Memory Engram'. It refuses to accept the MMI."
|
|
return
|
|
|
|
if(jobban_isbanned(M.brainmob, "Cyborg"))
|
|
user << "\red This MMI does not seem to fit."
|
|
return
|
|
|
|
var/mob/living/silicon/robot/O = new /mob/living/silicon/robot(get_turf(loc))
|
|
if(!O) return
|
|
|
|
user.drop_item()
|
|
|
|
O.invisibility = 0
|
|
O.name = created_name
|
|
O.real_name = created_name
|
|
|
|
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
|
|
O.cell.loc = O
|
|
W.loc = O//Should fix cybros run time erroring when blown up. It got deleted before, along with the frame.
|
|
O.mmi = W
|
|
|
|
feedback_inc("cyborg_birth",1)
|
|
|
|
del(src)
|
|
else
|
|
user << "\blue The MMI must go in after everything else!"
|
|
|
|
if (istype(W, /obj/item/weapon/pen))
|
|
var/t = input(user, "Enter new robot name", src.name, src.created_name) as text
|
|
t = copytext(sanitize(t), 1, MAX_NAME_LEN)
|
|
if (!t)
|
|
return
|
|
if (!in_range(src, usr) && src.loc != usr)
|
|
return
|
|
|
|
src.created_name = t
|
|
|
|
return
|
|
|
|
/obj/item/robot_parts/chest/attackby(obj/item/W as obj, mob/user as mob)
|
|
..()
|
|
if(istype(W, /obj/item/weapon/cell))
|
|
if(src.cell)
|
|
user << "\blue You have already inserted a cell!"
|
|
return
|
|
else
|
|
user.drop_item()
|
|
W.loc = src
|
|
src.cell = W
|
|
user << "\blue You insert the cell!"
|
|
if(istype(W, /obj/item/weapon/cable_coil))
|
|
if(src.wires)
|
|
user << "\blue You have already inserted wire!"
|
|
return
|
|
else
|
|
var/obj/item/weapon/cable_coil/coil = W
|
|
coil.use(1)
|
|
src.wires = 1.0
|
|
user << "\blue You insert the wire!"
|
|
return
|
|
|
|
/obj/item/robot_parts/head/attackby(obj/item/W as obj, mob/user as mob)
|
|
..()
|
|
if(istype(W, /obj/item/device/flash))
|
|
if(src.flash1 && src.flash2)
|
|
user << "\blue You have already inserted the eyes!"
|
|
return
|
|
else if(src.flash1)
|
|
user.drop_item()
|
|
W.loc = src
|
|
src.flash2 = W
|
|
user << "\blue You insert the flash into the eye socket!"
|
|
else
|
|
user.drop_item()
|
|
W.loc = src
|
|
src.flash1 = W
|
|
user << "\blue You insert the flash into the eye socket!"
|
|
return
|
|
|