diff --git a/indra/newview/chatbar_as_cmdline.cpp b/indra/newview/chatbar_as_cmdline.cpp index 2e4cd5e674..7e3efe9626 100644 --- a/indra/newview/chatbar_as_cmdline.cpp +++ b/indra/newview/chatbar_as_cmdline.cpp @@ -1229,8 +1229,9 @@ bool cmd_line_chat(const std::string& revised_text, EChatType type, bool from_ge if (i >> modifier_type && i >> modifier) { - // 2d20+5, 2d20-5 / 2d20>5, 2d20<5 / 2d20!>5, 2d20!<5, 2d20!5 / 2d20r>5, 2d20r<5, 2d20r5 - if (modifier < -1000 || modifier > 1000 || (modifier_type != "+" && modifier_type != "-" && modifier_type != "<" && modifier_type != ">" && modifier_type != "!>" && modifier_type != "!<" && modifier_type != "!" && modifier_type != "r" && modifier_type != "r>" && modifier_type != "r<")) + // 2d20+5, 2d20-5 / 2d20>5, 2d20<5 / 2d20!>5, 2d20!<5, 2d20!5 / 2d20!p>5, 2d20!p<5, 2d20!p5 / 2d20r>5, 2d20r<5, 2d20r5 + LLStringUtil::toLower(modifier_type); + if (modifier < -1000 || modifier > 1000 || (modifier_type != "+" && modifier_type != "-" && modifier_type != "<" && modifier_type != ">" && modifier_type != "!>" && modifier_type != "!<" && modifier_type != "!" && modifier_type != "!p" && modifier_type != "!p>" && modifier_type != "!p<" && modifier_type != "r" && modifier_type != "r>" && modifier_type != "r<")) { modifier_error = 1; } @@ -1252,17 +1253,23 @@ bool cmd_line_chat(const std::string& revised_text, EChatType type, bool from_ge S32 result_per_die = 0; S32 die_iter = 1; S32 freeze_guard = 0; + S32 die_penetrated = 0; while (die_iter <= dice) { // Each die may have a different value rolled result_per_die = 1 + (rand() % faces); - result += result_per_die; - if (dice > 1) + if (die_penetrated == 1) + { + result_per_die -= 1; + die_penetrated = 0; + reportToNearbyChat(llformat("#%d 1d%d-1: %d.", die_iter, faces, result_per_die)); + } + else { - // For more than one die show the ordinal number in front of the result reportToNearbyChat(llformat("#%d 1d%d: %d.", die_iter, faces, result_per_die)); } + result += result_per_die; ++die_iter; if (modifier_type == "<") @@ -1297,6 +1304,13 @@ bool cmd_line_chat(const std::string& revised_text, EChatType type, bool from_ge reportToNearbyChat(" ^-- " + LLTrans::getString("FSCmdLineRollDiceExploded")); --die_iter; } + else if ((modifier_type == "!p" && result_per_die == modifier) || (modifier_type == "!p>" && result_per_die >= modifier) || (modifier_type == "!p<" && result_per_die <= modifier)) + { + // Modifier: Penetrating dice (special style of exploding dice) + reportToNearbyChat(" ^-- " + LLTrans::getString("FSCmdLineRollDicePenetrated")); + die_penetrated = 1; + --die_iter; + } else if ((modifier_type == "r" && result_per_die == modifier) || (modifier_type == "r>" && result_per_die >= modifier) || (modifier_type == "r<" && result_per_die <= modifier)) { // Modifier: Reroll diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index a3519824a9..feb9c67419 100755 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -2597,8 +2597,9 @@ Try enclosing path to the editor with double quotes. Total result for [DICE]d[FACES][MODIFIER]: [RESULT]. You must provide positive values for dice (max 100) and faces (max 1000). - If you want to use a modifier, then you must provide valid modifier number and the type of modifier. Modifier must be in range from -1000 to 1000. Valid modifier types are "+" (bonuses), "-" (penalties), ">", "<" (successes), "r>", "r<", "r" (rerolls), "!>", "!<" and "!" (explosions). You can use only one modifier type per roll. Examples: "[COMMAND] 1 20 + 5", "[COMMAND] 5 40 > 15", "[COMMAND] 10 25 ! 25", "[COMMAND] 15 25 !< 10". + If you want to use a modifier, then you must provide valid modifier number and the type of modifier. Modifier must be in range from -1000 to 1000. Valid modifier types are "+" (bonuses), "-" (penalties), ">", "<" (successes), "r>", "r<", "r" (rerolls), "!p>", "!p<", "!p" (penetrations), "!>", "!<" and "!" (explosions). You can use only one modifier type per roll. Examples: "[COMMAND] 1 20 + 5", "[COMMAND] 5 40 > 15", "[COMMAND] 10 25 ! 25", "[COMMAND] 15 25 !< 10". Exploded + Penetrated Success Reroll This operation cannot be completed because the viewer would freeze in an infinite rolling loop. Please change the criteria. diff --git a/indra/newview/skins/default/xui/pl/strings.xml b/indra/newview/skins/default/xui/pl/strings.xml index c4b6826993..d8990fafb1 100755 --- a/indra/newview/skins/default/xui/pl/strings.xml +++ b/indra/newview/skins/default/xui/pl/strings.xml @@ -5217,11 +5217,14 @@ Spróbuj załączyć ścieżkę do edytora w cytowaniu. Musisz podać wartości dodatnie dla ilości kostek (maksymalnie 100) oraz ścianek (maksymalnie 1000). - Jeśli chcesz użyć modyfikatora, to musisz podać właściwą jego liczbę oraz typ. Wartość modyfikatora musi być w zakresie od -1000 do 1000. Prawidłowe typy modyfikatorów to "+" (premie), "-" (kary), ">", "<" (sukcesy), "r>", "r<", "r" (ponowne rzuty), "!>", "!<" oraz "!" (eksplozje). Możesz jednocześnie użyć tylko jednego typu modyfikatora. Przykłady: "[COMMAND] 1 20 + 5", "[COMMAND] 5 40 > 15", "[COMMAND] 10 25 ! 25", "[COMMAND] 15 25 !< 10". + Jeśli chcesz użyć modyfikatora, to musisz podać właściwą jego liczbę oraz typ. Wartość modyfikatora musi być w zakresie od -1000 do 1000. Prawidłowe typy modyfikatorów to "+" (premie), "-" (kary), ">", "<" (sukcesy), "r>", "r<", "r" (ponowne rzuty), "!p>", "!p<", "!p" (penetracje), "!>", "!<" oraz "!" (eksplozje). Możesz jednocześnie użyć tylko jednego typu modyfikatora. Przykłady: "[COMMAND] 1 20 + 5", "[COMMAND] 5 40 > 15", "[COMMAND] 10 25 ! 25", "[COMMAND] 15 25 !< 10". Eksplozja + + Penetracja + Sukces