From 1628934b9f5e5c36dee7819d8a42a4a05a328d0a Mon Sep 17 00:00:00 2001 From: Ghom <42542238+Ghommie@users.noreply.github.com> Date: Thu, 13 Feb 2020 18:00:12 +0100 Subject: [PATCH 1/3] Update cards_ids.dm --- code/game/objects/items/cards_ids.dm | 54 ++++++++++++++++++++-------- 1 file changed, 40 insertions(+), 14 deletions(-) diff --git a/code/game/objects/items/cards_ids.dm b/code/game/objects/items/cards_ids.dm index f40b7f5c49..2bb5234b30 100644 --- a/code/game/objects/items/cards_ids.dm +++ b/code/game/objects/items/cards_ids.dm @@ -265,26 +265,52 @@ update_label("John Doe", "Clowny") var/obj/item/card/id/I = O src.access |= I.access if(isliving(user) && user.mind) - if(user.mind.special_role) + if(user.mind.special_role || anyone) to_chat(usr, "The card's microscanners activate as you pass it over the ID, copying its access.") /obj/item/card/id/syndicate/attack_self(mob/user) if(isliving(user) && user.mind) - if(user.mind.special_role || anyone) - if(alert(user, "Action", "Agent ID", "Show", "Forge") == "Forge") - var/input_name = reject_bad_name(stripped_input(user, "What name would you like to put on this card?", "Agent card name", registered_name ? registered_name : (ishuman(user) ? user.real_name : user.name), MAX_NAME_LEN), TRUE) - if(!input_name) - return + var/first_use = registered_name ? FALSE : TRUE + if(!(user.mind.special_role || anyone)) //Unless anyone is allowed, only syndies can use the card, to stop metagaming. + if(first_use) //If a non-syndie is the first to forge an unassigned agent ID, then anyone can forge it. + anyone = TRUE + else + return ..() - var/u = stripped_input(user, "What occupation would you like to put on this card?\nNote: This will not grant any access levels other than Maintenance.", "Agent card job assignment", "Assistant", MAX_MESSAGE_LEN) - if(!u) - registered_name = "" - return - assignment = u - update_label() - to_chat(user, "You successfully forge the ID card.") + var/popup_input = alert(user, "Choose Action", "Agent ID", "Show", "Forge/Reset") + if(user.incapacitated()) + return + if(popup_input == "Forge/Reset" && !forged) + var/input_name = stripped_input(user, "What name would you like to put on this card? Leave blank to randomise.", "Agent card name", registered_name ? registered_name : (ishuman(user) ? user.real_name : user.name), MAX_NAME_LEN) + input_name = reject_bad_name(input_name) + if(!input_name) + // Invalid/blank names give a randomly generated one. + if(user.gender == MALE) + input_name = "[pick(GLOB.first_names_male)] [pick(GLOB.last_names)]" + else if(user.gender == FEMALE) + input_name = "[pick(GLOB.first_names_female)] [pick(GLOB.last_names)]" + else + input_name = "[pick(GLOB.first_names)] [pick(GLOB.last_names)]" + + var/target_occupation = stripped_input(user, "What occupation would you like to put on this card?\nNote: This will not grant any access levels other than Maintenance.", "Agent card job assignment", assignment ? assignment : "Assistant", MAX_MESSAGE_LEN) + if(!target_occupation) return - ..() + registered_name = input_name + assignment = target_occupation + update_label() + forged = TRUE + to_chat(user, "You successfully forge the ID card.") + log_game("[key_name(user)] has forged \the [initial(name)] with name \"[registered_name]\" and occupation \"[assignment]\".") + return + else if (popup_input == "Forge/Reset" && forged) + registered_name = initial(registered_name) + assignment = initial(assignment) + log_game("[key_name(user)] has reset \the [initial(name)] named \"[src]\" to default.") + update_label() + forged = FALSE + to_chat(user, "You successfully reset the ID card.") + return + return ..() /obj/item/card/id/syndicate/anyone anyone = TRUE From bcc7949034f5546dcfc47735bbddee4eaba5b8b4 Mon Sep 17 00:00:00 2001 From: Ghom <42542238+Ghommie@users.noreply.github.com> Date: Thu, 13 Feb 2020 18:02:42 +0100 Subject: [PATCH 2/3] Update names.dm --- code/_globalvars/lists/names.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/_globalvars/lists/names.dm b/code/_globalvars/lists/names.dm index 7ae197a5d1..e334d08040 100644 --- a/code/_globalvars/lists/names.dm +++ b/code/_globalvars/lists/names.dm @@ -4,6 +4,7 @@ GLOBAL_LIST_INIT(wizard_second, world.file2list("strings/names/wizardsecond.txt" GLOBAL_LIST_INIT(ninja_titles, world.file2list("strings/names/ninjatitle.txt")) GLOBAL_LIST_INIT(ninja_names, world.file2list("strings/names/ninjaname.txt")) GLOBAL_LIST_INIT(commando_names, world.file2list("strings/names/death_commando.txt")) +GLOBAL_LIST_INIT(first_names, world.file2list("strings/names/first.txt")) GLOBAL_LIST_INIT(first_names_male, world.file2list("strings/names/first_male.txt")) GLOBAL_LIST_INIT(first_names_female, world.file2list("strings/names/first_female.txt")) GLOBAL_LIST_INIT(last_names, world.file2list("strings/names/last.txt")) From 071c3a143fa77d7d9d65b8428afe24a7a1afd946 Mon Sep 17 00:00:00 2001 From: Ghom <42542238+Ghommie@users.noreply.github.com> Date: Thu, 13 Feb 2020 18:13:14 +0100 Subject: [PATCH 3/3] Update cards_ids.dm --- code/game/objects/items/cards_ids.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/game/objects/items/cards_ids.dm b/code/game/objects/items/cards_ids.dm index 2bb5234b30..4de3e4ff96 100644 --- a/code/game/objects/items/cards_ids.dm +++ b/code/game/objects/items/cards_ids.dm @@ -250,6 +250,7 @@ update_label("John Doe", "Clowny") name = "agent card" access = list(ACCESS_MAINT_TUNNELS, ACCESS_SYNDICATE) var/anyone = FALSE //Can anyone forge the ID or just syndicate? + var/forged = FALSE //have we set a custom name and job assignment, or will we use what we're given when we chameleon change? /obj/item/card/id/syndicate/Initialize() . = ..()