feat(furling): the five crops

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Ferdinando 2026-08-07 17:02:48 +02:00
commit e8a0bff0a6
3 changed files with 589 additions and 18 deletions

View file

@ -22,15 +22,32 @@ namespace RacesOfValheim
}
}
/// <summary>
/// Reads the race the same way every other race in the mod reads it.
///
/// This used to be `GetPlayerModel() == 5`, with a comment admitting the 5 was assumed.
/// GetPlayerModel returns the character's BODY MODEL index - 0 or 1, male or female, the
/// thing PlayerCustomizaton.SetPlayerModel writes - and has nothing to do with the race,
/// which SelectFurling stores in m_customData["Race"]. So it never returned true, and
/// everything gated behind it was dead code: the -19% visual scale, the +10% run speed, the
/// truce with the Fuling camps, and Through Fire and Flames.
/// </summary>
public static bool IsFurling()
{
return Player.m_localPlayer != null && Player.m_localPlayer.GetPlayerModel() == 5; // Assumed ID for Furling
return Player.m_localPlayer != null &&
Player.m_localPlayer.m_customData.ContainsKey("Race") &&
Player.m_localPlayer.m_customData["Race"] == "Furling";
}
public void CreateModAssets()
{
Jotunn.Logger.LogInfo("Initializing Furling Race...");
FurlingStatusEffects.RegisterStatusEffects();
// The metal flax and the rock berries. Registered here because the faction merchant
// catalogue resolves its entries by prefab name, so the five items have to exist before
// a Shaman is ever set up as a bench.
FurlingCrops.Register();
}
private void Update()