Bind Taming ability to K key instead of E

This commit is contained in:
Ferdinando 2026-07-31 09:42:07 +02:00
commit ff9fc4db2d
2 changed files with 36 additions and 32 deletions

View file

@ -459,42 +459,11 @@ namespace RacesOfValheim
if (canTame)
{
__result += "\n[<color=yellow><b></b></color>] Tame";
__result += "\n[<color=yellow><b>K</b></color>] Tame";
}
}
}
[HarmonyPatch(typeof(Tameable), "Interact")]
public static class Aswid_TameInteract_Patch
{
public static bool Prefix(Tameable __instance, Humanoid user, bool hold, bool alt)
{
if (hold || alt) return true;
if (user != Player.m_localPlayer || !AswidRace.IsAswid()) return true;
if (__instance.GetComponent<Character>()?.IsTamed() == true) return true;
string prefabName = __instance.gameObject.name.ToLower();
int state = BossProgressionManager.GetCurrentProgressionState();
bool canTame = false;
if (state >= 2 && prefabName.Contains("boar")) canTame = true;
if (state >= 5 && prefabName.Contains("wolf")) canTame = true;
if (state >= 6 && prefabName.Contains("lox")) canTame = true;
if (state >= 8 && prefabName.Contains("asksvin")) canTame = true;
if (canTame)
{
__instance.GetComponent<Character>()?.SetTamed(true);
HarmonyLib.Traverse.Create(__instance).Method("Tame").GetValue(); // attempt to call Tame for VFX if it exists
__instance.Command(user);
user.Message(MessageHud.MessageType.Center, "Tamed!");
return false; // Skip original interact
}
return true;
}
}
[HarmonyPatch(typeof(Hud), "UpdateStamina")]
public static class Aswid_HideStamina_Patch
{