From 22c6b856bf7d16c41c57d6f155a5cde906a7029b Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Sun, 25 Sep 2022 21:27:06 +0700 Subject: [PATCH] State clear that we need any of items specified in research --- .../kotlin/ru/dbotthepony/mc/otm/datagen/lang/English.kt | 4 ++++ .../ru/dbotthepony/mc/otm/android/AndroidResearch.kt | 9 +++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/English.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/English.kt index 7f2eeeca8..5069aef84 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/English.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/English.kt @@ -462,6 +462,10 @@ private fun research(provider: MatteryLanguageProvider) { add("android_research.status.requires_item", "Requires %s") add("android_research.status.requires_item_multiple0", "Requires %s x%s (missing %s)") add("android_research.status.requires_item_multiple1", "Requires %s x%s") + + add("android_research.status.requires_item_any", "Requires any of %s") + add("android_research.status.requires_item_multiple_any0", "Requires any of %s x%s (missing %s)") + add("android_research.status.requires_item_multiple_any1", "Requires any of %s x%s") } } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/android/AndroidResearch.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/android/AndroidResearch.kt index 2ded4aa6b..8c3d3d037 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/android/AndroidResearch.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/android/AndroidResearch.kt @@ -341,18 +341,19 @@ class AndroidResearch(val type: AndroidResearchType, val capability: MatteryPlay } val chooseItem = tag.items[((System.nanoTime() / 300_000_000L).absoluteValue % tag.items.size).toInt()] + val suffix = if (tag.items.size > 1) "_any" else "" if (required > 0) { if (count == 1) { - builder.add(TranslatableComponent("android_research.status.requires_item", chooseItem.hoverName.copy().withStyle(ChatFormatting.DARK_RED)).withStyle(ChatFormatting.GRAY)) + builder.add(TranslatableComponent("android_research.status.requires_item$suffix", chooseItem.hoverName.copy().withStyle(ChatFormatting.DARK_RED)).withStyle(ChatFormatting.GRAY)) } else { - builder.add(TranslatableComponent("android_research.status.requires_item_multiple0", chooseItem.hoverName.copy().withStyle(ChatFormatting.DARK_RED), TextComponent(count.toString()).withStyle(ChatFormatting.YELLOW), TextComponent(required.toString()).withStyle(ChatFormatting.YELLOW)).withStyle(ChatFormatting.GRAY)) + builder.add(TranslatableComponent("android_research.status.requires_item_multiple${suffix}0", chooseItem.hoverName.copy().withStyle(ChatFormatting.DARK_RED), TextComponent(count.toString()).withStyle(ChatFormatting.YELLOW), TextComponent(required.toString()).withStyle(ChatFormatting.YELLOW)).withStyle(ChatFormatting.GRAY)) } } else { if (count == 1) { - builder.add(TranslatableComponent("android_research.status.requires_item", chooseItem.hoverName.copy().withStyle(ChatFormatting.DARK_GREEN)).withStyle(ChatFormatting.GRAY)) + builder.add(TranslatableComponent("android_research.status.requires_item$suffix", chooseItem.hoverName.copy().withStyle(ChatFormatting.DARK_GREEN)).withStyle(ChatFormatting.GRAY)) } else { - builder.add(TranslatableComponent("android_research.status.requires_item_multiple1", chooseItem.hoverName.copy().withStyle(ChatFormatting.DARK_GREEN), TextComponent(count.toString()).withStyle(ChatFormatting.YELLOW)).withStyle(ChatFormatting.GRAY)) + builder.add(TranslatableComponent("android_research.status.requires_item_multiple${suffix}1", chooseItem.hoverName.copy().withStyle(ChatFormatting.DARK_GREEN), TextComponent(count.toString()).withStyle(ChatFormatting.YELLOW)).withStyle(ChatFormatting.GRAY)) } } }