From b9ec452e72fcfa38d8eadc52fa4e9c3ccec3e7f2 Mon Sep 17 00:00:00 2001 From: kanym Date: Tue, 27 Oct 2026 19:25:03 +0100 Subject: [PATCH 1/2] fix: Draugh eats Bjorn and Volture meat, Alfar levitation on gamepad Draugh: add BjornMeat -> CookedBjornMeat to the raw-to-cooked table and correct VoltureMeat's cooked name (RoastedVoltureMeat does not exist, CookedVoltureMeat does), so neither raw meat got an EdibleUncooked_ item. Names checked against the SoftRef manifests. Alfar: ZInput "Jump" is the keyboard binding only. Read "JoyJump" and "JoyCrouch" too, as PlayerController does, for levitation and the Archon's climb and descent. Reported by lexsonn. --- JotunnModStub/Alfar/AlfarLevitation.cs | 14 ++++++++++---- JotunnModStub/Draugh/DraughFoodPatches.cs | 4 +++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/JotunnModStub/Alfar/AlfarLevitation.cs b/JotunnModStub/Alfar/AlfarLevitation.cs index 77f6b9d..206c8c7 100644 --- a/JotunnModStub/Alfar/AlfarLevitation.cs +++ b/JotunnModStub/Alfar/AlfarLevitation.cs @@ -48,7 +48,7 @@ namespace RacesOfValheim float target = 0f; if (Time.time - AlfarArchon.StartedAt < 0.6f) target = 4f; // lift off else if (RaceInput.Allowed && JumpHeld()) target = speed; - else if (RaceInput.Allowed && ZInput.GetButton("Crouch")) target = -speed; + else if (RaceInput.Allowed && CrouchHeld()) target = -speed; Vector3 velocity = flyer.linearVelocity; velocity.y = Mathf.Lerp(velocity.y, target, 0.25f); @@ -97,9 +97,15 @@ namespace RacesOfValheim private static bool JumpHeld() { - // ZInput's "Jump" covers the space bar and the pad's jump button alike, and respects the - // controls the player picked in the settings. - return ZInput.GetButton("Jump"); + // "Jump" is the keyboard binding only; the pad's button is a separate "JoyJump", read + // the way PlayerController reads it, kept off while a radial menu has the pad. + return ZInput.GetButton("Jump") || (ZInput.GetButton("JoyJump") && !Hud.InRadial()); + } + + private static bool CrouchHeld() + { + // Same split as jump: PlayerController ORs "Crouch" with "JoyCrouch". + return ZInput.GetButton("Crouch") || (ZInput.GetButton("JoyCrouch") && !Hud.InRadial()); } private static void FlushSpend(Player player) diff --git a/JotunnModStub/Draugh/DraughFoodPatches.cs b/JotunnModStub/Draugh/DraughFoodPatches.cs index ea56d5c..fe57c31 100644 --- a/JotunnModStub/Draugh/DraughFoodPatches.cs +++ b/JotunnModStub/Draugh/DraughFoodPatches.cs @@ -24,11 +24,13 @@ namespace RacesOfValheim { "HareMeat", "CookedHareMeat" }, { "ChickenMeat", "CookedChickenMeat" }, { "BugMeat", "CookedBugMeat" }, - { "VoltureMeat", "RoastedVoltureMeat" }, + { "VoltureMeat", "CookedVoltureMeat" }, { "GreydwarfEye", "DeerStew" }, { "Entrails", "Sausages" }, { "Bloodbag", "BloodPudding" }, { "MooseMeat", "CookedMooseMeat" }, + // Bjorn, the Valheim 1.0 bear. + { "BjornMeat", "CookedBjornMeat" }, // Raw blubber keeps its own name and icon (EdibleUncooked_ copies them from the raw // item) and gives the stats of Seal Meat Soup. { "SealBlubber", "SealSoup" } From db9aac2bf67a4dc24dce034c418be3ec17414497 Mon Sep 17 00:00:00 2001 From: kanym Date: Tue, 27 Oct 2026 19:33:17 +0100 Subject: [PATCH 2/2] fix: Draugh Ashlands meats, rebindable flight keys, Geisli on gamepad Draugh: add AsksvinMeat and BoneMawSerpentMeat to the shared raw-to-cooked table; the Aswid blood refinery no longer adds them on its own copy. DirectedFlight (drake, bat): read ZInput Forward/Backward/Run instead of raw W, S and Shift, so keys rebound in the settings work. Geisli: the pad has no free button in vanilla's Classic layout, so the beam is held on the pad's secondary attack, bare-handed or in the Archon form, as Skadi's Cold Spell does. The unarmed kick is swallowed while it fires. RaceInput.EmptyHanded is shared with Skadi. Compendium text mentions the pad in English, Italian and Russian. --- JotunnModStub/Alfar/AlfarPowers.cs | 30 ++++++++++++++++++- JotunnModStub/Aswid/AswidBloodRefinery.cs | 2 -- JotunnModStub/DirectedFlight.cs | 9 +++--- JotunnModStub/Draugh/DraughFoodPatches.cs | 3 ++ JotunnModStub/RaceInput.cs | 15 +++++++++- JotunnModStub/Skadi/SkadiRace.cs | 8 +---- .../Translations/English/compendium.json | 2 +- .../Translations/Italian/compendium.json | 2 +- .../Translations/Russian/compendium.json | 2 +- 9 files changed, 55 insertions(+), 18 deletions(-) diff --git a/JotunnModStub/Alfar/AlfarPowers.cs b/JotunnModStub/Alfar/AlfarPowers.cs index dc7c52b..82aca06 100644 --- a/JotunnModStub/Alfar/AlfarPowers.cs +++ b/JotunnModStub/Alfar/AlfarPowers.cs @@ -305,6 +305,34 @@ namespace RacesOfValheim // ─── Geisli: the beam ──────────────────────────────────────────────── + /// + /// The pad's way to hold the beam. Every pad button is taken in vanilla's Classic layout, so, + /// like Skadi's Cold Spell, the beam borrows the secondary attack: bare-handed, or in the + /// archon form, which has no weapons anyway. The radial entry only gives a single press, + /// which cannot hold a beam. + /// + private static bool PadBeamHeld(Player player) => + !RaceInput.RadialOpen && RaceInput.PadAttackHeld(2) && + (AlfarArchon.Active || RaceInput.EmptyHanded(player)); + + /// + /// Swallows the unarmed secondary (the kick) while the pad's secondary attack is the beam, + /// the same way SkadiAttackPatch does for the Cold Spell. + /// + [HarmonyPatch(typeof(Humanoid), "StartAttack")] + public static class Alfar_GeisliPadKick_Patch + { + public static bool Prefix(Humanoid __instance, bool secondaryAttack, ref bool __result) + { + if (!secondaryAttack || __instance != Player.m_localPlayer) return true; + Player player = (Player)__instance; + if (!AlfarVisuals.IsAlfarPlayer(player) || !Unlocked(AlfarPowerConfig.GeisliState)) return true; + if (!PadBeamHeld(player)) return true; + __result = false; + return false; + } + } + private static LineRenderer beamLine; private static readonly List beamArcs = new List(); private static GameObject beamFx; @@ -324,7 +352,7 @@ namespace RacesOfValheim private static void TickBeam(Player player) { bool wanted = RaceInput.Allowed && !player.IsDead() && Unlocked(AlfarPowerConfig.GeisliState) && - AlfarPowerConfig.GeisliKey.Value.IsPressedIgnoringHeldKeys(); + (AlfarPowerConfig.GeisliKey.Value.IsPressedIgnoringHeldKeys() || PadBeamHeld(player)); if (!wanted) { diff --git a/JotunnModStub/Aswid/AswidBloodRefinery.cs b/JotunnModStub/Aswid/AswidBloodRefinery.cs index c119d53..a127b5a 100644 --- a/JotunnModStub/Aswid/AswidBloodRefinery.cs +++ b/JotunnModStub/Aswid/AswidBloodRefinery.cs @@ -338,8 +338,6 @@ namespace RacesOfValheim // The raw -> cooked table the Draugh already maintains is the source of truth. meatToCooked = new Dictionary(DraughFoodPatches.rawToCookedMapping); meatToCooked.Remove("GreydwarfEye"); // stew ingredient, not flesh - meatToCooked["AsksvinMeat"] = "CookedAsksvinMeat"; - meatToCooked["BoneMawSerpentMeat"] = "CookedBoneMawSerpentMeat"; foreach (string stationName in CookingStationPrefabs) { diff --git a/JotunnModStub/DirectedFlight.cs b/JotunnModStub/DirectedFlight.cs index 49d2b5d..f68a094 100644 --- a/JotunnModStub/DirectedFlight.cs +++ b/JotunnModStub/DirectedFlight.cs @@ -112,12 +112,13 @@ namespace RacesOfValheim // 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. float stick = -JoyLeftStickY(); - bool forward = input && (Input.GetKey(KeyCode.W) || stick > StickThreshold); + // The keyboard side reads vanilla's own Forward/Backward/Run actions, so a key the + // player rebound in the settings flies too, not just W, S and Shift. + bool forward = input && (ZInput.GetButton("Forward") || stick > StickThreshold); // 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 && (ZInput.GetButton("Backward") || stick < -StickThreshold); // Sprint on a pad is vanilla's run button, wherever the chosen layout puts it. - bool sprintKey = input && (Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift) || - ZInput.GetButton("JoyRun")); + bool sprintKey = input && (ZInput.GetButton("Run") || ZInput.GetButton("JoyRun")); bool onGround = __instance.IsOnGround(); // IsSwimming is the exact test UpdateMotion uses to hand the frame to UpdateSwimming // instead of UpdateFlying, so it is also the one condition DirectedFlightWaterPatch has diff --git a/JotunnModStub/Draugh/DraughFoodPatches.cs b/JotunnModStub/Draugh/DraughFoodPatches.cs index fe57c31..a527830 100644 --- a/JotunnModStub/Draugh/DraughFoodPatches.cs +++ b/JotunnModStub/Draugh/DraughFoodPatches.cs @@ -31,6 +31,9 @@ namespace RacesOfValheim { "MooseMeat", "CookedMooseMeat" }, // Bjorn, the Valheim 1.0 bear. { "BjornMeat", "CookedBjornMeat" }, + // Ashlands. + { "AsksvinMeat", "CookedAsksvinMeat" }, + { "BoneMawSerpentMeat", "CookedBoneMawSerpentMeat" }, // Raw blubber keeps its own name and icon (EdibleUncooked_ copies them from the raw // item) and gives the stats of Seal Meat Soup. { "SealBlubber", "SealSoup" } diff --git a/JotunnModStub/RaceInput.cs b/JotunnModStub/RaceInput.cs index c045f2c..16f5d09 100644 --- a/JotunnModStub/RaceInput.cs +++ b/JotunnModStub/RaceInput.cs @@ -167,6 +167,19 @@ namespace RacesOfValheim return Input.GetMouseButtonDown(mouseButton) || PadAttackDown(mouseButton); } + /// + /// Nothing in either hand and not building. The pad has no spare button, so a race power + /// that needs one borrows the secondary attack under this condition only: with a weapon or + /// a tool in hand that button stays the item's, as in vanilla. + /// + public static bool EmptyHanded(Player player) + { + if (player == null || player.InPlaceMode()) return false; + var hands = Traverse.Create(player); + return hands.Field("m_rightItem").Value == null && + hands.Field("m_leftItem").Value == null; + } + /// Held-down counterpart of . public static bool AttackHeld(int mouseButton) { @@ -202,7 +215,7 @@ namespace RacesOfValheim private static bool loggedOpen; private static bool loggedClosed; - private static bool RadialOpen + internal static bool RadialOpen { get { diff --git a/JotunnModStub/Skadi/SkadiRace.cs b/JotunnModStub/Skadi/SkadiRace.cs index 27ea13e..8a5ff45 100644 --- a/JotunnModStub/Skadi/SkadiRace.cs +++ b/JotunnModStub/Skadi/SkadiRace.cs @@ -465,13 +465,7 @@ namespace RacesOfValheim /// mode and with nothing in either hand. Shared with SkadiAttackPatch, which swallows the /// unarmed kick under exactly the same condition. /// - public static bool PadCastsColdSpell(Player player) - { - if (player == null || player.InPlaceMode()) return false; - var hands = HarmonyLib.Traverse.Create(player); - return hands.Field("m_rightItem").Value == null && - hands.Field("m_leftItem").Value == null; - } + public static bool PadCastsColdSpell(Player player) => RaceInput.EmptyHanded(player); private IEnumerator ColdSpellKickCoroutine(SkadiProgression.FormRules rules) { diff --git a/JotunnModStub/Translations/English/compendium.json b/JotunnModStub/Translations/English/compendium.json index 98ffd70..657b743 100644 --- a/JotunnModStub/Translations/English/compendium.json +++ b/JotunnModStub/Translations/English/compendium.json @@ -12,7 +12,7 @@ "rov_compendium_alfar_utsog": "[Elder Unlock] Utsog: $1% of the damage you deal comes back to you as eitr.\n", "rov_compendium_alfar_kall": "[Bonemass Unlock] Kall ('$1' Key): Pulls every dropped item within $2 meters to you. Waits $3 seconds.\n", "rov_compendium_alfar_ljosstorm": "[Moder Unlock] Ljosstorm ('$1' Key): A psionic storm over a $2 meter area for $3 seconds. Waits $4 seconds.\n", - "rov_compendium_alfar_geisli": "[Yagluth Unlock] Geisli ('$1' Key, hold): A laser from your right hand, up to $2 meters, for at most $3 seconds, costing eitr by the second.\n", + "rov_compendium_alfar_geisli": "[Yagluth Unlock] Geisli ('$1' Key, hold): A laser from your right hand, up to $2 meters, for at most $3 seconds, costing eitr by the second. On a gamepad, hold the secondary attack with empty hands.\n", "rov_compendium_alfar_kyrr": "[Queen Unlock] Kyrr ('$1' Key): Holds what you look at in stasis for $2 seconds ($3 for a boss).\n", "rov_compendium_alfar_sameining": "[Fader Unlock] Sameining ('$1' Key): The archon. Needs $2% of your eitr and a ready Heimkall; spends all the eitr and turns it into a pool of protection. For up to $3 seconds you are larger, faster and you fly, and a psionic pulse strikes everything hostile around you, but you cannot use weapons. When it ends - time up or pool gone - you are called home at one health and the Heimkall begins its wait.\n", "rov_compendium_alfar_more_to_come": "More powers wake as the great ones fall.\n", diff --git a/JotunnModStub/Translations/Italian/compendium.json b/JotunnModStub/Translations/Italian/compendium.json index f9d4e25..34ca869 100644 --- a/JotunnModStub/Translations/Italian/compendium.json +++ b/JotunnModStub/Translations/Italian/compendium.json @@ -12,7 +12,7 @@ "rov_compendium_alfar_utsog": "[Sblocco Anziano] Utsog: il $1% dei danni che infliggi ti torna come eitr.\n", "rov_compendium_alfar_kall": "[Sblocco Bonemass] Kall (tasto '$1'): attira a te ogni oggetto a terra entro $2 metri. Attesa $3 secondi.\n", "rov_compendium_alfar_ljosstorm": "[Sblocco Moder] Ljosstorm (tasto '$1'): una tempesta psionica su un'area di $2 metri per $3 secondi. Attesa $4 secondi.\n", - "rov_compendium_alfar_geisli": "[Sblocco Yagluth] Geisli (tasto '$1', tenuto): un laser dalla mano destra, fino a $2 metri, per al massimo $3 secondi, consumando eitr al secondo.\n", + "rov_compendium_alfar_geisli": "[Sblocco Yagluth] Geisli (tasto '$1', tenuto): un laser dalla mano destra, fino a $2 metri, per al massimo $3 secondi, consumando eitr al secondo. Col controller, tieni premuto l'attacco secondario a mani vuote.\n", "rov_compendium_alfar_kyrr": "[Sblocco Regina] Kyrr (tasto '$1'): tiene in stasi ciò che guardi per $2 secondi ($3 per un boss).\n", "rov_compendium_alfar_sameining": "[Sblocco Fader] Sameining (tasto '$1'): l'arconte. Servono il $2% dell'eitr e un Heimkall pronto; spende tutto l'eitr e lo trasforma in una riserva di protezione. Per al massimo $3 secondi sei più grande, più veloce e voli, e un impulso psionico colpisce tutto ciò che è ostile attorno a te, ma non puoi usare armi. Alla fine - tempo scaduto o riserva esaurita - vieni richiamato a casa con un punto ferita e l'attesa dell'Heimkall ricomincia.\n", "rov_compendium_alfar_more_to_come": "Altri poteri si risveglieranno man mano che cadono i grandi.\n", diff --git a/JotunnModStub/Translations/Russian/compendium.json b/JotunnModStub/Translations/Russian/compendium.json index 3f8898f..c1ce95c 100644 --- a/JotunnModStub/Translations/Russian/compendium.json +++ b/JotunnModStub/Translations/Russian/compendium.json @@ -12,7 +12,7 @@ "rov_compendium_alfar_utsog": "[Открывается со Старейшиной] Утсог: $1% нанесённого вами урона возвращается к вам в виде эйтра.\n", "rov_compendium_alfar_kall": "[Открывается с Боунмассом] Калль (клавиша '$1'): притягивает к вам все лежащие предметы в радиусе $2 метров. Перезарядка $3 секунд.\n", "rov_compendium_alfar_ljosstorm": "[Открывается с Модером] Льёсстормр (клавиша '$1'): псионическая буря на площади $2 метров на $3 секунд. Перезарядка $4 секунд.\n", - "rov_compendium_alfar_geisli": "[Открывается с Ягнутом] Гейсли (клавиша '$1', удерживать): лазер из правой руки до $2 метров, не дольше $3 секунд, эйтр тратится каждую секунду.\n", + "rov_compendium_alfar_geisli": "[Открывается с Ягнутом] Гейсли (клавиша '$1', удерживать): лазер из правой руки до $2 метров, не дольше $3 секунд, эйтр тратится каждую секунду. На геймпаде удерживайте вторичную атаку с пустыми руками.\n", "rov_compendium_alfar_kyrr": "[Открывается с Королевой] Кюрр (клавиша '$1'): удерживает того, на кого смотрите, в стазисе $2 секунд ($3 для босса).\n", "rov_compendium_alfar_sameining": "[Открывается с Фадером] Саминг (клавиша '$1'): архонт. Нужно $2% эйтра и готовый Хеймкалль; тратит весь эйтр и превращает его в запас защиты. До $3 секунд вы больше, быстрее и летаете, а псионический импульс бьёт всех врагов вокруг, но оружием пользоваться нельзя. В конце - по времени или с исчерпанным запасом - вас возвращают домой с одной единицей здоровья, и Хеймкалль начинает ожидание.\n", "rov_compendium_alfar_more_to_come": "Новые силы пробуждаются по мере падения великих.\n",