chore(release): v1.4.18 - Valheim hotfix flight fix, 1.0 shop fixes, Fenrir speed
Drake flight resolves ZInput.GetJoyLeftStickY at runtime, since the hotfix dropped its bool parameter. Faction merchant TradeItems now set the 1.0 fields StoreGui dereferences (m_tooltip, m_buyPlayerEffects), and the Dvergar trader discount clones the whole TradeItem instead of rebuilding four fields. Trol totem refusals return true so vanilla's $msg_cantuseon no longer covers them. The Fenrir curse speed modifier is the bonus alone (SE_Stats adds it), not 1 + bonus. New Discord link. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
8aa917cfcb
commit
c7cbd6bece
9 changed files with 59 additions and 17 deletions
|
|
@ -281,17 +281,19 @@ namespace RacesOfValheim
|
||||||
{
|
{
|
||||||
if (item == null) continue;
|
if (item == null) continue;
|
||||||
|
|
||||||
discounted.Add(new Trader.TradeItem
|
// A full copy, not a hand-picked one: Valheim 1.0 hangs name, tooltip, icon,
|
||||||
{
|
// buy/increment keys and buy effects off TradeItem, and StoreGui reads some
|
||||||
m_prefab = item.m_prefab,
|
// of them without null checks. Only the price is ours to change.
|
||||||
m_stack = item.m_stack,
|
var copy = (Trader.TradeItem)MemberwiseCloneMethod.Invoke(item, null);
|
||||||
m_price = Mathf.Max(1, Mathf.RoundToInt(item.m_price * (1f - discount))),
|
copy.m_price = Mathf.Max(1, Mathf.RoundToInt(item.m_price * (1f - discount)));
|
||||||
m_requiredGlobalKey = item.m_requiredGlobalKey
|
discounted.Add(copy);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
__result = discounted;
|
__result = discounted;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static readonly System.Reflection.MethodInfo MemberwiseCloneMethod =
|
||||||
|
AccessTools.Method(typeof(object), "MemberwiseClone");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,14 @@ namespace RacesOfValheim
|
||||||
m_prefab = itemDrop,
|
m_prefab = itemDrop,
|
||||||
m_stack = 1,
|
m_stack = 1,
|
||||||
m_price = entry.Price,
|
m_price = entry.Price,
|
||||||
|
// Valheim 1.0 fields that StoreGui dereferences without a null check:
|
||||||
|
// FillList reads m_tooltip.Length, BuySelectedItem calls
|
||||||
|
// m_buyPlayerEffects.Create. Empty means "use the item's own".
|
||||||
|
m_name = string.Empty,
|
||||||
|
m_tooltip = string.Empty,
|
||||||
|
m_buyKey = string.Empty,
|
||||||
|
m_incrementKey = string.Empty,
|
||||||
|
m_buyPlayerEffects = new EffectList(),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,9 @@ namespace RacesOfValheim
|
||||||
int state = BossProgressionManager.GetCurrentProgressionState();
|
int state = BossProgressionManager.GetCurrentProgressionState();
|
||||||
|
|
||||||
m_fallDamageModifier = FenrirProgression.GetFallDamageModifier(state);
|
m_fallDamageModifier = FenrirProgression.GetFallDamageModifier(state);
|
||||||
m_speedModifier = 1.0f + FenrirProgression.GetSpeedModifier(state);
|
// SE_Stats.ModifySpeed adds baseSpeed * m_speedModifier, so this is the bonus alone:
|
||||||
|
// 0 is vanilla speed, 0.03 is +3%. A leading 1.0f here was a flat +100%.
|
||||||
|
m_speedModifier = FenrirProgression.GetSpeedModifier(state);
|
||||||
m_jumpModifier = new Vector3(0, FenrirProgression.GetJumpModifier(state), 0);
|
m_jumpModifier = new Vector3(0, FenrirProgression.GetJumpModifier(state), 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "RacesOfValheim",
|
"name": "RacesOfValheim",
|
||||||
"description": "A Valheim mod that adds ten custom playable races (Aswid, Draugh, Dvergar, Fenrir, Furling, Skadi, Skeleton, Sverm, Trenta, Trol) each with unique abilities, traits, race stations and a deep boss-driven progression system.",
|
"description": "A Valheim mod that adds ten custom playable races (Aswid, Draugh, Dvergar, Fenrir, Furling, Skadi, Skeleton, Sverm, Trenta, Trol) each with unique abilities, traits, race stations and a deep boss-driven progression system.",
|
||||||
"version_number": "1.4.16",
|
"version_number": "1.4.18",
|
||||||
"website_url": "",
|
"website_url": "",
|
||||||
"dependencies": [
|
"dependencies": [
|
||||||
"denikson-BepInExPack_Valheim-5.4.2333",
|
"denikson-BepInExPack_Valheim-5.4.2333",
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ namespace RacesOfValheim
|
||||||
{
|
{
|
||||||
public const string PluginGUID = "com.nandor.racesofvalheim";
|
public const string PluginGUID = "com.nandor.racesofvalheim";
|
||||||
public const string PluginName = "Races Of Valheim";
|
public const string PluginName = "Races Of Valheim";
|
||||||
public const string PluginVersion = "1.4.16";
|
public const string PluginVersion = "1.4.18";
|
||||||
|
|
||||||
private readonly Harmony harmony = new Harmony(PluginGUID);
|
private readonly Harmony harmony = new Harmony(PluginGUID);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -314,6 +314,23 @@ namespace RacesOfValheim
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static bool Reversing { get; private set; }
|
public static bool Reversing { get; private set; }
|
||||||
|
|
||||||
|
// The September 2026 hotfix dropped the bool parameter from ZInput.GetJoyLeftStickY.
|
||||||
|
// A direct call binds to whichever signature we compiled against and throws
|
||||||
|
// MissingMethodException on the other, so resolve it at runtime and accept either.
|
||||||
|
private static readonly MethodInfo JoyLeftStickYMethod =
|
||||||
|
AccessTools.Method(typeof(ZInput), "GetJoyLeftStickY", new System.Type[0]) ??
|
||||||
|
AccessTools.Method(typeof(ZInput), "GetJoyLeftStickY", new[] { typeof(bool) });
|
||||||
|
|
||||||
|
private static float JoyLeftStickY()
|
||||||
|
{
|
||||||
|
if (JoyLeftStickYMethod == null) return 0f;
|
||||||
|
return (float)JoyLeftStickYMethod.Invoke(null, JoyLeftStickYArgs);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Old signature: pass smooth = true, which was its default.
|
||||||
|
private static readonly object[] JoyLeftStickYArgs =
|
||||||
|
JoyLeftStickYMethod != null && JoyLeftStickYMethod.GetParameters().Length == 1 ? new object[] { true } : null;
|
||||||
|
|
||||||
public static void Prefix(Character __instance, float dt)
|
public static void Prefix(Character __instance, float dt)
|
||||||
{
|
{
|
||||||
if (__instance != Player.m_localPlayer) return;
|
if (__instance != Player.m_localPlayer) return;
|
||||||
|
|
@ -332,7 +349,7 @@ namespace RacesOfValheim
|
||||||
// PlayerController.FixedUpdate takes forward as the NEGATED GetJoyLeftStickY.
|
// PlayerController.FixedUpdate takes forward as the NEGATED GetJoyLeftStickY.
|
||||||
// Flight only knows powered forward, reverse or neither, so the stick is a
|
// Flight only knows powered forward, reverse or neither, so the stick is a
|
||||||
// threshold, not a throttle. Steering stays on the camera, i.e. the right stick.
|
// threshold, not a throttle. Steering stays on the camera, i.e. the right stick.
|
||||||
float stick = -ZInput.GetJoyLeftStickY();
|
float stick = -JoyLeftStickY();
|
||||||
bool forward = input && (Input.GetKey(KeyCode.W) || stick > StickThreshold);
|
bool forward = input && (Input.GetKey(KeyCode.W) || stick > StickThreshold);
|
||||||
// Forward wins a W+S mash rather than the two cancelling into a dead hover.
|
// Forward wins a W+S mash rather than the two cancelling into a dead hover.
|
||||||
bool backward = input && !forward && (Input.GetKey(KeyCode.S) || stick < -StickThreshold);
|
bool backward = input && !forward && (Input.GetKey(KeyCode.S) || stick < -StickThreshold);
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,9 @@ namespace RacesOfValheim
|
||||||
if (!TrolRace.IsTrol())
|
if (!TrolRace.IsTrol())
|
||||||
{
|
{
|
||||||
player.Message(MessageHud.MessageType.Center, "The head will not shout for you.");
|
player.Message(MessageHud.MessageType.Center, "The head will not shout for you.");
|
||||||
return false;
|
// With an item in hand, false makes Humanoid.UseItem cover this message with its
|
||||||
|
// generic "$msg_cantuseon"; true tells it the use was handled here.
|
||||||
|
return item != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Yagluth's drop in hand upgrades it: a new head, and two more warbands on the list.
|
// Yagluth's drop in hand upgrades it: a new head, and two more warbands on the list.
|
||||||
|
|
@ -83,24 +85,26 @@ namespace RacesOfValheim
|
||||||
if (item != null)
|
if (item != null)
|
||||||
{
|
{
|
||||||
player.Message(MessageHud.MessageType.Center, "$msg_wontwork");
|
player.Message(MessageHud.MessageType.Center, "$msg_wontwork");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return OpenStore(player);
|
return OpenStore(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Every refusal still returns true: this only runs from an item use, where false would
|
||||||
|
// make Humanoid.UseItem replace our message with the generic "$msg_cantuseon".
|
||||||
private bool TryUpgrade(Player player, ItemDrop.ItemData item)
|
private bool TryUpgrade(Player player, ItemDrop.ItemData item)
|
||||||
{
|
{
|
||||||
if (IsUpgraded())
|
if (IsUpgraded())
|
||||||
{
|
{
|
||||||
player.Message(MessageHud.MessageType.Center, "It has already had one.");
|
player.Message(MessageHud.MessageType.Center, "It has already had one.");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (BossProgressionManager.GetCurrentProgressionState() < TrolTotem.UpgradeProgressionState)
|
if (BossProgressionManager.GetCurrentProgressionState() < TrolTotem.UpgradeProgressionState)
|
||||||
{
|
{
|
||||||
player.Message(MessageHud.MessageType.Center, "Not until the one it belonged to has fallen.");
|
player.Message(MessageHud.MessageType.Center, "Not until the one it belonged to has fallen.");
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
player.GetInventory().RemoveItem(item, 1);
|
player.GetInventory().RemoveItem(item, 1);
|
||||||
|
|
|
||||||
11
README.md
11
README.md
|
|
@ -7,7 +7,7 @@ A comprehensive Valheim mod allowing you to play as unique races, each providing
|
||||||
## Development & Feedback
|
## Development & Feedback
|
||||||
|
|
||||||
This is a stable release, but more races and refinements are planned!
|
This is a stable release, but more races and refinements are planned!
|
||||||
Bug reports, feedback, ideas: [https://discord.gg/gbBEK2VTE](https://discord.gg/gbBEK2VTE)
|
Bug reports, feedback, ideas: [https://discord.gg/jJzuKBZNC](https://discord.gg/jJzuKBZNC)
|
||||||
Support the mod: [Patreon — NandorTheModder](https://www.patreon.com/c/NandorTheModder)
|
Support the mod: [Patreon — NandorTheModder](https://www.patreon.com/c/NandorTheModder)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
@ -410,6 +410,15 @@ Both halves have an off switch under `Factions` in Configuration Manager: **Fact
|
||||||
|
|
||||||
## Changelog
|
## Changelog
|
||||||
|
|
||||||
|
### v1.4.18
|
||||||
|
- **Fix - Drake flight stopped working after the latest Valheim hotfix:** the hotfix changed how the game reads the gamepad's left stick, and the drake's flight still asked for it the old way. Every frame in the air threw a `MissingMethodException` into the log and the drake could not fly. Flight now works on both the new and the old version of the game.
|
||||||
|
- **Fix - Faction merchants would not open their shop:** Valheim 1.0 added a name, tooltip, buy effects and unlock keys to every shop item, and the shop window reads some of them without checking they are there. The merchants' goods were missing them, so pressing E threw a `NullReferenceException` and nothing opened. Buying is covered too — it would have hit the same wall on the buy effects. Thanks to the tester who tracked this down.
|
||||||
|
- **Fix - Haldor and Hildir's Dvergar discount broke their shops:** the discounted copies of their goods were rebuilt with only the old fields, so a Dvergar hit the same shop error, and items that unlock something when bought (like Haldor's extra inventory row) lost what they unlock. The discount now copies the whole item and changes only the price.
|
||||||
|
- **Fix - The Trol totem's own messages were replaced by "Can't use X on Y":** using Yagluth's drop on a totem that already has one, or before Yagluth has fallen, or using any other item on it, now shows the totem's message instead of the generic one. Thanks to the tester who spotted it.
|
||||||
|
- **Fix - The Fenrir was 100% faster than intended:** the curse's speed bonus was applied as a multiplier on top of normal speed instead of as a bonus, so every Fenrir moved at double speed plus the bonus (103% faster after one boss instead of 3%). It is now the +3% per boss the race has always listed.
|
||||||
|
- **Changed - New Discord link:** [https://discord.gg/jJzuKBZNC](https://discord.gg/jJzuKBZNC).
|
||||||
|
- 1.4.17 was 1.4.16 republished on Thunderstore with only the version number changed; there is no separate 1.4.17 changelog.
|
||||||
|
|
||||||
### v1.4.16
|
### v1.4.16
|
||||||
- **CHANGED - The Trol's True Form no longer runs out after Fader:** once Fader is defeated the form lasts until you press the True Form key again, and there is no cooldown — reverting is a choice there, not the form running out. Before Fader nothing changes: it lasts `Duration` seconds and then the cooldown applies. The radial menu entry presses the same key, so it is a toggle from the gamepad too. A form already running when Fader falls keeps its old duration; the next one is permanent.
|
- **CHANGED - The Trol's True Form no longer runs out after Fader:** once Fader is defeated the form lasts until you press the True Form key again, and there is no cooldown — reverting is a choice there, not the form running out. Before Fader nothing changes: it lasts `Duration` seconds and then the cooldown applies. The radial menu entry presses the same key, so it is a toggle from the gamepad too. A form already running when Fader falls keeps its old duration; the next one is permanent.
|
||||||
- **CHANGED - The Trol's thrown log is a Gammeltroll log:** in True Form the log you throw is now one of the projectiles the Gammeltroll (Valheim 1.0) fires in a rose, just one instead of the whole spread. It is read off the monster's own weapons at runtime rather than by a hard-coded name. It hits exactly as hard as a True Form rock, with the same `Throw Rock` bonuses from Bonemass and Yagluth, and it no longer breaks into wood. If the projectile can't be found, the old physical log is thrown instead and a warning goes to the log. `dumpgammel` in the console shows what was found.
|
- **CHANGED - The Trol's thrown log is a Gammeltroll log:** in True Form the log you throw is now one of the projectiles the Gammeltroll (Valheim 1.0) fires in a rose, just one instead of the whole spread. It is read off the monster's own weapons at runtime rather than by a hard-coded name. It hits exactly as hard as a True Form rock, with the same `Throw Rock` bonuses from Bonemass and Yagluth, and it no longer breaks into wood. If the projectile can't be found, the old physical log is thrown instead and a warning goes to the log. `dumpgammel` in the console shows what was found.
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "RacesOfValheim",
|
"name": "RacesOfValheim",
|
||||||
"description": "A Valheim mod that adds ten custom playable races (Aswid, Draugh, Dvergar, Fenrir, Furling, Skadi, Skeleton, Sverm, Trenta, Trol) each with unique abilities, traits, race stations and a deep boss-driven progression system.",
|
"description": "A Valheim mod that adds ten custom playable races (Aswid, Draugh, Dvergar, Fenrir, Furling, Skadi, Skeleton, Sverm, Trenta, Trol) each with unique abilities, traits, race stations and a deep boss-driven progression system.",
|
||||||
"version_number": "1.4.16",
|
"version_number": "1.4.18",
|
||||||
"website_url": "",
|
"website_url": "",
|
||||||
"dependencies": [
|
"dependencies": [
|
||||||
"denikson-BepInExPack_Valheim-5.4.2333",
|
"denikson-BepInExPack_Valheim-5.4.2333",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue