diff --git a/code/__HELPERS/text.dm b/code/__HELPERS/text.dm index 6c28a1262d..a840d6144a 100644 --- a/code/__HELPERS/text.dm +++ b/code/__HELPERS/text.dm @@ -734,3 +734,36 @@ GLOBAL_LIST_INIT(binary, list("0","1")) . = base if(rest) . += .(rest) + +//Replacement for the \th macro when you want the whole word output as text (first instead of 1st) +/proc/thtotext(number) + if(!isnum(number)) + return + switch(number) + if(1) + return "first" + if(2) + return "second" + if(3) + return "third" + if(4) + return "fourth" + if(5) + return "fifth" + if(6) + return "sixth" + if(7) + return "seventh" + if(8) + return "eighth" + if(9) + return "ninth" + if(10) + return "tenth" + if(11) + return "eleventh" + if(12) + return "twelfth" + else + return "[number]\th" + \ No newline at end of file diff --git a/code/game/objects/items/grenades/chem_grenade.dm b/code/game/objects/items/grenades/chem_grenade.dm index a127201e41..f2daf58b1a 100644 --- a/code/game/objects/items/grenades/chem_grenade.dm +++ b/code/game/objects/items/grenades/chem_grenade.dm @@ -27,6 +27,18 @@ /obj/item/grenade/chem_grenade/examine(mob/user) display_timer = (stage == READY && !nadeassembly) //show/hide the timer based on assembly state ..() + if(user.can_see_reagents()) + var/count = 0 + if(beakers.len) + to_chat(user, "You scan the grenade and detect the following reagents:") + for(var/obj/item/reagent_containers/glass/G in beakers) + var/textcount = thtotext(++count) + for(var/datum/reagent/R in G.reagents.reagent_list) + to_chat(user, "[R.volume] units of [R.name] in the [textcount] beaker.") + if(beakers.len == 1) + to_chat(user, "You detect no second beaker in the grenade.") + else + to_chat(user, "You scan the grenade, but detect nothing.") /obj/item/grenade/chem_grenade/attack_self(mob/user)