From 89b29eb0f06228cff56229a985f65dc4cc37a601 Mon Sep 17 00:00:00 2001 From: PsiOmega Date: Sun, 31 Aug 2014 16:51:45 +0200 Subject: [PATCH] One can now save exploitable information about the character, potentially to be used by antags. --- code/__HELPERS/unsorted.dm | 2 +- code/datums/datacore.dm | 10 ++++++++ code/defines/obj.dm | 3 ++- code/modules/client/preferences.dm | 27 ++++++++++++++++++--- code/modules/client/preferences_savefile.dm | 4 ++- code/modules/mob/mob_defines.dm | 1 + 6 files changed, 40 insertions(+), 7 deletions(-) diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 85fad60526e..20da6ade746 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -264,7 +264,7 @@ Turf and target are seperate in case you want to teleport some distance from a t if(oldname) //update the datacore records! This is goig to be a bit costly. - for(var/list/L in list(data_core.general,data_core.medical,data_core.security,data_core.locked)) + for(var/list/L in list(data_core.general,data_core.medical,data_core.security,data_core.locked,data_core.exploit)) for(var/datum/data/record/R in L) if(R.fields["name"] == oldname) R.fields["name"] = newname diff --git a/code/datums/datacore.dm b/code/datums/datacore.dm index 143e24a7f99..a4c9cc0e8dd 100644 --- a/code/datums/datacore.dm +++ b/code/datums/datacore.dm @@ -110,6 +110,16 @@ S.fields["notes"] = "No notes." security += S + // Records with exploitative information + var/datum/data/record/E = new() + E.fields["id"] = id + E.fields["name"] = H.real_name + if(H.exploit_record && !jobban_isbanned(H, "Records")) + E.fields["notes"] = H.exploit_record + else + E.fields["notes"] = "No additional information acquired." + exploit += E + //Locked Record var/datum/data/record/L = new() L.fields["id"] = md5("[H.real_name][H.mind.assigned_role]") diff --git a/code/defines/obj.dm b/code/defines/obj.dm index c7e3df319d8..f1ee31799e9 100644 --- a/code/defines/obj.dm +++ b/code/defines/obj.dm @@ -48,6 +48,7 @@ var/medical[] = list() var/general[] = list() var/security[] = list() + var/exploit[] = list() //This list tracks characters spawned in the world and cannot be modified in-game. Currently referenced by respawn_character(). var/locked[] = list() @@ -303,7 +304,7 @@ var/global/list/PDA_Manifest = list() throw_speed = 1 throw_range = 20 flags = FPRINT | TABLEPASS | CONDUCT - + afterattack(atom/target as mob|obj|turf|area, mob/user as mob) user.drop_item() src.throw_at(target, throw_range, throw_speed, user) diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 6e078326feb..93da9a02320 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -118,6 +118,7 @@ datum/preferences var/med_record = "" var/sec_record = "" var/gen_record = "" + var/exploit_record = "" var/disabilities = 0 var/nanotrasen_relation = "Neutral" @@ -397,7 +398,7 @@ datum/preferences dat += "Set Flavor Text
" - dat += "pAI Configuration
" dat += "
" dat += "
Hair
" @@ -596,6 +597,13 @@ datum/preferences HTML += "
" HTML +="Uplink Type : [uplinklocation]" HTML +="
" + HTML +="Exploitable information about you : " + HTML += "
" + if(jobban_isbanned(user, "Records")) + HTML += "You are banned from using character records.
" + else + HTML +="[TextPreview(exploit_record,40)]" + HTML +="
" HTML +="
" HTML +="\[Done\]" @@ -949,6 +957,16 @@ datum/preferences gen_record = genmsg SetRecords(user) + if(href_list["task"] == "exploitable_record") + var/exploitmsg = input(usr,"Set exploitable information about you here.","Exploitable Information",html_decode(exploit_record)) as message + + if(exploitmsg != null) + exploitmsg = copytext(exploitmsg, 1, MAX_PAPER_MESSAGE_LEN) + exploitmsg = html_encode(exploitmsg) + + exploit_record = exploitmsg + SetAntagoptions(user) + else if (href_list["preference"] == "antagoptions") if(text2num(href_list["active"]) == 0) SetAntagoptions(user) @@ -1001,16 +1019,16 @@ datum/preferences user << "\red That item will exceed the maximum loadout cost of [MAX_GEAR_COST] points." else if(href_list["task"] == "remove") - + if(isnull(gear) || !islist(gear)) gear = list() if(!gear.len) return - + var/choice = input(user, "Select gear to remove: ") as null|anything in gear if(!choice) return - + for(var/gear_name in gear) if(gear_name == choice) gear -= gear_name @@ -1519,6 +1537,7 @@ datum/preferences character.med_record = med_record character.sec_record = sec_record character.gen_record = gen_record + character.exploit_record = exploit_record character.gender = gender character.age = age diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index dd205c38628..db654fcc132 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -160,7 +160,7 @@ S["gen_record"] >> gen_record S["be_special"] >> be_special S["disabilities"] >> disabilities - S["player_alt_titles"] >> player_alt_titles + S["player_alt_titles"] >> player_alt_titles S["used_skillpoints"] >> used_skillpoints S["skills"] >> skills S["skill_specialization"] >> skill_specialization @@ -175,6 +175,7 @@ //S["skin_style"] >> skin_style S["uplinklocation"] >> uplinklocation + S["exploit_record"] >> exploit_record S["UI_style_color"] << UI_style_color S["UI_style_alpha"] << UI_style_alpha @@ -315,6 +316,7 @@ //S["skin_style"] << skin_style S["uplinklocation"] << uplinklocation + S["exploit_record"] << exploit_record S["UI_style_color"] << UI_style_color S["UI_style_alpha"] << UI_style_alpha diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index c9f30cd3baa..bb7e9f1416d 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -69,6 +69,7 @@ var/med_record = "" var/sec_record = "" var/gen_record = "" + var/exploit_record = "" var/blinded = null var/bhunger = 0 //Carbon var/ajourn = 0