Merge branch 'war-vulture' into main

Brings in v1.4.3-v1.4.5 work: Trol's Hammer, Bone Servants, War Vulture
craftability, and the Aswid/Fenrir timed-claws rework, on top of the
bugfixes merged into main since v1.4.2.

Resolved conflicts in 7 files where main's post-v1.4.2 fixes overlapped
war-vulture's claws rework:
- README.md, manifest.json: took war-vulture's v1.4.5 content (main
  hadn't touched either since the v1.4.2 release).
- RacesOfValheim.cs: plugin version -> 1.4.5.
- RaceClaws.cs: kept war-vulture's lazy EnsureRoster() fix for the
  Fenrir claw-registration bug over main's belt-and-suspenders
  Register(this), and dropped the now-stale comment referencing the
  removed static constructor. Main's SetupDragItem race-ownership fix
  carried through untouched.
- AswidConfig.cs/AswidRace.cs/AswidPatches.cs: adopted war-vulture's
  single-key design (I toggles both Vampiric Aura and Devour together)
  to match the documented v1.4.5 trader-safety fix, removing a duplicate
  AuraEnabled field the two branches had each declared independently.
  Kept main's IsDownIgnoringHeldKeys() input fix on top.
- RaceCompendium.cs: kept main's fact-checked Aswid/Fenrir entries
  (war-vulture's copies were pre-fix stubs, one referencing a
  nonexistent variable) and layered in war-vulture's timed-claws
  wording.

Build verified clean (0 errors) after resolution.
This commit is contained in:
kanym 2026-08-18 17:36:42 +02:00
commit c2212df322
38 changed files with 3831 additions and 192 deletions

View file

@ -15,7 +15,7 @@ namespace RacesOfValheim
{
public const string PluginGUID = "com.nandor.racesofvalheim";
public const string PluginName = "Races Of Valheim";
public const string PluginVersion = "1.4.2";
public const string PluginVersion = "1.4.5";
private readonly Harmony harmony = new Harmony(PluginGUID);
@ -40,6 +40,15 @@ namespace RacesOfValheim
// Not a race: a summoned mount two races share, so it binds after the races rather
// than inside the alphabetical run above.
WarVultureConfig.Bind(Config);
// Not a race either: a tool any race can craft, so it sits beside the vulture rather
// than inside the alphabetical run above.
TrolsHammerConfig.Bind(Config);
// Not a race either: the two Bone Servants, shared by the Skeleton and Skadi, so they
// bind here rather than inside either race's run.
ButlerConfig.Bind(Config);
// Not a race either: the Claws skill Aswid and Fenrir share, so it binds here rather
// than inside either race's run.
RaceClawsConfig.Bind(Config);
harmony.PatchAll();
gameObject.AddComponent<FenrirRace>();
gameObject.AddComponent<SkadiRace>();
@ -81,6 +90,8 @@ namespace RacesOfValheim
Player player = Player.m_localPlayer;
if (player == null) return;
RemovePermanentRaceEquipment(player);
player.m_customData.Remove("Race");
player.m_customData.Remove("FenrirCurse_Active");
@ -144,6 +155,30 @@ namespace RacesOfValheim
}
}
/// <summary>
/// Strips whatever body-part weapon the outgoing race grew. The Aswid/Fenrir claws
/// (RaceClawSet) and the Sverm's Chitin Claws (SvermClawSlot) are quest items a player can
/// neither drop nor sell, so a race change has to take them off the same way it takes the
/// stats away - otherwise they sit in the inventory forever as leftovers from a race that
/// no longer applies. Checked by item identity rather than by the race being left, so it
/// also mops up anything a previous, already-abandoned race left behind.
/// </summary>
private static void RemovePermanentRaceEquipment(Player player)
{
Inventory inventory = player.GetInventory();
if (inventory == null) return;
// Copied out first: removing items while GetAllItems()'s own list is still being
// walked corrupts the enumeration.
foreach (ItemDrop.ItemData item in inventory.GetAllItems().ToArray())
{
if (RaceClawSet.SetOwning(item) == null && !SvermClawSlot.IsClaws(item)) continue;
if (player.IsItemEquiped(item)) player.UnequipItem(item, false);
inventory.RemoveItem(item);
}
}
private void CreateAllModAssets() {
PrefabManager.OnVanillaPrefabsAvailable -= CreateAllModAssets;
RaceMenuWard.Register();
@ -158,6 +193,8 @@ namespace RacesOfValheim
TrentaRace.Instance.CreateModAssets();
SvermRace.Instance.CreateModAssets();
WarVultureItem.Register();
TrolsHammerItem.Register();
BoneServant.Register();
}
// --- RACE SELECTION UI ---
public void ShowRaceSelectionMenu()