From 53826a8a76ba6dc01157481d6d2dda2930b7900a Mon Sep 17 00:00:00 2001 From: FartMaster69420 <78667902+FartMaster69420@users.noreply.github.com> Date: Tue, 10 May 2022 19:48:41 -0400 Subject: [PATCH] Initial Making sleevecards a subtype of pais --- code/datums/autolathe/devices_vr.dm | 2 +- code/modules/resleeving/machines.dm | 6 +- code/modules/resleeving/sleevecard2.dm | 180 +++++++++++++++++++++++++ vorestation.dme | 6 +- 4 files changed, 186 insertions(+), 8 deletions(-) create mode 100644 code/modules/resleeving/sleevecard2.dm diff --git a/code/datums/autolathe/devices_vr.dm b/code/datums/autolathe/devices_vr.dm index 9d92132caa..65af7b630c 100644 --- a/code/datums/autolathe/devices_vr.dm +++ b/code/datums/autolathe/devices_vr.dm @@ -1,3 +1,3 @@ /datum/category_item/autolathe/devices/sleevecard name = "sleevecard" - path =/obj/item/device/sleevecard + path =/obj/item/device/paicard/sleevecard diff --git a/code/modules/resleeving/machines.dm b/code/modules/resleeving/machines.dm index bb17833e35..10930eac1b 100644 --- a/code/modules/resleeving/machines.dm +++ b/code/modules/resleeving/machines.dm @@ -509,8 +509,8 @@ qdel(G) src.updateUsrDialog() return //Don't call up else we'll get attack messsages - if(istype(W, /obj/item/device/sleevecard)) - var/obj/item/device/sleevecard/C = W + if(istype(W, /obj/item/device/paicard/sleevecard)) + var/obj/item/device/paicard/sleevecard/C = W user.unEquip(C) C.removePersonality() qdel(C) @@ -556,7 +556,7 @@ return 0 if(mode == 2 && sleevecards) //Card sleeving - var/obj/item/device/sleevecard/card = new /obj/item/device/sleevecard(get_turf(src)) + var/obj/item/device/paicard/sleevecard/card = new /obj/item/device/paicard/sleevecard(get_turf(src)) card.sleeveInto(MR, db_key = db_key) sleevecards-- return 1 diff --git a/code/modules/resleeving/sleevecard2.dm b/code/modules/resleeving/sleevecard2.dm new file mode 100644 index 0000000000..55d8b14ee9 --- /dev/null +++ b/code/modules/resleeving/sleevecard2.dm @@ -0,0 +1,180 @@ +/obj/item/device/paicard/sleevecard + name = "sleevecard" + desc = "This KHI-upgraded pAI module has enough capacity to run a whole mind of human-level intelligence." + catalogue_data = list(/datum/category_item/catalogue/information/organization/khi, + /datum/category_item/catalogue/technology/resleeving) + + //icon = 'icons/obj/pda.dmi' + //icon_state = "pai" + //item_state = "electronic" + + //w_class = ITEMSIZE_SMALL + //slot_flags = SLOT_BELT + origin_tech = list(TECH_DATA = 2) + show_messages = 0 + var/mob/living/silicon/pai/infomorph/infomorph + //var/obj/item/device/radio/sleevecard/radio + //var/mob/living/silicon/infomorph/infomorph + //var/current_emotion = 1 + + matter = list(MAT_STEEL = 4000, MAT_GLASS = 4000) + +/obj/item/device/paicard/attack_ghost(mob/user as mob) + return + +/obj/item/device/paicard/sleevecard/attackby(var/obj/item/device/sleevemate/I as obj, mob/user as mob) + if(istype(I)) + if(I.stored_mind) + var/datum/mind/M = I.stored_mind + var/datum/transcore_db/db = SStranscore.db_by_mind_name(M.name) + if(db) + to_chat(user, span_notice("You begin uploading [M.name] into \the [src].")) + if(do_after(user,8 SECONDS,src)) + var/datum/transhuman/mind_record/record = db.backed_up[M.name] + to_chat(user, span_notice("You have successfully uploaded [M.name] into \the [src]")) + sleeveInto(record) + I.clear_mind() + else + to_chat(user, span_notice("Your sleevemate flashes an error, apparently this mind doesn't have a backup.")) + +/obj/item/device/paicard/sleevecard/proc/sleeveInto(var/datum/transhuman/mind_record/MR, var/db_key) + infomorph = new(src,MR.mindname,db_key=db_key) + + for(var/datum/language/L in MR.languages) + infomorph.add_language(L.name) + MR.mind_ref.active = 1 //Well, it's about to be. + MR.mind_ref.transfer_to(infomorph) //Does mind+ckey+client. + infomorph.ooc_notes = MR.mind_oocnotes + infomorph.apply_vore_prefs() //Cheap hack for now to give them SOME bellies. + + //Don't set 'real_name' because then we get a nice (as sleevecard) thing. + infomorph.name = "[initial(infomorph.name)] ([MR.mindname])" + name = "[initial(name)] ([MR.mindname])" + //var/emoname = pai_emotions[1] + //setEmotion(1) + + if(infomorph.client) + pai = infomorph + setEmotion(1) + return 1 + + return 0 + +/obj/item/device/paicard/sleevecard/setPersonality(mob/living/silicon/pai/infomorph/personality) + src.infomorph = personality + if(pai != infomorph) + pai = infomorph + add_overlay("pai-happy") +/* +//This is a 'hard' proc, it does no permission checking, do that on the computer +/obj/item/device/paicard/sleevecard/proc/sleeveInto(var/datum/transhuman/mind_record/MR, var/db_key) + infomorph = new(src,MR.mindname,db_key=db_key) + + for(var/datum/language/L in MR.languages) + infomorph.add_language(L.name) + MR.mind_ref.active = 1 //Well, it's about to be. + MR.mind_ref.transfer_to(pai) //Does mind+ckey+client. + infomorph.ooc_notes = MR.mind_oocnotes + infomorph.apply_vore_prefs() //Cheap hack for now to give them SOME bellies. + + //Don't set 'real_name' because then we get a nice (as sleevecard) thing. + infomorph.name = "[initial(infomorph.name)] ([MR.mindname])" + name = "[initial(name)] ([MR.mindname])" + var/emoname = pai_emotions[1] + setEmotion(pai_emotions[emoname]) + pai = infomorph + if(infomorph.client) + return 1 + + return 0 +*/ +/obj/item/device/paicard/sleevecard/attack_self(mob/user) + add_fingerprint(user) + + if(!pai) + to_chat(user,"\The [src] does not have a mind in it!") + else + to_chat(user,"\The [src] displays the name '[pai]'.") + +/mob/living/silicon/pai/infomorph + name = "sleevecard" //Has the same name as the card for consistency, but this is the MOB in the card. + icon = 'icons/mob/pai_vr.dmi' //Changed to the virgo icon, giving more sprite options. + icon_state = "pai-repairbot" + + ram = 30 + +/mob/living/silicon/pai/infomorph/New(var/obj/item/device/paicard/sleevecard/SC, var/name = "Unknown", var/db_key) + ..() + + //ASSERT(SC) + name = "[initial(name)] ([name])" + //src.forceMove(SC) + //card = SC + //sradio = new(src) + //translator = new(src) + //communicator = new(src) + //if(!card.radio) + // card.radio = new (card) + //radio = card.radio + + //src.db_key = db_key + + //Default languages without universal translator software + //add_language(LANGUAGE_EAL, 1) + //add_language(LANGUAGE_SIGN, 0) + /* + verbs += /mob/living/silicon/infomorph/proc/choose_verbs + verbs += /mob/living/proc/hide + verbs += /mob/living/silicon/infomorph/proc/fold_out + verbs += /mob/living/silicon/infomorph/proc/fold_in + */ + //software = default_infomorph_software.Copy() + + //PDA + pda.ownjob = "Sleevecard" + pda.owner = text("[]", src) + pda.name = pda.owner + " (" + pda.ownjob + ")" + + var/datum/data/pda/app/messenger/M = pda.find_program(/datum/data/pda/app/messenger) + if(M) + M.toff = TRUE + + +/mob/living/silicon/pai/infomorph/tgui_data(mob/user, datum/tgui/ui, datum/tgui_state/state) + var/list/data = ..() + + // Software we have bought + var/list/bought_software = list() + // Software we have not bought + var/list/not_bought_software = list() + + for(var/key in pai_software_by_key) + var/datum/pai_software/S = pai_software_by_key[key] + var/software_data[0] + if(istype(S, /datum/pai_software/directives)) + continue + software_data["name"] = S.name + software_data["id"] = S.id + if(key in software) + software_data["on"] = S.is_active(src) + bought_software.Add(list(software_data)) + else + software_data["ram"] = S.ram_cost + not_bought_software.Add(list(software_data)) + + data["bought"] = bought_software + data["not_bought"] = not_bought_software + data["available_ram"] = ram + + // Emotions + var/list/emotions = list() + for(var/name in pai_emotions) + var/list/emote = list() + emote["name"] = name + emote["id"] = pai_emotions[name] + emotions.Add(list(emote)) + + data["emotions"] = emotions + data["current_emotion"] = card.current_emotion + + return data \ No newline at end of file diff --git a/vorestation.dme b/vorestation.dme index 40d0515ef9..b541682d72 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -3746,12 +3746,10 @@ #include "code\modules\resleeving\documents.dm" #include "code\modules\resleeving\implant.dm" #include "code\modules\resleeving\infocore_records.dm" -#include "code\modules\resleeving\infomorph.dm" -#include "code\modules\resleeving\infomorph_software.dm" #include "code\modules\resleeving\machine_subtypes.dm" #include "code\modules\resleeving\machines.dm" #include "code\modules\resleeving\resleeving_sickness.dm" -#include "code\modules\resleeving\sleevecard.dm" +#include "code\modules\resleeving\sleevecard2.dm" #include "code\modules\rogueminer_vr\asteroid.dm" #include "code\modules\rogueminer_vr\controller.dm" #include "code\modules\rogueminer_vr\debug.dm" @@ -4132,7 +4130,6 @@ #include "maps\southern_cross\loadout\loadout_suit.dm" #include "maps\southern_cross\loadout\loadout_uniform.dm" #include "maps\southern_cross\loadout\loadout_vr.dm" -#include "maps\stellardelight\stellar_delight.dm" #include "maps\submaps\_helpers.dm" #include "maps\submaps\_readme.dm" #include "maps\submaps\engine_submaps\engine.dm" @@ -4142,5 +4139,6 @@ #include "maps\submaps\space_submaps\debrisfield\debrisfield.dm" #include "maps\submaps\surface_submaps\wilderness\wilderness.dm" #include "maps\submaps\surface_submaps\wilderness\wilderness_areas.dm" +#include "maps\virgo_minitest\virgo_minitest.dm" #include "maps\~map_system\maps.dm" // END_INCLUDE