From ade5529b04042e8ff93fa7ed9c87c7d51149f498 Mon Sep 17 00:00:00 2001 From: XDTM Date: Thu, 26 Jan 2017 15:17:12 +0100 Subject: [PATCH] [Ready for review/merge]Adds some new voice of god commands, allows first-name focusing (#23169) * New commands! * helper * replacements * regexes left and right * someone might actually refer to medical doctors with the full name * Cooldowns first --- code/_onclick/click.dm | 2 +- code/game/gamemodes/wizard/artefact.dm | 12 +- code/modules/jobs/jobs.dm | 35 ++++- code/modules/mob/mob_helpers.dm | 15 ++ code/modules/surgery/organs/vocal_cords.dm | 172 +++++++++++++++------ 5 files changed, 174 insertions(+), 62 deletions(-) diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index 7e9e07055e0..9cc04f1d513 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -53,7 +53,7 @@ return next_click = world.time + 1 - if(client.click_intercept) + if(client && client.click_intercept) if(call(client.click_intercept, "InterceptClickOn")(src, params, A)) return diff --git a/code/game/gamemodes/wizard/artefact.dm b/code/game/gamemodes/wizard/artefact.dm index 5c40f147b31..580de6de3c3 100644 --- a/code/game/gamemodes/wizard/artefact.dm +++ b/code/game/gamemodes/wizard/artefact.dm @@ -520,16 +520,8 @@ var/global/list/multiverse = list() var/turf/T = get_step(target,pick(cardinal)) target.Move(T) if("r_arm","l_arm") - //use active hand on random nearby mob - var/list/nearby_mobs = list() - for(var/mob/living/L in range(1, target)) - if(L!=target) - nearby_mobs |= L - if(nearby_mobs.len) - var/mob/living/T = pick(nearby_mobs) - log_game("[user][user.key] made [target][target.key] click on [T] with a voodoo doll.") - target.ClickOn(T) - GiveHint(target) + target.click_random_mob() + GiveHint(target) if("head") user << "You smack the doll's head with your hand." target.Dizzy(10) diff --git a/code/modules/jobs/jobs.dm b/code/modules/jobs/jobs.dm index e47d66df179..454f7e51094 100644 --- a/code/modules/jobs/jobs.dm +++ b/code/modules/jobs/jobs.dm @@ -136,4 +136,37 @@ var/list/nonhuman_positions = list( for(var/datum/job/J in SSjob.occupations) if(J.title == job_title) - return J.department_head //this is a list \ No newline at end of file + return J.department_head //this is a list + +var/static/regex/cap_expand = new("cap(?!tain)") +var/static/regex/cmo_expand = new("cmo") +var/static/regex/hos_expand = new("hos") +var/static/regex/hop_expand = new("hop") +var/static/regex/rd_expand = new("rd") +var/static/regex/ce_expand = new("ce") +var/static/regex/qm_expand = new("qm") +var/static/regex/sec_expand = new("(?