diff --git a/code/__DEFINES/traits/declarations.dm b/code/__DEFINES/traits/declarations.dm index 3abc095fa7c..bfec16eb732 100644 --- a/code/__DEFINES/traits/declarations.dm +++ b/code/__DEFINES/traits/declarations.dm @@ -528,6 +528,9 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai /// Makes the user handcuff others faster #define TRAIT_FAST_CUFFING "fast_cuffing" +///Given by /obj/item/virgin_mary, mobs that used this can no longer use it again ever +#define TRAIT_MAFIAINITIATE "mafiainitiate" + ///Makes the player appear as their respective job in Binary Talk rather than being a 'Default Cyborg'. #define DISPLAYS_JOB_IN_BINARY "display_job_in_binary" diff --git a/code/_globalvars/traits/_traits.dm b/code/_globalvars/traits/_traits.dm index dfc2838d6fb..f002703942a 100644 --- a/code/_globalvars/traits/_traits.dm +++ b/code/_globalvars/traits/_traits.dm @@ -493,6 +493,7 @@ GLOBAL_LIST_INIT(traits_by_type, list( "TRAIT_XRAY_HEARING" = TRAIT_XRAY_HEARING, "TRAIT_XRAY_VISION" = TRAIT_XRAY_VISION, "TRAIT_DISCO_DANCER" = TRAIT_DISCO_DANCER, + "TRAIT_MAFIAINITIATE" = TRAIT_MAFIAINITIATE, ), /obj/item = list( "TRAIT_APC_SHOCKING" = TRAIT_APC_SHOCKING, diff --git a/code/game/objects/items/virgin_mary.dm b/code/game/objects/items/virgin_mary.dm index a8447e07811..7c3c305858c 100644 --- a/code/game/objects/items/virgin_mary.dm +++ b/code/game/objects/items/virgin_mary.dm @@ -6,42 +6,41 @@ resistance_flags = FLAMMABLE ///Has this item been used already. var/used_up = FALSE - ///List of mobs that have already been mobbed. - var/static/list/mob_mobs = list() #define NICKNAME_CAP (MAX_NAME_LEN/2) -/obj/item/virgin_mary/attackby(obj/item/W, mob/user, params) +/obj/item/virgin_mary/attackby(obj/item/potential_lighter, mob/living/user, params) . = ..() if(resistance_flags & ON_FIRE) return - if(!burn_paper_product_attackby_check(W, user, TRUE)) + if(!istype(user) || !user.mind) //A sentient mob needs to be burning it, ya cheezit. return - if(used_up) - return - if(!isliving(user) || !user.mind) //A sentient mob needs to be burning it, ya cheezit. + + if(HAS_TRAIT(user, TRAIT_MAFIAINITIATE)) //Only one nickname fuckhead + to_chat(user, span_warning("You have already been initiated into the mafioso life.")) return - var/mob/living/joe = user - if(joe in mob_mobs) //Only one nickname fuckhead - to_chat(joe, span_warning("You have already been initiated into the mafioso life.")) + if(!burn_paper_product_attackby_check(potential_lighter, user, TRUE)) + return + if(used_up) return - to_chat(joe, span_notice("As you burn the picture, a nickname comes to mind...")) - var/nickname = tgui_input_text(joe, "Pick a nickname", "Mafioso Nicknames", max_length = NICKNAME_CAP) + ADD_TRAIT(user, TRAIT_MAFIAINITIATE, TRAIT_GENERIC) // Adding the trait early because you could burn multiple at once for a very long name + to_chat(user, span_notice("As you burn the picture, a nickname comes to mind...")) + var/nickname = tgui_input_text(user, "Pick a nickname", "Mafioso Nicknames", max_length = NICKNAME_CAP) nickname = reject_bad_name(nickname, allow_numbers = FALSE, max_length = NICKNAME_CAP, ascii_only = TRUE) if(!nickname) + REMOVE_TRAIT(user, TRAIT_MAFIAINITIATE, TRAIT_GENERIC) return var/new_name - var/space_position = findtext(joe.real_name, " ") + var/space_position = findtext(user.real_name, " ") if(space_position)//Can we find a space? - new_name = "[copytext(joe.real_name, 1, space_position)] \"[nickname]\" [copytext(joe.real_name, space_position)]" + new_name = "[copytext(user.real_name, 1, space_position)] \"[nickname]\" [copytext(user.real_name, space_position)]" else //Append otherwise - new_name = "[joe.real_name] \"[nickname]\"" - joe.real_name = new_name + new_name = "[user.real_name] \"[nickname]\"" + user.real_name = new_name used_up = TRUE - mob_mobs += joe - joe.say("My soul will burn like this saint if I betray my family. I enter alive and I will have to get out dead.", forced = /obj/item/virgin_mary) - to_chat(joe, span_userdanger("Being inducted into the mafia does not grant antagonist status.")) + user.say("My soul will burn like this saint if I betray my family. I enter alive and I will have to get out dead.", forced = /obj/item/virgin_mary) + to_chat(user, span_userdanger("Being inducted into the mafia does not grant antagonist status.")) #undef NICKNAME_CAP