From 964b86fdbde10f25517db0992b95d30b681bb5af Mon Sep 17 00:00:00 2001 From: "giacomand@gmail.com" Date: Tue, 16 Oct 2012 13:21:44 +0000 Subject: [PATCH] New Changeling Powers! Hive Channel/Hive Absorb. Allows you to share your DNA with other changelings, very expensive chemical wise to absorb (download), not so much to channel (upload)! You cannot achieve your objective by sharing DNA. Mimic Voice! You can form your voice of a name you enter. You won't look like them but when you talk, people will hear the name of who you selected. While you're mimicing, you can't regenerate chemicals. Extract DNA! A power that allows you to silently sting someone and take their DNA! Meaning you do not have to absorb someone to become them. Extracting their DNA doesn't count towards completing your objectives. Misc: New livingmob proc GetVoice(), used by changeling mimicing and voice changers. Will return the name of the voice that should be heard by people. Got rid of the chance to "feel" like someone isn't who they are. Commented the check for someone's gender being incorrect in life. Looks like the bug hasn't re-occured since it was put in place. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4890 316c924e-a436-60f5-8080-3fe189b3f50e --- code/game/gamemodes/changeling/changeling.dm | 12 +- .../gamemodes/changeling/changeling_powers.dm | 137 +++++++++++++++--- .../gamemodes/changeling/modularchangling.dm | 35 ++++- code/game/machinery/hologram.dm | 6 +- .../game/objects/items/devices/radio/radio.dm | 17 +-- .../mob/living/carbon/human/examine.dm | 6 +- code/modules/mob/living/carbon/human/life.dm | 3 +- code/modules/mob/living/carbon/human/say.dm | 14 +- .../mob/living/carbon/human/whisper.dm | 33 +---- code/modules/mob/living/say.dm | 16 +- html/changelog.html | 11 ++ 11 files changed, 212 insertions(+), 78 deletions(-) diff --git a/code/game/gamemodes/changeling/changeling.dm b/code/game/gamemodes/changeling/changeling.dm index fda16d4d4ec..b988cf24470 100644 --- a/code/game/gamemodes/changeling/changeling.dm +++ b/code/game/gamemodes/changeling/changeling.dm @@ -215,6 +215,7 @@ var/list/possible_changeling_IDs = list("Alpha","Beta","Gamma","Delta","Epsilon" var/isabsorbing = 0 var/geneticpoints = 5 var/purchasedpowers = list() + var/mimicing = "" /datum/changeling/New(var/gender=FEMALE) ..() @@ -230,4 +231,13 @@ var/list/possible_changeling_IDs = list("Alpha","Beta","Gamma","Delta","Epsilon" /datum/changeling/proc/regenerate() chem_charges = min(max(0, chem_charges+chem_recharge_rate), chem_storage) - geneticdamage = max(0, geneticdamage-1) \ No newline at end of file + geneticdamage = max(0, geneticdamage-1) + + +/datum/changeling/proc/GetDNA(var/dna_owner) + var/datum/dna/chosen_dna + for(var/datum/dna/DNA in absorbed_dna) + if(dna_owner == DNA.real_name) + chosen_dna = DNA + break + return chosen_dna \ No newline at end of file diff --git a/code/game/gamemodes/changeling/changeling_powers.dm b/code/game/gamemodes/changeling/changeling_powers.dm index 1416713022e..94bf80d6331 100644 --- a/code/game/gamemodes/changeling/changeling_powers.dm +++ b/code/game/gamemodes/changeling/changeling_powers.dm @@ -174,12 +174,7 @@ var/S = input("Select the target DNA: ", "Target DNA", null) as null|anything in names if(!S) return - var/datum/dna/chosen_dna - for(var/datum/dna/DNA in changeling.absorbed_dna) - if(S == "[DNA.real_name]") - chosen_dna = DNA - break - + var/datum/dna/chosen_dna = changeling.GetDNA(S) if(!chosen_dna) return @@ -277,12 +272,7 @@ var/S = input("Select the target DNA: ", "Target DNA", null) as null|anything in names if(!S) return - var/datum/dna/chosen_dna - for(var/datum/dna/DNA in changeling.absorbed_dna) - if(S == "[DNA.real_name]") - chosen_dna = DNA - break - + var/datum/dna/chosen_dna = changeling.GetDNA(S) if(!chosen_dna) return @@ -500,6 +490,102 @@ feedback_add_details("changeling_powers","RR") return 1 +// HIVE MIND UPLOAD/DOWNLOAD DNA + +var/list/datum/dna/hivemind_bank = list() + +/mob/proc/changeling_hiveupload() + set category = "Changeling" + set name = "Hive Channel (10)" + set desc = "Allows you to channel DNA in the airwaves to allow other changelings to absorb it." + + var/datum/changeling/changeling = changeling_power(10,1) + if(!changeling) return + + var/list/names = list() + for(var/datum/dna/DNA in changeling.absorbed_dna) + if(!(DNA in hivemind_bank)) + names += DNA.real_name + + if(names.len <= 0) + usr << "The airwaves already have all of our DNA." + return + + var/S = input("Select a DNA to channel: ", "Channel DNA", null) as null|anything in names + if(!S) return + + var/datum/dna/chosen_dna = changeling.GetDNA(S) + if(!chosen_dna) + return + + changeling.chem_charges -= 10 + hivemind_bank += chosen_dna + usr << "We channel the DNA of [S] to the air." + feedback_add_details("changeling_powers","HU") + return 1 + +/mob/proc/changeling_hivedownload() + set category = "Changeling" + set name = "Hive Absorb (40)" + set desc = "Allows you to absorb DNA that is being channeled in the airwaves." + + var/datum/changeling/changeling = changeling_power(40,1) + if(!changeling) return + + var/list/names = list() + for(var/datum/dna/DNA in hivemind_bank) + if(!(DNA in changeling.absorbed_dna)) + names[DNA.real_name] = DNA + + if(names.len <= 0) + usr << "There's no new DNA to absorb from the air." + return + + var/S = input("Select a DNA absorb from the air: ", "Absorb DNA", null) as null|anything in names + if(!S) return + var/datum/dna/chosen_dna = names[S] + if(!chosen_dna) + return + + changeling.chem_charges -= 40 + changeling.absorbed_dna += chosen_dna + usr << "We absorb the DNA of [S] from the air." + feedback_add_details("changeling_powers","HD") + return 1 + +// Fake Voice + +/mob/proc/changeling_mimicvoice() + set category = "Changeling" + set name = "Mimic Voice (10)" + set desc = "Shape our vocal glands to form a voice of someone we choose." + + var/datum/changeling/changeling = changeling_power(10,1) + if(!changeling) return + + if(changeling.mimicing) + changeling.mimicing = "" + usr << "We return our vocal glands to their original location." + return + + var/mimic_voice = input("Enter a name to mimic.", "Mimic Voice", null) as text + if(!mimic_voice) + return + + changeling.chem_charges -= 10 + changeling.mimicing = mimic_voice + + usr << "We shape our glands to take the voice of [mimic_voice], this will stop us from regenerating chemicals while active." + usr << "Use this power again to return to our original voice and reproduce chemicals again." + + feedback_add_details("changeling_powers","MV") + + spawn(0) + while(src && src.mind && src.mind.changeling && src.mind.changeling.mimicing) + src.mind.changeling.chem_charges -= 1 + sleep(40) + if(src && src.mind && src.mind.changeling) + src.mind.changeling.mimicing = "" ////////// //STINGS// //They get a pretty header because there's just so fucking many of them ;_; ////////// @@ -617,12 +703,7 @@ var/S = input("Select the target DNA: ", "Target DNA", null) as null|anything in names if(!S) return - var/datum/dna/chosen_dna - for(var/datum/dna/DNA in changeling.absorbed_dna) - if(S == "[DNA.real_name]") - chosen_dna = DNA - break - + var/datum/dna/chosen_dna = changeling.GetDNA(S) if(!chosen_dna) return @@ -666,3 +747,23 @@ if(T.reagents) T.reagents.add_reagent("lexorin", 40) feedback_add_details("changeling_powers","DTHS") return 1 + +/mob/proc/changeling_extract_dna_sting() + set category = "Changeling" + set name = "Extract DNA Sting (40)" + set desc="Stealthily sting a target to extract their DNA." + + var/datum/changeling/changeling = null + if(usr.mind && usr.mind.changeling) + changeling = usr.mind.changeling + if(!changeling) + return 0 + + var/mob/living/carbon/T = changeling_sting(40, /mob/proc/changeling_extract_dna_sting) + if(!T) return 0 + + T.dna.real_name = T.real_name + changeling.absorbed_dna |= T.dna + + feedback_add_details("changeling_powers","ED") + return 1 \ No newline at end of file diff --git a/code/game/gamemodes/changeling/modularchangling.dm b/code/game/gamemodes/changeling/modularchangling.dm index 9215b3a5763..ce4fb5b8702 100644 --- a/code/game/gamemodes/changeling/modularchangling.dm +++ b/code/game/gamemodes/changeling/modularchangling.dm @@ -1,3 +1,4 @@ +// READ: Don't use the apostrophe in name or desc. Causes script errors. var/list/powers = typesof(/datum/power/changeling) - /datum/power/changeling //needed for the badmin verb for now var/list/datum/power/changeling/powerinstances = list() @@ -33,6 +34,22 @@ var/list/datum/power/changeling/powerinstances = list() allowduringlesserform = 1 verbpath = /mob/proc/changeling_fakedeath +// Hivemind + +/datum/power/changeling/hive_upload + name = "Hive Channel" + desc = "We can channel a DNA into the airwaves, allowing our fellow changelings to absorb it and transform into it as if they acquired the DNA themselves." + helptext = "Allows other changelings to absorb the DNA you channel from the airwaves. Will not help them towards their absorb objectives." + genomecost = 0 + verbpath = /mob/proc/changeling_hiveupload + +/datum/power/changeling/hive_download + name = "Hive Absorb" + desc = "We can absorb a single DNA from the airwaves, allowing us to use more disguises with help from our fellow changelings." + helptext = "Allows you to absorb a single DNA and use it. Does not count towards your absorb objective." + genomecost = 0 + verbpath = /mob/proc/changeling_hivedownload + /datum/power/changeling/lesser_form name = "Lesser Form" desc = "We debase ourselves and become lesser. We become a monkey." @@ -61,6 +78,21 @@ var/list/datum/power/changeling/powerinstances = list() allowduringlesserform = 1 verbpath = /mob/proc/changeling_silence_sting +/datum/power/changeling/mimicvoice + name = "Mimic Voice" + desc = "We shape our vocal glands to sound like a desired voice." + helptext = "Will turn your voice into the name that you enter." + genomecost = 3 + verbpath = /mob/proc/changeling_mimicvoice + +/datum/power/changeling/extractdna + name = "Extract DNA" + desc = "We stealthily sting a target and extract the DNA from them." + helptext = "Will give you the DNA of your target, allowing you to transform into them. Does not count towards absorb objectives." + genomecost = 4 + allowduringlesserform = 1 + verbpath = /mob/proc/changeling_extract_dna_sting + /datum/power/changeling/transformation_sting name = "Transformation Sting" desc = "We silently sting a human, injecting a retrovirus that forces them to transform into another." @@ -135,7 +167,7 @@ var/list/datum/power/changeling/powerinstances = list() name = "Digital Camoflauge" desc = "We evolve the ability to distort our form and proprtions, defeating common altgorthms used to detect lifeforms on cameras." helptext = "We cannot be tracked by camera while using this skill. However, humans looking at us will find us.. uncanny. We must constantly expend chemicals to maintain our form like this." - genomecost = 4 + genomecost = 3 allowduringlesserform = 1 verbpath = /mob/proc/changeling_digitalcamo @@ -147,6 +179,7 @@ var/list/datum/power/changeling/powerinstances = list() verbpath = /mob/proc/changeling_rapidregen + // Modularchangling, totally stolen from the new player panel. YAYY /datum/changeling/proc/EvolutionMenu()//The new one set category = "Changeling" diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm index 9446ddade32..90b628d93e9 100644 --- a/code/game/machinery/hologram.dm +++ b/code/game/machinery/hologram.dm @@ -59,13 +59,11 @@ var/const/HOLOPAD_MODE = 0 /*This is the proc for special two-way communication between AI and holopad/people talking near holopad. For the other part of the code, check silicon say.dm. Particularly robot talk.*/ -/obj/machinery/hologram/holopad/hear_talk(mob/M, text) +/obj/machinery/hologram/holopad/hear_talk(mob/living/M, text) if(M&&hologram&&master)//Master is mostly a safety in case lag hits or something. if(!master.say_understands(M))//The AI will be able to understand most mobs talking through the holopad. text = stars(text) - var/name_used = M.name - if(istype(M.wear_mask, /obj/item/clothing/mask/gas/voice)&&M.wear_mask:vchange)//Can't forget the ninjas. - name_used = M.wear_mask:voice + var/name_used = M.GetVoice() //This communication is imperfect because the holopad "filters" voices and is only designed to connect to the master only. var/rendered = "Holopad received, [name_used] [M.say_quote(text)]" master.show_message(rendered, 2) diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm index 0491028d091..dd42244ed9c 100644 --- a/code/game/objects/items/devices/radio/radio.dm +++ b/code/game/objects/items/devices/radio/radio.dm @@ -195,7 +195,7 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use updateDialog() add_fingerprint(usr) -/obj/item/device/radio/talk_into(mob/M as mob, message, channel) +/obj/item/device/radio/talk_into(mob/living/M as mob, message, channel) if(!on) return // the device has to be on // Fix for permacell radios, but kinda eh about actually fixing them. @@ -278,10 +278,9 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use // --- Modifications to the mob's identity --- // The mob is disguising their identity: - if (istype(M.wear_mask, /obj/item/clothing/mask/gas/voice)) - if(M.wear_mask:vchange) - displayname = M.wear_mask:voice - jobname = "Unknown" + if (ishuman(M) && M.GetVoice() != real_name) + displayname = M.GetVoice() + jobname = "Unknown" voicemask = 1 @@ -451,7 +450,7 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use if (R.client && R.client.STFU_radio) //Adminning with 80 people on can be fun when you're trying to talk and all you can hear is radios. continue if (R.say_understands(M)) - if (!ishuman(M) || istype(M.wear_mask, /obj/item/clothing/mask/gas/voice)) + if (ishuman(M) && M.GetVoice() != M.real_name) heard_masked += R else heard_normal += R @@ -535,10 +534,8 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use if (length(heard_masked)) var/N = M.name var/J = eqjobname - if (istype(M.wear_mask, /obj/item/clothing/mask/gas/voice)&&M.wear_mask:vchange) - //To properly have the ninja show up on radio. Could also be useful for similar items. - //Would not be necessary but the mob could be wearing a mask that is not a voice changer. - N = M.wear_mask:voice + if(ishuman(M) && M.GetVoice() != M.real_name) + N = M.GetVoice() J = "Unknown" var/rendered = "[part_a][N][part_b][quotedmsg][part_c]" for (var/mob/R in heard_masked) diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index 80661056a13..8433a15bdf3 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -169,7 +169,7 @@ //ID if(wear_id) - var/id + /*var/id if(istype(wear_id, /obj/item/device/pda)) var/obj/item/device/pda/pda = wear_id id = pda.owner @@ -178,8 +178,8 @@ id = idcard.registered_name if(id && (id != real_name) && (get_dist(src, usr) <= 1) && prob(10)) msg += "[t_He] [t_is] wearing \icon[wear_id] \a [wear_id] yet something doesn't seem right...\n" - else - msg += "[t_He] [t_is] wearing \icon[wear_id] \a [wear_id].\n" + else*/ + msg += "[t_He] [t_is] wearing \icon[wear_id] \a [wear_id].\n" //Jitters if(is_jittery) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index fa728a81218..d92055c7c98 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -38,13 +38,14 @@ ..() + /* //This code is here to try to determine what causes the gender switch to plural error. Once the error is tracked down and fixed, this code should be deleted //Also delete var/prev_gender once this is removed. if(prev_gender != gender) prev_gender = gender if(gender in list(PLURAL, NEUTER)) message_admins("[src] ([ckey]) gender has been changed to plural or neuter. Please record what has happened recently to the person and then notify coders. (?) (VV) (PM) (JMP)",1,1) //The 1,1 at the end is there to make '%holder_ref%' get replaced with the actual ref object - + */ //Apparently, the person who wrote this code designed it so that //blinded get reset each cycle and then get activated later in the //code. Very ugly. I dont care. Moving this stuff here so its easy diff --git a/code/modules/mob/living/carbon/human/say.dm b/code/modules/mob/living/carbon/human/say.dm index 158cb70b223..f22015cfbd4 100644 --- a/code/modules/mob/living/carbon/human/say.dm +++ b/code/modules/mob/living/carbon/human/say.dm @@ -132,4 +132,16 @@ return 1 if (istype(other, /mob/living/carbon/metroid)) return 1 - return ..() \ No newline at end of file + return ..() + +/mob/living/carbon/human/GetVoice() + if(istype(src.wear_mask, /obj/item/clothing/mask/gas/voice)) + var/obj/item/clothing/mask/gas/voice/V = src.wear_mask + if(V.vchange) + return V.voice + else + return name + if(mind && mind.changeling && mind.changeling.mimicing) + return mind.changeling.mimicing + return real_name + diff --git a/code/modules/mob/living/carbon/human/whisper.dm b/code/modules/mob/living/carbon/human/whisper.dm index e7566dbfca6..6f202b50df6 100644 --- a/code/modules/mob/living/carbon/human/whisper.dm +++ b/code/modules/mob/living/carbon/human/whisper.dm @@ -23,7 +23,7 @@ return var/alt_name = "" - if (istype(src, /mob/living/carbon/human) && src.name != src.real_name) + if (istype(src, /mob/living/carbon/human) && src.name != GetVoice()) var/mob/living/carbon/human/H = src alt_name = " (as [H.get_id_name("Unknown")])" // Mute disability @@ -98,15 +98,7 @@ if (italics) message_a = "[message_a]" //This appears copied from carbon/living say.dm so the istype check for mob is probably not needed. Appending for src is also not needed as the game will check that automatically. - if (!istype(src, /mob/living/carbon/human)) - rendered = "[name] whispers, \"[message_a]\"" - else if (istype(wear_mask, /obj/item/clothing/mask/gas/voice)) - if (wear_mask:vchange) - rendered = "[wear_mask:voice] whispers, \"[message_a]\"" - else - rendered = "[name] whispers, \"[message_a]\"" - else - rendered = "[real_name][alt_name] whispers, \"[message_a]\"" + rendered = "[GetVoice()][alt_name] whispers, \"[message_a]\"" for (var/mob/M in heard_a) M.show_message(rendered, 2) @@ -131,15 +123,7 @@ if (M.say_understands(src)) var/message_c message_c = stars(message) - if (!istype(src, /mob/living/carbon/human)) - rendered = "[name] whispers, \"[message_c]\"" - else if(istype(wear_mask, /obj/item/clothing/mask/gas/voice)) - if(wear_mask:vchange) - rendered = "[wear_mask:voice] whispers, \"[message_c]\"" - else - rendered = "[name] whispers, \"[message_c]\"" - else - rendered = "[real_name][alt_name] whispers, \"[message_c]\"" + rendered = "[GetVoice()][alt_name] whispers, \"[message_c]\"" M.show_message(rendered, 2) else rendered = "[src.voice_name] whispers something." @@ -147,16 +131,7 @@ if (italics) message = "[message]" - - if (!istype(src, /mob/living/carbon/human)) - rendered = "[name] whispers, \"[message]\"" - else if (istype(src.wear_mask, /obj/item/clothing/mask/gas/voice)) - if(wear_mask:vchange) - rendered = "[wear_mask:voice] whispers, \"[message]\"" - else - rendered = "[name] whispers, \"[message]\"" - else - rendered = "[real_name][alt_name] whispers, \"[message]\"" + rendered = "[GetVoice()][alt_name] whispers, \"[message]\"" for (var/mob/M in dead_mob_list) if (!(M.client)) diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm index 3e95b65d40a..854ef72fbdf 100644 --- a/code/modules/mob/living/say.dm +++ b/code/modules/mob/living/say.dm @@ -108,7 +108,7 @@ var/list/department_radio_keys = list( return emote(copytext(message, 2)) var/alt_name = "" - if (istype(src, /mob/living/carbon/human) && name != real_name) + if (istype(src, /mob/living/carbon/human) && name != GetVoice()) var/mob/living/carbon/human/H = src alt_name = " (as [H.get_id_name("Unknown")])" var/italics = 0 @@ -335,15 +335,8 @@ var/list/department_radio_keys = list( if (italics) message_a = "[message_a]" - if (!istype(src, /mob/living/carbon/human)) - rendered = "[name] [message_a]" - else if(istype(wear_mask, /obj/item/clothing/mask/gas/voice)) - if(wear_mask:vchange) - rendered = "[wear_mask:voice] [message_a]" - else - rendered = "[name] [message_a]" - else - rendered = "[real_name][alt_name] [message_a]" + + rendered = "[GetVoice()][alt_name] [message_a]" for (var/M in heard_a) if(hascall(M,"show_message")) @@ -392,4 +385,7 @@ var/list/department_radio_keys = list( log_say("[name]/[key] : [message]") +/mob/living/proc/GetVoice() + return name + diff --git a/html/changelog.html b/html/changelog.html index 642c9bc3159..fc9a9a58f15 100644 --- a/html/changelog.html +++ b/html/changelog.html @@ -48,6 +48,17 @@ Stuff which is in development and not yet visible to players or just code relate should be listed in the changelog upon commit tho. Thanks. --> +
+

16 October 2012

+

Giacom updated:

+ +
+

13 October 2012

Giacom updated: