mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 19:47:22 +01:00
Adds bare bones for a persistence system
Admins can toy around with converting a character to text, and placing them back elsewhere, independent of the round. It's got a kink, though: The text given to you directly needs to be printed once to remove all the escapes - otherwise the thing will choke. I'd like advice on resolving that
This commit is contained in:
@@ -343,3 +343,32 @@ I use this so that this can be made better once the organ overhaul rolls out --
|
||||
if(!istype(owner)) // You're not the primary organ of ANYTHING, bucko
|
||||
return 0
|
||||
return src == O.get_int_organ(organ_tag)
|
||||
|
||||
/obj/item/organ/serialize()
|
||||
var/data = ..()
|
||||
if(status != 0)
|
||||
data["status"] = status
|
||||
if(robotic > 0)
|
||||
data["robotic"] = robotic
|
||||
|
||||
// Save the DNA datum if: The owner doesn't exist, or the dna doesn't match
|
||||
// the owner
|
||||
if(!(owner && dna.unique_enzymes == owner.dna.unique_enzymes))
|
||||
data["dna"] = dna.serialize()
|
||||
return data
|
||||
|
||||
/obj/item/organ/deserialize(var/data)
|
||||
switch(data["robotic"])
|
||||
if(1)
|
||||
mechassist()
|
||||
if(2)
|
||||
robotize()
|
||||
else
|
||||
// Nothing
|
||||
if(isnum(data["status"]))
|
||||
status = data["status"]
|
||||
if(islist(data["dna"]))
|
||||
// The only thing the official proc does is
|
||||
//instantiate the list and call this proc
|
||||
dna.deserialize(data["dna"])
|
||||
..()
|
||||
|
||||
@@ -836,12 +836,7 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
..()
|
||||
|
||||
if(company && istext(company))
|
||||
model = company
|
||||
var/datum/robolimb/R = all_robolimbs[company]
|
||||
if(R)
|
||||
force_icon = R.icon
|
||||
name = "[R.company] [initial(name)]"
|
||||
desc = "[R.desc]"
|
||||
set_company(company)
|
||||
|
||||
cannot_break = 1
|
||||
get_icon()
|
||||
@@ -849,6 +844,16 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
if(T)
|
||||
T.robotize()
|
||||
|
||||
|
||||
|
||||
/obj/item/organ/external/proc/set_company(var/company)
|
||||
model = company
|
||||
var/datum/robolimb/R = all_robolimbs[company]
|
||||
if(R)
|
||||
force_icon = R.icon
|
||||
name = "[R.company] [initial(name)]"
|
||||
desc = "[R.desc]"
|
||||
|
||||
/obj/item/organ/external/proc/mutate()
|
||||
src.status |= ORGAN_MUTATED
|
||||
if(owner) owner.update_body()
|
||||
@@ -969,3 +974,19 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
continue
|
||||
wounds -= W
|
||||
qdel(W)
|
||||
|
||||
|
||||
/obj/item/organ/external/serialize()
|
||||
var/list/data = ..()
|
||||
if(robotic == 2)
|
||||
data["company"] = model
|
||||
// If we wanted to store wound information, here is where it would go
|
||||
return data
|
||||
|
||||
/obj/item/organ/external/deserialize(list/data)
|
||||
var/company = data["company"]
|
||||
if(company && istext(company))
|
||||
set_company(company)
|
||||
..() // Parent call loads in the DNA
|
||||
if(data["dna"])
|
||||
sync_colour_to_dna()
|
||||
|
||||
Reference in New Issue
Block a user