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.
This commit is contained in:
parent
b9ec452e72
commit
db9aac2bf6
9 changed files with 55 additions and 18 deletions
|
|
@ -305,6 +305,34 @@ namespace RacesOfValheim
|
||||||
|
|
||||||
// ─── Geisli: the beam ────────────────────────────────────────────────
|
// ─── Geisli: the beam ────────────────────────────────────────────────
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 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.
|
||||||
|
/// </summary>
|
||||||
|
private static bool PadBeamHeld(Player player) =>
|
||||||
|
!RaceInput.RadialOpen && RaceInput.PadAttackHeld(2) &&
|
||||||
|
(AlfarArchon.Active || RaceInput.EmptyHanded(player));
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Swallows the unarmed secondary (the kick) while the pad's secondary attack is the beam,
|
||||||
|
/// the same way SkadiAttackPatch does for the Cold Spell.
|
||||||
|
/// </summary>
|
||||||
|
[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 LineRenderer beamLine;
|
||||||
private static readonly List<LineRenderer> beamArcs = new List<LineRenderer>();
|
private static readonly List<LineRenderer> beamArcs = new List<LineRenderer>();
|
||||||
private static GameObject beamFx;
|
private static GameObject beamFx;
|
||||||
|
|
@ -324,7 +352,7 @@ namespace RacesOfValheim
|
||||||
private static void TickBeam(Player player)
|
private static void TickBeam(Player player)
|
||||||
{
|
{
|
||||||
bool wanted = RaceInput.Allowed && !player.IsDead() && Unlocked(AlfarPowerConfig.GeisliState) &&
|
bool wanted = RaceInput.Allowed && !player.IsDead() && Unlocked(AlfarPowerConfig.GeisliState) &&
|
||||||
AlfarPowerConfig.GeisliKey.Value.IsPressedIgnoringHeldKeys();
|
(AlfarPowerConfig.GeisliKey.Value.IsPressedIgnoringHeldKeys() || PadBeamHeld(player));
|
||||||
|
|
||||||
if (!wanted)
|
if (!wanted)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -338,8 +338,6 @@ namespace RacesOfValheim
|
||||||
// The raw -> cooked table the Draugh already maintains is the source of truth.
|
// The raw -> cooked table the Draugh already maintains is the source of truth.
|
||||||
meatToCooked = new Dictionary<string, string>(DraughFoodPatches.rawToCookedMapping);
|
meatToCooked = new Dictionary<string, string>(DraughFoodPatches.rawToCookedMapping);
|
||||||
meatToCooked.Remove("GreydwarfEye"); // stew ingredient, not flesh
|
meatToCooked.Remove("GreydwarfEye"); // stew ingredient, not flesh
|
||||||
meatToCooked["AsksvinMeat"] = "CookedAsksvinMeat";
|
|
||||||
meatToCooked["BoneMawSerpentMeat"] = "CookedBoneMawSerpentMeat";
|
|
||||||
|
|
||||||
foreach (string stationName in CookingStationPrefabs)
|
foreach (string stationName in CookingStationPrefabs)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -112,12 +112,13 @@ namespace RacesOfValheim
|
||||||
// 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 = -JoyLeftStickY();
|
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.
|
// 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.
|
// 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) ||
|
bool sprintKey = input && (ZInput.GetButton("Run") || ZInput.GetButton("JoyRun"));
|
||||||
ZInput.GetButton("JoyRun"));
|
|
||||||
bool onGround = __instance.IsOnGround();
|
bool onGround = __instance.IsOnGround();
|
||||||
// IsSwimming is the exact test UpdateMotion uses to hand the frame to UpdateSwimming
|
// 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
|
// instead of UpdateFlying, so it is also the one condition DirectedFlightWaterPatch has
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,9 @@ namespace RacesOfValheim
|
||||||
{ "MooseMeat", "CookedMooseMeat" },
|
{ "MooseMeat", "CookedMooseMeat" },
|
||||||
// Bjorn, the Valheim 1.0 bear.
|
// Bjorn, the Valheim 1.0 bear.
|
||||||
{ "BjornMeat", "CookedBjornMeat" },
|
{ "BjornMeat", "CookedBjornMeat" },
|
||||||
|
// Ashlands.
|
||||||
|
{ "AsksvinMeat", "CookedAsksvinMeat" },
|
||||||
|
{ "BoneMawSerpentMeat", "CookedBoneMawSerpentMeat" },
|
||||||
// Raw blubber keeps its own name and icon (EdibleUncooked_ copies them from the raw
|
// Raw blubber keeps its own name and icon (EdibleUncooked_ copies them from the raw
|
||||||
// item) and gives the stats of Seal Meat Soup.
|
// item) and gives the stats of Seal Meat Soup.
|
||||||
{ "SealBlubber", "SealSoup" }
|
{ "SealBlubber", "SealSoup" }
|
||||||
|
|
|
||||||
|
|
@ -167,6 +167,19 @@ namespace RacesOfValheim
|
||||||
return Input.GetMouseButtonDown(mouseButton) || PadAttackDown(mouseButton);
|
return Input.GetMouseButtonDown(mouseButton) || PadAttackDown(mouseButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 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.
|
||||||
|
/// </summary>
|
||||||
|
public static bool EmptyHanded(Player player)
|
||||||
|
{
|
||||||
|
if (player == null || player.InPlaceMode()) return false;
|
||||||
|
var hands = Traverse.Create(player);
|
||||||
|
return hands.Field<ItemDrop.ItemData>("m_rightItem").Value == null &&
|
||||||
|
hands.Field<ItemDrop.ItemData>("m_leftItem").Value == null;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>Held-down counterpart of <see cref="AttackDown"/>.</summary>
|
/// <summary>Held-down counterpart of <see cref="AttackDown"/>.</summary>
|
||||||
public static bool AttackHeld(int mouseButton)
|
public static bool AttackHeld(int mouseButton)
|
||||||
{
|
{
|
||||||
|
|
@ -202,7 +215,7 @@ namespace RacesOfValheim
|
||||||
private static bool loggedOpen;
|
private static bool loggedOpen;
|
||||||
private static bool loggedClosed;
|
private static bool loggedClosed;
|
||||||
|
|
||||||
private static bool RadialOpen
|
internal static bool RadialOpen
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -465,13 +465,7 @@ namespace RacesOfValheim
|
||||||
/// mode and with nothing in either hand. Shared with SkadiAttackPatch, which swallows the
|
/// mode and with nothing in either hand. Shared with SkadiAttackPatch, which swallows the
|
||||||
/// unarmed kick under exactly the same condition.
|
/// unarmed kick under exactly the same condition.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static bool PadCastsColdSpell(Player player)
|
public static bool PadCastsColdSpell(Player player) => RaceInput.EmptyHanded(player);
|
||||||
{
|
|
||||||
if (player == null || player.InPlaceMode()) return false;
|
|
||||||
var hands = HarmonyLib.Traverse.Create(player);
|
|
||||||
return hands.Field<ItemDrop.ItemData>("m_rightItem").Value == null &&
|
|
||||||
hands.Field<ItemDrop.ItemData>("m_leftItem").Value == null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private IEnumerator ColdSpellKickCoroutine(SkadiProgression.FormRules rules)
|
private IEnumerator ColdSpellKickCoroutine(SkadiProgression.FormRules rules)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -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_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_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_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_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_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",
|
"rov_compendium_alfar_more_to_come": "More powers wake as the great ones fall.\n",
|
||||||
|
|
|
||||||
|
|
@ -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_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_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_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_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_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",
|
"rov_compendium_alfar_more_to_come": "Altri poteri si risveglieranno man mano che cadono i grandi.\n",
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
"rov_compendium_alfar_utsog": "[Открывается со Старейшиной] Утсог: $1% нанесённого вами урона возвращается к вам в виде эйтра.\n",
|
"rov_compendium_alfar_utsog": "[Открывается со Старейшиной] Утсог: $1% нанесённого вами урона возвращается к вам в виде эйтра.\n",
|
||||||
"rov_compendium_alfar_kall": "[Открывается с Боунмассом] Калль (клавиша '$1'): притягивает к вам все лежащие предметы в радиусе $2 метров. Перезарядка $3 секунд.\n",
|
"rov_compendium_alfar_kall": "[Открывается с Боунмассом] Калль (клавиша '$1'): притягивает к вам все лежащие предметы в радиусе $2 метров. Перезарядка $3 секунд.\n",
|
||||||
"rov_compendium_alfar_ljosstorm": "[Открывается с Модером] Льёсстормр (клавиша '$1'): псионическая буря на площади $2 метров на $3 секунд. Перезарядка $4 секунд.\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_kyrr": "[Открывается с Королевой] Кюрр (клавиша '$1'): удерживает того, на кого смотрите, в стазисе $2 секунд ($3 для босса).\n",
|
||||||
"rov_compendium_alfar_sameining": "[Открывается с Фадером] Саминг (клавиша '$1'): архонт. Нужно $2% эйтра и готовый Хеймкалль; тратит весь эйтр и превращает его в запас защиты. До $3 секунд вы больше, быстрее и летаете, а псионический импульс бьёт всех врагов вокруг, но оружием пользоваться нельзя. В конце - по времени или с исчерпанным запасом - вас возвращают домой с одной единицей здоровья, и Хеймкалль начинает ожидание.\n",
|
"rov_compendium_alfar_sameining": "[Открывается с Фадером] Саминг (клавиша '$1'): архонт. Нужно $2% эйтра и готовый Хеймкалль; тратит весь эйтр и превращает его в запас защиты. До $3 секунд вы больше, быстрее и летаете, а псионический импульс бьёт всех врагов вокруг, но оружием пользоваться нельзя. В конце - по времени или с исчерпанным запасом - вас возвращают домой с одной единицей здоровья, и Хеймкалль начинает ожидание.\n",
|
||||||
"rov_compendium_alfar_more_to_come": "Новые силы пробуждаются по мере падения великих.\n",
|
"rov_compendium_alfar_more_to_come": "Новые силы пробуждаются по мере падения великих.\n",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue