The mod's own items, build pieces and summoned creatures now carry $rov_item_, $rov_piece_ and $rov_creature_ tokens for their names and descriptions, and items.json holds the texts in English and Italian. Valheim localizes these fields wherever it shows them: tooltips, hover texts, messages, the build menu. Where a name doubles as an identifier, both sides use the same constant, so the comparisons still hold. The Aswid foods keep their prefix as a constant for the refinery's check and now name the creature with its vanilla token, so "Boar" translates too. The Furling crops get one whole description per crop instead of an English sentence with the metal dropped in. The Race Menu Ward's panel title is a mod UI Text, so it reads the translation directly. Saves are unaffected: items and eaten foods are stored by prefab name. The Sverm hive's goods stay for the merchant step. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
70 lines
2.9 KiB
C#
70 lines
2.9 KiB
C#
using UnityEngine;
|
|
|
|
namespace RacesOfValheim
|
|
{
|
|
/// <summary>
|
|
/// The Claws of the Beast: the Bjorn claw, burned down to almost black.
|
|
///
|
|
/// Everything about how they behave - a timed skill (RaceClawsConfig.ActivateKey), issued and
|
|
/// retracted on its own, back in hand the moment the hands are free while it runs, tier damage
|
|
/// as slash - lives in RaceClawSet. This file is only the Aswid's half of the answer: which
|
|
/// model, what colour, and when the race is wearing another body.
|
|
///
|
|
/// The tint is config rather than a constant because "almost black" is a look, not a number,
|
|
/// and it needs one pass in front of a mirror. It is applied to the item's own copies of the
|
|
/// model's materials, so the vanilla weapon is untouched for everyone else.
|
|
/// </summary>
|
|
public class AswidClaws : RaceClawSet
|
|
{
|
|
public static readonly AswidClaws Instance = new AswidClaws();
|
|
|
|
public override string RaceId => "Aswid";
|
|
public override string ItemName => "AswidBeastClaws";
|
|
public override string DisplayName => "$rov_item_aswid_claws_name";
|
|
public override string Description => "$rov_item_aswid_claws_desc";
|
|
|
|
// The Bjorn claw first, by name, because that is the one this race is meant to wear. The
|
|
// rest are the near-identical ids the manifest also carries - see SvermConfig's own
|
|
// fallback list for why a single name is not trusted here.
|
|
public override string[] ModelPrefabs => new[]
|
|
{
|
|
"FistBjornClaw",
|
|
"FistBjornUndeadClaw",
|
|
"FistBjornClawUndead",
|
|
"FistUnbjornClaw",
|
|
};
|
|
|
|
/// <summary>Published by AswidRace.UpdateAswidState, so a remote Aswid claws at its own tier.</summary>
|
|
public override string StateZdoKey => "RacesOfValheim_AswidState";
|
|
|
|
public override Color? Tint => new Color(
|
|
AswidConfig.ClawTintRed.Value,
|
|
AswidConfig.ClawTintGreen.Value,
|
|
AswidConfig.ClawTintBlue.Value,
|
|
1f);
|
|
|
|
/// <summary>
|
|
/// A bat and a bank of mist have no hands. IsTransformed is the local player's own flag;
|
|
/// the two ZDO booleans are how AswidPatches already publishes the same thing for everyone
|
|
/// else, which is what makes this answer correctly for a remote attacker.
|
|
/// </summary>
|
|
public override bool IsTransformed(Player player)
|
|
{
|
|
if (player == null) return false;
|
|
|
|
if (player == Player.m_localPlayer && AswidRace.Instance != null && AswidRace.Instance.IsTransformed)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
ZNetView nview = player.GetComponent<ZNetView>();
|
|
if (nview != null && nview.IsValid())
|
|
{
|
|
return nview.GetZDO().GetBool("Aswid_IsBatForm", false) ||
|
|
nview.GetZDO().GetBool("Aswid_IsMistForm", false);
|
|
}
|
|
|
|
return false;
|
|
}
|
|
}
|
|
}
|