feat(alfar): v1.6.0 - the Alfar, an eleventh race

Grey, tall and thin, with black eyes. Eitr is armour and fuel (shield,
diet, soft fall, levitation), Heimkall sends a lethal blow home at one
health every 20 minutes. Caster powers from Skrid to the archon
Sameining, with on-screen cooldowns. Automated base around the
Ljoskjarne: drones, three constructs, crystals, Ljosgard, Prismavard.
Compendium page in EN/IT/RU.

README: New in block, race section, progression, station line, changelog.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Ferdinando 2026-10-25 17:38:28 +01:00
commit 3f8cf1ee27
48 changed files with 7779 additions and 16 deletions

View file

@ -16,7 +16,7 @@ namespace RacesOfValheim
{
public const string PluginGUID = "com.nandor.racesofvalheim";
public const string PluginName = "Races Of Valheim";
public const string PluginVersion = "1.5.15";
public const string PluginVersion = "1.6.0";
private readonly Harmony harmony = new Harmony(PluginGUID);
@ -28,6 +28,9 @@ namespace RacesOfValheim
// Bound in alphabetical order by race, since Configuration Manager's category list
// follows bind order rather than sorting itself - confirmed from the Skadi/Aswid
// ordering in-game. Keep new races' Bind() calls slotted in alphabetically here.
AlfarConfig.Bind(Config);
AlfarPowerConfig.Bind(Config);
AlfarNexusConfig.Bind(Config);
AswidConfig.Bind(Config);
DraughConfig.Bind(Config);
DvergarConfigManagement.Bind(Config);
@ -80,6 +83,11 @@ namespace RacesOfValheim
CommandManager.Instance.AddConsoleCommand(new FenrirPackSpawnCommand());
CommandManager.Instance.AddConsoleCommand(new DumpPotionsCommand());
CommandManager.Instance.AddConsoleCommand(new ListPrefabsCommand());
CommandManager.Instance.AddConsoleCommand(new AlfarProbeCommand());
CommandManager.Instance.AddConsoleCommand(new AlfarStatusCommand());
CommandManager.Instance.AddConsoleCommand(new AlfarResetCommand());
CommandManager.Instance.AddConsoleCommand(new AlfarEitrCommand());
CommandManager.Instance.AddConsoleCommand(new AlfarHpCommand());
CommandManager.Instance.AddConsoleCommand(new DumpAnimCommand());
CommandManager.Instance.AddConsoleCommand(new EvilLaughCommand());
}
@ -294,6 +302,7 @@ namespace RacesOfValheim
DvergarRace.Instance.CreateModAssets();
TrentaRace.Instance.CreateModAssets();
SvermRace.Instance.CreateModAssets();
AlfarRace.CreateModAssets();
WarVultureItem.Register();
TrolsHammerItem.Register();
BoneServant.Register();
@ -447,6 +456,7 @@ namespace RacesOfValheim
CreateRaceButtonWithConfirm(DvergarConfig.RaceId, new Vector2(-450, -140), GetDvergarIcon(), SelectDvergar);
CreateRaceButtonWithConfirm(TrentaConfig.RaceId, new Vector2(-150, -140), GetTrentaIcon(), SelectTrenta);
CreateRaceButtonWithConfirm(SvermConfig.RaceId, new Vector2(150, -140), GetSvermIcon(), SelectSverm);
CreateRaceButtonWithConfirm(AlfarConfig.RaceId, new Vector2(450, -140), GetAlfarIcon(), SelectAlfar);
GUIManager.BlockInput(true);
}
@ -469,6 +479,7 @@ namespace RacesOfValheim
case DvergarConfig.RaceId: return Instance.GetDvergarIcon();
case TrentaConfig.RaceId: return Instance.GetTrentaIcon();
case SvermConfig.RaceId: return Instance.GetSvermIcon();
case AlfarConfig.RaceId: return Instance.GetAlfarIcon();
}
return race == DraughVisuals.RaceId ? Instance.GetDraughIcon() : Instance.GetHumanIcon();
}
@ -874,6 +885,44 @@ namespace RacesOfValheim
}
}
private void SelectAlfar()
{
if (Player.m_localPlayer != null)
{
Player.m_localPlayer.m_customData["Race"] = AlfarConfig.RaceId;
ZNetView nview = Player.m_localPlayer.GetComponent<ZNetView>();
if (nview != null && nview.IsValid()) nview.GetZDO().Set("RacesOfValheim_Race", AlfarConfig.RaceId);
// The grey skin is written by Alfar_UpdateColors_Patch, which runs after UpdateColors:
// push one through so the change shows now and not at the next visual refresh.
VisEquipment visEq = Player.m_localPlayer.GetComponent<VisEquipment>();
if (visEq != null) Traverse.Create(visEq).Method("UpdateColors").GetValue();
Player.m_localPlayer.Message(MessageHud.MessageType.Center, ModText.Get("rov_msg_core_chose_path_alfar"));
CloseRaceSelectionMenu();
}
}
/// <summary>
/// Refined eitr's own icon: the race lives on eitr. Falls back to a Surtling core and then
/// to copper so the button is never an empty square.
/// </summary>
private Sprite GetAlfarIcon()
{
GameObject prefab = PrefabManager.Cache.GetPrefab<ItemDrop>("Eitr")?.gameObject;
if (prefab == null) prefab = PrefabManager.Cache.GetPrefab<ItemDrop>("SurtlingCore")?.gameObject;
if (prefab == null) prefab = PrefabManager.Cache.GetPrefab<ItemDrop>("Copper")?.gameObject;
if (prefab != null)
{
ItemDrop drop = prefab.GetComponent<ItemDrop>();
if (drop != null && drop.m_itemData.m_shared.m_icons.Length > 0)
{
return drop.m_itemData.m_shared.m_icons[0];
}
}
return null;
}
private Sprite GetSvermIcon()
{
GameObject prefab = PrefabManager.Cache.GetPrefab<ItemDrop>("TrophySeekerBrute")?.gameObject;