From d87603054b03418d80de4f782a9eaf3433d55a3b Mon Sep 17 00:00:00 2001 From: uraniummeltdown Date: Sun, 5 Feb 2017 22:00:17 +0400 Subject: [PATCH 1/2] say_log for mobs, fixed changeling absorb memory, changelings can now see past 8 messages of absorbed victim --- code/datums/mind.dm | 18 +++++++++------ code/game/gamemodes/changeling/changeling.dm | 1 + .../gamemodes/changeling/powers/absorb.dm | 23 ++++++++++++++++++- code/modules/mob/living/living_defines.dm | 4 +++- code/modules/mob/living/say.dm | 5 +++- 5 files changed, 41 insertions(+), 10 deletions(-) diff --git a/code/datums/mind.dm b/code/datums/mind.dm index fcf1ded97cc..b81e934f4ed 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -104,11 +104,13 @@ /datum/mind/proc/wipe_memory() memory = null -/datum/mind/proc/show_memory(mob/recipient) - var/output = "[current.real_name]'s Memory
" +/datum/mind/proc/show_memory(mob/recipient, window=1) + if(!recipient) + recipient = current + var/output = "[current.real_name]'s Memories:
" output += memory - if(objectives.len>0) + if(objectives.len) output += "
Objectives:" var/obj_count = 1 @@ -116,7 +118,7 @@ output += "Objective #[obj_count]: [objective.explanation_text]" obj_count++ - if(job_objectives.len>0) + if(job_objectives.len) output += "
Job Objectives:" - - recipient << browse(output,"window=memory") + if(window) + recipient << browse(output,"window=memory") + else + to_chat(recipient, "[output]") /datum/mind/proc/edit_memory() if(!ticker || !ticker.mode) @@ -1324,7 +1328,7 @@ var/explanation = "Summon [ticker.mode.cultdat.entity_name] via the use of the appropriate rune. It will only work if nine cultists stand on and around it." to_chat(current, "Objective #1: [explanation]") current.memory += "Objective #1: [explanation]
" - + var/mob/living/carbon/human/H = current if(istype(H)) diff --git a/code/game/gamemodes/changeling/changeling.dm b/code/game/gamemodes/changeling/changeling.dm index c25802d38fc..e09d31fa8bb 100644 --- a/code/game/gamemodes/changeling/changeling.dm +++ b/code/game/gamemodes/changeling/changeling.dm @@ -1,3 +1,4 @@ +#define LING_ABSORB_RECENT_SPEECH 8 //The amount of recent spoken lines to gain on absorbing a mob var/list/possible_changeling_IDs = list("Alpha","Beta","Gamma","Delta","Epsilon","Zeta","Eta","Theta","Iota","Kappa","Lambda","Mu","Nu","Xi","Omicron","Pi","Rho","Sigma","Tau","Upsilon","Phi","Chi","Psi","Omega") /datum/game_mode diff --git a/code/game/gamemodes/changeling/powers/absorb.dm b/code/game/gamemodes/changeling/powers/absorb.dm index 57b69358f6b..7d0212a216b 100644 --- a/code/game/gamemodes/changeling/powers/absorb.dm +++ b/code/game/gamemodes/changeling/powers/absorb.dm @@ -63,7 +63,28 @@ if(target.mind)//if the victim has got a mind - target.mind.show_memory(src, 0) //I can read your mind, kekeke. Output all their notes. + target.mind.show_memory(user, 0) //I can read your mind, kekeke. Output all their notes. + + //Some of target's recent speech, so the changeling can attempt to imitate them better. + //Recent as opposed to all because rounds tend to have a LOT of text. + var/list/recent_speech = list() + + if(target.say_log.len > LING_ABSORB_RECENT_SPEECH) + recent_speech = target.say_log.Copy(target.say_log.len-LING_ABSORB_RECENT_SPEECH+1,0) //0 so len-LING_ARS+1 to end of list + else + for(var/spoken_memory in target.say_log) + if(recent_speech.len >= LING_ABSORB_RECENT_SPEECH) + break + recent_speech += spoken_memory + + if(recent_speech.len) + user.mind.store_memory("Some of [target]'s speech patterns, we should study these to better impersonate them!") + to_chat(user, "Some of [target]'s speech patterns, we should study these to better impersonate them!") + for(var/spoken_memory in recent_speech) + user.mind.store_memory("\"[spoken_memory]\"") + to_chat(user, "\"[spoken_memory]\"") + user.mind.store_memory("We have no more knowledge of [target]'s speech patterns.") + to_chat(user, "We have no more knowledge of [target]'s speech patterns.") if(target.mind.changeling)//If the target was a changeling, suck out their extra juice and objective points! changeling.chem_charges += min(target.mind.changeling.chem_charges, changeling.chem_storage) diff --git a/code/modules/mob/living/living_defines.dm b/code/modules/mob/living/living_defines.dm index 66aa234e2ca..e1488648731 100644 --- a/code/modules/mob/living/living_defines.dm +++ b/code/modules/mob/living/living_defines.dm @@ -52,5 +52,7 @@ var/list/surgeries = list() //a list of surgery datums. generally empty, they're added when the player wants them. var/gene_stability = DEFAULT_GENE_STABILITY - + var/obj/effect/proc_holder/ranged_ability //Any ranged ability the mob has, as a click override + + var/list/say_log = list() //a log of what we've said, plain text, no spans or junk, essentially just each individual "message" diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm index b0f42e9a8cb..1e34b43e583 100644 --- a/code/modules/mob/living/say.dm +++ b/code/modules/mob/living/say.dm @@ -149,7 +149,7 @@ proc/get_radio_key_from_channel(var/channel) if(speaking && (speaking.flags & HIVEMIND)) speaking.broadcast(src,trim(message)) return 1 - + if(message_mode == "cords") if(iscarbon(src)) var/mob/living/carbon/C = src @@ -282,6 +282,9 @@ proc/get_radio_key_from_channel(var/channel) if(O) //It's possible that it could be deleted in the meantime. O.hear_talk(src, message, verb, speaking) + //Log of what we've said, plain message, no spans or junk + say_log += message + log_say("[name]/[key] : [message]") return 1 From 0816c1c077db58bc1f0197a06485f9be17b2b1cf Mon Sep 17 00:00:00 2001 From: uraniummeltdown Date: Mon, 6 Feb 2017 19:46:08 +0400 Subject: [PATCH 2/2] moved define and changed for loop --- code/game/gamemodes/changeling/changeling.dm | 1 - code/game/gamemodes/changeling/powers/absorb.dm | 14 +++++--------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/code/game/gamemodes/changeling/changeling.dm b/code/game/gamemodes/changeling/changeling.dm index e09d31fa8bb..c25802d38fc 100644 --- a/code/game/gamemodes/changeling/changeling.dm +++ b/code/game/gamemodes/changeling/changeling.dm @@ -1,4 +1,3 @@ -#define LING_ABSORB_RECENT_SPEECH 8 //The amount of recent spoken lines to gain on absorbing a mob var/list/possible_changeling_IDs = list("Alpha","Beta","Gamma","Delta","Epsilon","Zeta","Eta","Theta","Iota","Kappa","Lambda","Mu","Nu","Xi","Omicron","Pi","Rho","Sigma","Tau","Upsilon","Phi","Chi","Psi","Omega") /datum/game_mode diff --git a/code/game/gamemodes/changeling/powers/absorb.dm b/code/game/gamemodes/changeling/powers/absorb.dm index 7d0212a216b..06402a584b7 100644 --- a/code/game/gamemodes/changeling/powers/absorb.dm +++ b/code/game/gamemodes/changeling/powers/absorb.dm @@ -1,3 +1,5 @@ +#define LING_ABSORB_RECENT_SPEECH 8 //The amount of recent spoken lines to gain on absorbing a mob + /obj/effect/proc_holder/changeling/absorbDNA name = "Absorb DNA" desc = "Absorb the DNA of our victim." @@ -26,8 +28,6 @@ var/mob/living/carbon/target = G.affecting return changeling.can_absorb_dna(user,target) - - /obj/effect/proc_holder/changeling/absorbDNA/sting_action(var/mob/user) var/datum/changeling/changeling = user.mind.changeling var/obj/item/weapon/grab/G = user.get_active_hand() @@ -72,10 +72,7 @@ if(target.say_log.len > LING_ABSORB_RECENT_SPEECH) recent_speech = target.say_log.Copy(target.say_log.len-LING_ABSORB_RECENT_SPEECH+1,0) //0 so len-LING_ARS+1 to end of list else - for(var/spoken_memory in target.say_log) - if(recent_speech.len >= LING_ABSORB_RECENT_SPEECH) - break - recent_speech += spoken_memory + recent_speech = target.say_log.Copy() if(recent_speech.len) user.mind.store_memory("Some of [target]'s speech patterns, we should study these to better impersonate them!") @@ -93,7 +90,6 @@ target.mind.changeling.absorbed_dna.len = 1 target.mind.changeling.absorbedcount = 0 - changeling.chem_charges=min(changeling.chem_charges+10, changeling.chem_storage) changeling.isabsorbing = 0 @@ -103,8 +99,6 @@ target.Drain() return 1 - - //Absorbs the target DNA. /datum/changeling/proc/absorb_dna(mob/living/carbon/T, var/mob/user) T.dna.real_name = T.real_name //Set this again, just to be sure that it's properly set. @@ -125,3 +119,5 @@ return absorbed_dna |= new_dna trim_dna() + +#undef LING_ABSORB_RECENT_SPEECH