feat(text): merchants, troops and the hive's shelf come from translation files
The faction merchants' 90 jokes, their generic lines and their names now read from merchants.json. Merchant names use the game's own creature tokens where one matches, so they arrive translated in every language Valheim ships; the Dverg keeps a key of its own, since vanilla's token reads "Dvergr Rogue". The Dvergar and Trol troop names and terms, and the Sverm hive's goods, refusals, stage names and brood kinds, follow. Their panels fill TMP texts themselves, so they localize the names where they draw them. The jokes have English text only for now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
594b333f68
commit
1bd09ed31d
13 changed files with 332 additions and 167 deletions
|
|
@ -68,13 +68,11 @@ namespace RacesOfValheim
|
|||
StageUpgrade(3, "TrophySeekerBrute"),
|
||||
StageUpgrade(4, "TrophySeekerQueen"),
|
||||
|
||||
Star(1, "Surrenal Glands", 800f, "TrophySeeker",
|
||||
"Every troop hatched from now on is born with one star.\n\n" +
|
||||
"It does nothing for the ones already walking around: what is born is born."),
|
||||
Star(1, ModText.Get("rov_sverm_good_glands_name"), 800f, "TrophySeeker",
|
||||
ModText.Get("rov_sverm_good_glands_desc")),
|
||||
|
||||
Star(2, "Hyperplasia", 1600f, "TrophySeekerQueen",
|
||||
"Every troop hatched from now on is born with two stars.\n\n" +
|
||||
"The colony has to have grown the glands first."),
|
||||
Star(2, ModText.Get("rov_sverm_good_hyperplasia_name"), 1600f, "TrophySeekerQueen",
|
||||
ModText.Get("rov_sverm_good_hyperplasia_desc")),
|
||||
};
|
||||
|
||||
foreach (SvermBrood.Kind kind in SvermBrood.Roster) shelf.Add(Troop(kind));
|
||||
|
|
@ -94,23 +92,20 @@ namespace RacesOfValheim
|
|||
return new Good
|
||||
{
|
||||
Id = "blistertick",
|
||||
Name = SvermBlisterTick.DisplayName,
|
||||
Name = Localization.instance.Localize(SvermBlisterTick.DisplayName),
|
||||
Price = SvermConfig.TickPrice,
|
||||
Icon = "TrophyTick",
|
||||
Description = "Buys a PERMANENT slot in the colony. What stands in it runs at whatever " +
|
||||
"the colony is fighting and bursts, and thirty seconds later the nest " +
|
||||
"grows another one - no egg, no biomass, forever.\n\n" +
|
||||
"The blast spares you, your tames and the rest of the colony.",
|
||||
Description = ModText.Get("rov_sverm_good_tick_desc"),
|
||||
|
||||
Refusal = hive =>
|
||||
{
|
||||
int slots = SvermBlisterTick.SlotsOf(hive.transform);
|
||||
if (slots >= SvermConfigManagement.BlisterTick)
|
||||
{
|
||||
return $"The colony already keeps {slots} of them.";
|
||||
return ModText.Get("rov_sverm_refusal_keeps", slots);
|
||||
}
|
||||
|
||||
if (SvermBroodEggs.Count(hive.transform) < 1) return "No brood egg ready.";
|
||||
if (SvermBroodEggs.Count(hive.transform) < 1) return ModText.Get("rov_sverm_refusal_no_egg");
|
||||
|
||||
return null;
|
||||
},
|
||||
|
|
@ -143,20 +138,17 @@ namespace RacesOfValheim
|
|||
return new Good
|
||||
{
|
||||
Id = "stage" + target,
|
||||
Name = SvermHiveStage.NameOf(target),
|
||||
Name = Localization.instance.Localize(SvermHiveStage.NameOf(target)),
|
||||
Price = SvermHiveStage.PriceToLeave(from),
|
||||
Icon = icon,
|
||||
Description = $"Grows the nest into a {SvermHiveStage.NameOf(target)}: it holds " +
|
||||
$"{SvermHiveStage.Capacity(target):0} biomass instead of " +
|
||||
$"{SvermHiveStage.Capacity(from):0}, and stands half again as tall.\n\n" +
|
||||
"It costs this stage's whole tankful, so it leaves the hive all but " +
|
||||
"empty. Grow or field an army - never both in the same breath.",
|
||||
Description = ModText.Get("rov_sverm_good_stage_desc", SvermHiveStage.NameOf(target),
|
||||
SvermHiveStage.Capacity(target).ToString("0"), SvermHiveStage.Capacity(from).ToString("0")),
|
||||
|
||||
Refusal = hive =>
|
||||
{
|
||||
int stage = SvermHiveStage.Of(hive.transform);
|
||||
if (stage > from) return "Already grown past this.";
|
||||
if (stage < from) return $"The nest has to be a {SvermHiveStage.NameOf(from)} first.";
|
||||
if (stage > from) return ModText.Get("rov_sverm_refusal_grown_past");
|
||||
if (stage < from) return ModText.Get("rov_sverm_refusal_stage_first", SvermHiveStage.NameOf(from));
|
||||
return null;
|
||||
},
|
||||
|
||||
|
|
@ -187,8 +179,8 @@ namespace RacesOfValheim
|
|||
Refusal = hive =>
|
||||
{
|
||||
int have = SvermBroodStars.Of(hive.transform);
|
||||
if (have >= stars) return "The colony already breeds like this.";
|
||||
if (have < stars - 1) return "One star at a time.";
|
||||
if (have >= stars) return ModText.Get("rov_sverm_refusal_already_breeds");
|
||||
if (have < stars - 1) return ModText.Get("rov_sverm_refusal_one_star");
|
||||
return null;
|
||||
},
|
||||
|
||||
|
|
@ -208,25 +200,23 @@ namespace RacesOfValheim
|
|||
return new Good
|
||||
{
|
||||
Id = "troop_" + kind.Id,
|
||||
Name = kind.Display,
|
||||
Name = Localization.instance.Localize(kind.Display),
|
||||
Price = kind.Price,
|
||||
Icon = kind.Icon,
|
||||
Description = $"Hatches a {kind.Display}, bound to this nest: it follows when you ask, " +
|
||||
$"walks home when you let it go, and mends itself.\n\n" +
|
||||
$"Costs one brood egg as well as the biomass. At most {kind.Cap} of them alive at once.",
|
||||
Description = ModText.Get("rov_sverm_good_troop_desc", kind.Display, kind.Cap),
|
||||
|
||||
Refusal = hive =>
|
||||
{
|
||||
int stage = SvermHiveStage.Of(hive.transform);
|
||||
if (stage < kind.Stage)
|
||||
{
|
||||
return $"The nest has to be a {SvermHiveStage.NameOf(kind.Stage)} first.";
|
||||
return ModText.Get("rov_sverm_refusal_stage_first", SvermHiveStage.NameOf(kind.Stage));
|
||||
}
|
||||
|
||||
int alive = SvermBrood.CountAlive(hive, kind);
|
||||
if (alive >= kind.Cap) return $"The colony is already keeping {alive} of them.";
|
||||
if (alive >= kind.Cap) return ModText.Get("rov_sverm_refusal_keeping", alive);
|
||||
|
||||
if (SvermBroodEggs.Count(hive.transform) < 1) return "No brood egg ready.";
|
||||
if (SvermBroodEggs.Count(hive.transform) < 1) return ModText.Get("rov_sverm_refusal_no_egg");
|
||||
|
||||
return null;
|
||||
},
|
||||
|
|
@ -265,7 +255,7 @@ namespace RacesOfValheim
|
|||
/// </summary>
|
||||
public static string RefusalFor(Good good, SvermHiveBehaviour hive)
|
||||
{
|
||||
if (good == null || hive == null) return "No hive.";
|
||||
if (good == null || hive == null) return ModText.Get("rov_sverm_refusal_no_hive");
|
||||
|
||||
string ownRefusal = good.Refusal != null ? good.Refusal(hive) : null;
|
||||
if (ownRefusal != null) return ownRefusal;
|
||||
|
|
@ -274,11 +264,11 @@ namespace RacesOfValheim
|
|||
if (waitingSeconds > 0L)
|
||||
{
|
||||
return waitingSeconds >= 60L
|
||||
? $"The hive is still working on the last one ({waitingSeconds / 60}m)."
|
||||
: $"The hive is still working on the last one ({waitingSeconds}s).";
|
||||
? ModText.Get("rov_sverm_refusal_working_m", waitingSeconds / 60)
|
||||
: ModText.Get("rov_sverm_refusal_working_s", waitingSeconds);
|
||||
}
|
||||
|
||||
if (SvermBiomass.Bank(hive.transform) < good.Price) return "Not enough biomass in the bank.";
|
||||
if (SvermBiomass.Bank(hive.transform) < good.Price) return ModText.Get("rov_msg_sverm_not_enough_biomass_bank");
|
||||
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue