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>
57 lines
2.5 KiB
C#
57 lines
2.5 KiB
C#
using UnityEngine;
|
|
|
|
namespace RacesOfValheim
|
|
{
|
|
/// <summary>
|
|
/// The Cursed Claws: the flesh rippers, worn exactly as the game authored them.
|
|
///
|
|
/// 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 Fenrir's half: which model, and when
|
|
/// the race is currently a wolf.
|
|
///
|
|
/// No tint. The fenrir claw already looks like something a Fenrir would grow, which is the
|
|
/// whole reason it is the one being borrowed.
|
|
/// </summary>
|
|
public class FenrirClaws : RaceClawSet
|
|
{
|
|
public static readonly FenrirClaws Instance = new FenrirClaws();
|
|
|
|
public override string RaceId => "Fenrir";
|
|
public override string ItemName => "FenrirCursedClaws";
|
|
public override string DisplayName => "$rov_item_fenrir_claws_name";
|
|
public override string Description => "$rov_item_fenrir_claws_desc";
|
|
|
|
public override string[] ModelPrefabs => new[]
|
|
{
|
|
"FistFenrirClaw",
|
|
"FistFenrirClaw_Undead",
|
|
"FenrirClaw",
|
|
};
|
|
|
|
// The Fenrir publishes no per-tier state of its own, so the damage falls back to the local
|
|
// player's progression. That is right for the player at the keyboard and approximate for
|
|
// somebody else's claws on a shared world - the same compromise the Sverm makes, and the
|
|
// fix if it ever matters is a state key in FenrirRace, not a change here.
|
|
|
|
/// <summary>
|
|
/// A wolf swings its own jaws, and FenrirFormBehavior does that damage itself. The ZDO
|
|
/// carries the form for everyone; the status effect is the local player's own copy of the
|
|
/// same fact, checked second so a form that has begun but not yet replicated still counts.
|
|
/// </summary>
|
|
public override bool IsTransformed(Player player)
|
|
{
|
|
if (player == null) return false;
|
|
|
|
ZNetView nview = player.GetComponent<ZNetView>();
|
|
if (nview != null && nview.IsValid())
|
|
{
|
|
if (!string.IsNullOrEmpty(nview.GetZDO().GetString("RacesOfValheim_FenrirForm", ""))) return true;
|
|
}
|
|
|
|
return player == Player.m_localPlayer &&
|
|
player.GetSEMan() != null &&
|
|
player.GetSEMan().HaveStatusEffect("SE_FenrirForm".GetStableHashCode());
|
|
}
|
|
}
|
|
}
|