Compare commits

...
Sign in to create a new pull request.

54 commits

Author SHA1 Message Date
b1f3a6d666 Merge remote-tracking branch 'origin/main' into localisation 2026-11-13 17:08:48 +01:00
2f8f399b43 docs: v1.6.11 changelog and version bump, debug key in its own config section; Dagaz credit 2026-11-13 17:08:33 +01:00
eb793cfb57 Merge branch 'debug-config-section' 2026-11-13 17:07:45 +01:00
0668d59a9b feat(debug): Debug config section; debug key rebindable and off by default; Log Form Hits moved from Fenrir; dead Skeleton F8 helpers removed
Requested by Dagaz.
2026-11-13 17:07:45 +01:00
555830351d Merge remote-tracking branch 'origin/main' into localisation 2026-11-11 18:43:56 +01:00
b431bb9d1f docs: v1.6.10 adds the Skrid roof fix; Joacwoo credit 2026-11-11 18:43:43 +01:00
a5d3b54dd6 Merge branch 'fix-alfar-blink-floor' 2026-11-11 18:43:42 +01:00
ffed6fd33e fix(alfar): Skrid lands on the floor under its end, never on a roof; cancelled in a dungeon with no floor 2026-11-11 18:43:42 +01:00
1954867385 Merge remote-tracking branch 'origin/main' into localisation 2026-11-11 15:57:25 +01:00
088d969323 docs: v1.6.10 changelog and version bump, Skadi drake forms hit the dummy, Ravager damage on Unarmed, Alfar hair flash 2026-11-11 15:57:02 +01:00
91f2a8bc0a Merge branch 'fix-alfar-hair-flicker' 2026-11-11 15:56:01 +01:00
0b90201368 Merge branch 'fix-form-attacks' 2026-11-11 15:56:01 +01:00
caaa233392 fix(forms): Skadi melee hits the training dummy on the clip's hit frame, Ravager attacks get Brute sounds and scale with Unarmed 2026-11-11 15:56:01 +01:00
842af2fd4f fix(alfar): hair and beard never attach, no flash on equipment change 2026-11-11 14:57:38 +01:00
b4a6432617 Merge remote-tracking branch 'origin/main' into localisation 2026-11-06 21:45:31 +01:00
2d865f5bb0 docs: v1.6.9 changelog and version bump, hitting your own faction, grudges in multiplayer, race attacks train their skills 2026-11-06 21:45:11 +01:00
6ddca72144 Merge branch 'fix-grudge-multiplayer' 2026-11-06 21:28:13 +01:00
7a618936f2 fix(factions): grudges survive an owner change and reach kin owned elsewhere
The grudge was a dictionary in the owner's memory: when another client
took over the creature mid-fight, its copy made peace on the next
UpdateTarget. Grudge spreads to kin also skipped kin owned by another
client. The grudge now lives on the creature's ZDO (attacker ZDOID and
an end time in network time), written only by the owner; kin owned
elsewhere get an RPC that their owner handles.
2026-11-06 21:28:13 +01:00
811e4cac34 Merge branch 'fix-aswid-puke-stomach' 2026-11-06 21:21:20 +01:00
cae18b440d Merge branch 'fix-faction-grudge' 2026-11-06 21:21:20 +01:00
c1c1c76360 fix(aswid): pukeberries empty the fourth stomach too
SE_Puke calls RemoveOneFood, which only picks from vanilla's three
slots, so the Aswid's fourth meal survived the berries. It now joins
the same random draw, the way the Trol's extra slots do.
2026-11-06 21:21:20 +01:00
4ee98d90cb fix(factions): the player can strike allied creatures again
Valheim 1.0's hit filters (Attack melee/area, Projectile OnHit/DoAOE/
IsValidTarget, Aoe.ShouldHit) skip a target when BaseAI.IsEnemy says
false and the attacker is a player without PvP. The truce said false
for every allied creature, so the blow passed through: no damage, no
grudge, nothing for kin to join. RaceGrudge.StrikeScope opens a scope
around those six methods in which both truce patches stand down for
the player's own hit; everything else keeps the truce.
2026-11-06 21:21:20 +01:00
fdc5d9fab7 Merge branch 'fix-form-skill-xp' 2026-11-06 21:21:11 +01:00
b8ddcfd1d5 Merge remote-tracking branch 'origin/main' into localisation 2026-11-05 13:21:49 +01:00
2b1064025a Merge remote-tracking branch 'origin/main' into localisation 2026-11-05 12:44:24 +01:00
42c1e7ddd3 Merge remote-tracking branch 'origin/main' into localisation 2026-11-02 17:33:22 +01:00
78d75a4a84 Merge remote-tracking branch 'origin/main' into localisation 2026-10-30 23:46:51 +01:00
46805836f3 Merge remote-tracking branch 'origin/main' into localisation 2026-10-29 21:10:19 +01:00
2147c892b0 Merge remote-tracking branch 'origin/main' into localisation 2026-10-29 19:35:45 +01:00
9117c0b251 Merge remote-tracking branch 'origin/main' into localisation 2026-10-29 16:22:58 +01:00
356e0f44d8 Merge remote-tracking branch 'origin/main' into localisation 2026-10-28 13:57:19 +01:00
4fe7a9787d Merge remote-tracking branch 'origin/main' into localisation 2026-10-27 19:36:18 +01:00
76085f14b0 Merge remote-tracking branch 'origin/main' into localisation 2026-10-26 16:09:04 +01:00
68b87d181a Merge remote-tracking branch 'origin/main' into localisation 2026-10-25 18:25:22 +01:00
4fcfe6fd7c Merge remote-tracking branch 'origin/main' into localisation 2026-10-25 17:58:37 +01:00
d689834070 Merge remote-tracking branch 'origin/main' into localisation 2026-10-24 18:28:28 +02:00
fe8b3ea270 Merge remote-tracking branch 'origin/main' into localisation 2026-10-23 22:27:37 +02:00
cacc8ead4a Merge branch 'main' into localisation 2026-10-23 19:07:23 +02:00
99f409c8be Merge remote-tracking branch 'origin/main' into localisation 2026-10-19 14:30:42 +02:00
b3bdb0f75a Merge remote-tracking branch 'origin/main' into localisation 2026-10-19 14:26:56 +02:00
92c80e3b87 Merge branch 'main' into localisation 2026-10-18 00:19:25 +02:00
589127b7df Merge branch 'main' into localisation 2026-10-17 20:30:37 +02:00
174e615ed9 Merge branch 'main' into localisation 2026-10-17 20:28:54 +02:00
20e08432b8 Merge branch 'main' into localisation 2026-10-17 19:39:13 +02:00
a28fb19845 Merge branch 'main' into localisation 2026-10-17 19:33:39 +02:00
d28f9e353a Merge branch 'main' into localisation 2026-10-17 19:07:01 +02:00
d120ec8dc2 Merge branch 'main' into localisation 2026-10-17 17:15:54 +02:00
a2a4bcf451 Merge branch 'main' into localisation 2026-10-17 16:24:09 +02:00
b6e085e378 Merge branch 'main' into localisation 2026-10-17 16:22:29 +02:00
268ed47589 Merge branch 'main' into localisation 2026-10-17 15:59:09 +02:00
03cca64a48 Merge branch 'main' into localisation 2026-10-17 15:51:54 +02:00
e38df0b7e0 Merge branch 'main' into localisation 2026-10-17 15:32:06 +02:00
bf63b790f1 Merge branch 'main' into localisation 2026-10-14 16:41:52 +02:00
358b537cef Merge branch 'main' into localisation 2026-10-08 18:22:13 +02:00
21 changed files with 526 additions and 216 deletions

View file

@ -38,6 +38,37 @@ namespace RacesOfValheim
} }
} }
/// <summary>
/// Hair and beard never attach to an Alfr. Every equipment change makes the game write the
/// profile's hair back (Humanoid.SetupVisEquipment), and ApplyHairless only clears it on its
/// 0.5s pass, so players saw the hair flash in for a moment. Zeroing the hash here, where
/// VisEquipment spawns the model, means it never appears. Covers remote players too, since
/// their visuals go through the same call.
/// </summary>
[HarmonyPatch(typeof(VisEquipment), "SetHairEquipped")]
public static class Alfar_SetHairEquipped_Patch
{
public static void Prefix(VisEquipment __instance, ref int hash)
{
if (hash != 0 && IsAlfarVis(__instance)) hash = 0;
}
}
[HarmonyPatch(typeof(VisEquipment), "SetBeardEquipped")]
public static class Alfar_SetBeardEquipped_Patch
{
public static void Prefix(VisEquipment __instance, ref int hash)
{
if (hash != 0 && IsAlfarVis(__instance)) hash = 0;
}
}
private static bool IsAlfarVis(VisEquipment vis)
{
Player player = vis.GetComponent<Player>();
return player != null && AlfarVisuals.IsAlfarPlayer(player);
}
/// <summary> /// <summary>
/// The character preview on the main menu is a Player too, with the saved race in its custom data /// The character preview on the main menu is a Player too, with the saved race in its custom data
/// and no ZNetView. Its Update may never run, so a small driver on it keeps the look: skin, hair, /// and no ZNetView. Its Update may never run, so a small driver on it keeps the look: skin, hair,

View file

@ -182,35 +182,64 @@ namespace RacesOfValheim
Vector3 direction = aim.forward; Vector3 direction = aim.forward;
float distance = AlfarPowerConfig.SkridDistance.Value; float distance = AlfarPowerConfig.SkridDistance.Value;
if (!Pay(player, AlfarPowerConfig.SkridCost.Value)) return;
// Stop short of whatever is in the way, so the blink never ends inside a wall. // Stop short of whatever is in the way, so the blink never ends inside a wall.
Vector3 destination = origin + direction * distance; Vector3 destination = origin + direction * distance;
RaycastHit[] hits = Physics.RaycastAll(origin, direction, distance, ~0, QueryTriggerInteraction.Ignore); if (NearestHit(player, origin, direction, distance, out RaycastHit wall))
float nearest = float.MaxValue;
foreach (RaycastHit hit in hits)
{ {
if (hit.collider.GetComponentInParent<Player>() == player) continue; destination = wall.point - direction * 0.6f;
if (hit.distance < nearest)
{
nearest = hit.distance;
destination = hit.point - direction * 0.6f;
}
} }
// Back down to the player's own height: the origin was at the chest. // Back down to the player's own height: the origin was at the chest. The floor is found
// with a short ray down from the landing point, never with GetSolidHeight: that one casts
// from 1000 m up, so under any roof (a crypt, a cave, a house) it returned the roof and
// put the Alfr on top of it. A flat 1 m drop also sank the feet under the floor when the
// blink was aimed at it.
const float FloorSearch = 3f;
if (NearestHit(player, destination, Vector3.down, FloorSearch, out RaycastHit floor))
{
destination.y = floor.point.y + 0.05f;
}
else if (player.InInterior())
{
// No floor under the landing point inside a dungeon: it would end in the void the
// dungeon floats in. Cancel before paying.
return;
}
else
{
destination.y -= 1.0f; destination.y -= 1.0f;
if (ZoneSystem.instance != null) if (ZoneSystem.instance != null)
{ {
float ground = ZoneSystem.instance.GetSolidHeight(destination); // Terrain only, so a roof overhead is never mistaken for the ground.
float ground = ZoneSystem.instance.GetGroundHeight(destination);
if (destination.y < ground) destination.y = ground + 0.1f; if (destination.y < ground) destination.y = ground + 0.1f;
} }
}
if (!Pay(player, AlfarPowerConfig.SkridCost.Value)) return;
Teleport(player, destination); Teleport(player, destination);
StartCooldown("skrid", AlfarPowerConfig.SkridCooldown.Value); StartCooldown("skrid", AlfarPowerConfig.SkridCooldown.Value);
AlfarFx.Spawn("fx_JotunWitch_LightningBolt_Explosion", origin); AlfarFx.Spawn("fx_JotunWitch_LightningBolt_Explosion", origin);
} }
/// <summary>The nearest solid hit along a ray, skipping the caster's own colliders.</summary>
private static bool NearestHit(Player player, Vector3 origin, Vector3 direction, float distance, out RaycastHit nearest)
{
nearest = default;
bool found = false;
foreach (RaycastHit hit in Physics.RaycastAll(origin, direction, distance, ~0, QueryTriggerInteraction.Ignore))
{
if (hit.collider.GetComponentInParent<Player>() == player) continue;
if (!found || hit.distance < nearest.distance)
{
nearest = hit;
found = true;
}
}
return found;
}
/// <summary> /// <summary>
/// Moves the body without the teleport fade: the rigidbody is repositioned and its velocity /// Moves the body without the teleport fade: the rigidbody is repositioned and its velocity
/// zeroed, and the fall tracker is reset so a blink up a cliff does not count as a fall. /// zeroed, and the fall tracker is reset so a blink up a cliff does not count as a fall.

View file

@ -931,6 +931,30 @@ namespace RacesOfValheim
} }
} }
/// <summary>
/// Pukeberries empty the fourth stomach too.
///
/// SE_Puke calls RemoveOneFood once a second, and vanilla only ever picks from its own three
/// slots, so the Aswid's fourth meal survived the berries. It now goes into the same random
/// draw as the other three, the way the Trol's extra slots do.
/// </summary>
[HarmonyPatch(typeof(Player), "RemoveOneFood")]
public static class Aswid_PlayerRemoveOneFood_Patch
{
public static bool Prefix(Player __instance, System.Collections.Generic.List<Player.Food> ___m_foods, ref bool __result)
{
if (__instance != Player.m_localPlayer || !AswidRace.IsAswid()) return true;
if (!AswidFoodManager.ExtraFoods.TryGetValue(__instance, out Player.Food extraFood) || extraFood == null) return true;
int vanillaCount = ___m_foods != null ? ___m_foods.Count : 0;
if (Random.Range(0, vanillaCount + 1) < vanillaCount) return true; // one of vanilla's three
AswidFoodManager.ClearFood(__instance);
__result = true;
return false;
}
}
[HarmonyPatch(typeof(Player), "ClearFood")] [HarmonyPatch(typeof(Player), "ClearFood")]
public static class Aswid_Player_ClearFood_Patch public static class Aswid_Player_ClearFood_Patch
{ {

View file

@ -0,0 +1,32 @@
using UnityEngine;
using BepInEx.Configuration;
namespace RacesOfValheim
{
/// <summary>
/// The mod-wide debug switches, in one "Debug" section rather than one per race. Bound last
/// from RacesOfValheim.Awake(), so Configuration Manager lists the section at the bottom.
///
/// Every entry stays local (never synced from the server): ConfigSync leaves KeyboardShortcut
/// entries and any key containing "debug" alone, so keep "Debug" in the key names.
/// </summary>
public static class DebugConfig
{
public static ConfigEntry<bool> EnableDebugKey;
public static ConfigEntry<KeyboardShortcut> DebugKey;
public static ConfigEntry<bool> LogFormHits;
public static void Bind(ConfigFile config)
{
const string section = "Debug";
EnableDebugKey = config.Bind(section, "Debug: Enable Debug Key", false,
new ConfigDescription("Turns on the debug key below. Leave it off unless you are sending a bug report."));
DebugKey = config.Bind(section, "Debug Key", new KeyboardShortcut(KeyCode.F8),
new ConfigDescription("Toggles the melee reach readout (top left and log) and writes what the Alfar drones and the camera's target are doing to the log."));
// Was "Fenrir - Debug" / "Debug: Log Form Hits" until v1.6.10. It covers the Skadi,
// Sverm and Trol forms too (FormMelee.LogHit), so it moved here.
LogFormHits = config.Bind(section, "Debug: Log Form Hits", false,
new ConfigDescription("Writes one log line per form claw, bite or swing: what was in reach, what it hit, and why anything was skipped. For bug reports about attacks that do no damage."));
}
}
}

View file

@ -165,6 +165,10 @@ namespace RacesOfValheim
if (!__result) return; // already not enemies, nothing to add if (!__result) return; // already not enemies, nothing to add
if (a == null || b == null) return; if (a == null || b == null) return;
// The player's own blow. Peace is the creature's choice, not a shield. See
// RaceGrudge.StrikeScope.
if (RaceGrudge.PlayerStrikes(a)) return;
if (IsThrallTruce(a, b) || IsThrallTruce(b, a)) if (IsThrallTruce(a, b) || IsThrallTruce(b, a))
{ {
__result = false; __result = false;

View file

@ -59,8 +59,9 @@ namespace RacesOfValheim
"Without this the truce is absolute in both directions: MonsterAI.UpdateTarget " + "Without this the truce is absolute in both directions: MonsterAI.UpdateTarget " +
"throws away any target BaseAI.IsEnemy calls a non-enemy, so a truced mob could " + "throws away any target BaseAI.IsEnemy calls a non-enemy, so a truced mob could " +
"not fight back even after being struck - it stood still, or fled because it " + "not fight back even after being struck - it stood still, or fled because it " +
"was hurt and had no enemy it was allowed to have. The grudge is per attacker " + "was hurt and had no enemy it was allowed to have. Each creature holds one " +
"and per creature, on whichever machine runs that creature's AI. 0 restores the " + "grudge, against the last player who hit it, and keeps it when another player's " +
"game takes over running that creature. 0 restores the " +
"old absolute truce.", "old absolute truce.",
new AcceptableValueRange<float>(0f, 600f))); new AcceptableValueRange<float>(0f, 600f)));

View file

@ -100,9 +100,6 @@ namespace RacesOfValheim
public static ConfigEntry<float> UlvAttackRadius; public static ConfigEntry<float> UlvAttackRadius;
public static ConfigEntry<float> UlvPushForce; public static ConfigEntry<float> UlvPushForce;
// ─── Debug ─────────────────────────────────────────────────────────────
public static ConfigEntry<bool> DebugFormHits;
// ─── Appearance (per player, never synced) ────────────────────────────── // ─── Appearance (per player, never synced) ──────────────────────────────
public static ConfigEntry<bool> ReadyMessage; public static ConfigEntry<bool> ReadyMessage;
public static ConfigEntry<bool> EyeGlow; public static ConfigEntry<bool> EyeGlow;
@ -268,10 +265,6 @@ namespace RacesOfValheim
// Tried at 1.2 in game: the orange was too strong. 0.9 checked and kept. // Tried at 1.2 in game: the orange was too strong. 0.9 checked and kept.
EyeReadyStrength = config.Bind(appearance, "Eye Ready Strength", 0.9f, EyeReadyStrength = config.Bind(appearance, "Eye Ready Strength", 0.9f,
new ConfigDescription("Glow at night while a form is ready.", new AcceptableValueRange<float>(0f, 3f))); new ConfigDescription("Glow at night while a form is ready.", new AcceptableValueRange<float>(0f, 3f)));
// "debug" in the key keeps it local - see ConfigSync.
DebugFormHits = config.Bind("Fenrir - Debug", "Debug: Log Form Hits", false,
new ConfigDescription("Writes one log line per claw or bite: what was in reach, what it hit, and why anything was skipped. For bug reports about attacks that do no damage."));
} }
/// <summary> /// <summary>

View file

@ -342,7 +342,7 @@ namespace RacesOfValheim
/// </summary> /// </summary>
public static void LogMiss(string form, Collider hit, string reason) public static void LogMiss(string form, Collider hit, string reason)
{ {
if (!FenrirConfig.DebugFormHits.Value) return; if (!DebugConfig.LogFormHits.Value) return;
Jotunn.Logger.LogInfo($"[FenrirForm] {form} swing skipped '{hit.name}' (layer {LayerMask.LayerToName(hit.gameObject.layer)}): {reason}."); Jotunn.Logger.LogInfo($"[FenrirForm] {form} swing skipped '{hit.name}' (layer {LayerMask.LayerToName(hit.gameObject.layer)}): {reason}.");
} }
@ -413,16 +413,37 @@ namespace RacesOfValheim
return true; return true;
} }
private static readonly System.Collections.Generic.Dictionary<string, ItemDrop.ItemData.SharedData> weapons =
new System.Collections.Generic.Dictionary<string, ItemDrop.ItemData.SharedData>();
/// <summary>
/// A creature's own attack item (dragon_bite, SeekerBrute_ram...), read once and cached,
/// null if the game has none by that name. A hand-built swing skips Attack, and Attack is
/// where vanilla plays the item's m_triggerEffect and m_hitEffect, so a form that wants the
/// creature's real swing and impact sounds plays them from here.
/// </summary>
public static ItemDrop.ItemData.SharedData CreatureWeapon(string prefabName)
{
if (string.IsNullOrEmpty(prefabName)) return null;
if (weapons.TryGetValue(prefabName, out ItemDrop.ItemData.SharedData cached)) return cached;
GameObject prefab = Jotunn.Managers.PrefabManager.Cache.GetPrefab<GameObject>(prefabName);
ItemDrop.ItemData.SharedData shared = prefab != null ? prefab.GetComponent<ItemDrop>()?.m_itemData?.m_shared : null;
if (shared == null) Jotunn.Logger.LogWarning($"[FormMelee] No attack item '{prefabName}'; that swing stays silent.");
weapons[prefabName] = shared;
return shared;
}
public static void LogHit(string form, IDestructible target, float damage) public static void LogHit(string form, IDestructible target, float damage)
{ {
if (!FenrirConfig.DebugFormHits.Value) return; if (!DebugConfig.LogFormHits.Value) return;
string name = target is MonoBehaviour behaviour && behaviour != null ? behaviour.name : target.ToString(); string name = target is MonoBehaviour behaviour && behaviour != null ? behaviour.name : target.ToString();
Jotunn.Logger.LogInfo($"[FenrirForm] {form} swing hit '{name}' for {damage:0}."); Jotunn.Logger.LogInfo($"[FenrirForm] {form} swing hit '{name}' for {damage:0}.");
} }
public static void LogSwing(string form, int candidates) public static void LogSwing(string form, int candidates)
{ {
if (!FenrirConfig.DebugFormHits.Value) return; if (!DebugConfig.LogFormHits.Value) return;
Jotunn.Logger.LogInfo($"[FenrirForm] {form} swing: {candidates} collider(s) in reach."); Jotunn.Logger.LogInfo($"[FenrirForm] {form} swing: {candidates} collider(s) in reach.");
} }
} }

View file

@ -1,7 +1,7 @@
{ {
"name": "RacesOfValheim", "name": "RacesOfValheim",
"description": "A Valheim mod that adds eleven custom playable races (Alfar, 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 eleven custom playable races (Alfar, 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.6.8", "version_number": "1.6.11",
"website_url": "", "website_url": "",
"dependencies": [ "dependencies": [
"denikson-BepInExPack_Valheim-5.4.2333", "denikson-BepInExPack_Valheim-5.4.2333",

View file

@ -25,11 +25,13 @@ namespace RacesOfValheim
/// which means everything downstream - acquiring, chasing, retaliating, giving up - is vanilla /// which means everything downstream - acquiring, chasing, retaliating, giving up - is vanilla
/// behaviour rather than anything reimplemented here. /// behaviour rather than anything reimplemented here.
/// ///
/// WHERE IT RUNS. On the client that owns the mob's AI, which is the only one whose UpdateTarget /// WHERE IT LIVES. On the creature's own ZDO: who it is angry at and until when, in network time.
/// matters and the only one that runs Character.ApplyDamage for it. BaseAI.OnDamaged is reached /// The AI that reads it runs on whichever machine owns the creature, and that can change in the
/// through the character's damage callback on exactly that machine, so the record is made where /// middle of a fight (the owner walks off or logs out). A grudge kept in one machine's memory
/// it will be read. Nothing is replicated and nothing needs to be: another client's copy of the /// went with it, and the new owner's copy of the creature made peace on its next UpdateTarget.
/// same mob is not the one deciding who it chases. /// On the ZDO the new owner reads the same grudge. Only the owner writes it: a hit reaches the
/// owner through Character.Damage's RPC anyway, and kin owned elsewhere are told by an RPC of
/// our own (RpcName), so no client writes a ZDO it does not own.
/// ///
/// Vanilla has its own version of this idea in BaseAI.SetAggravated, and it is not usable here: /// Vanilla has its own version of this idea in BaseAI.SetAggravated, and it is not usable here:
/// it does nothing unless the prefab sets m_aggravatable, which only the dvergr and the seekers /// it does nothing unless the prefab sets m_aggravatable, which only the dvergr and the seekers
@ -37,67 +39,96 @@ namespace RacesOfValheim
/// </summary> /// </summary>
public static class RaceGrudge public static class RaceGrudge
{ {
private struct Grudge private const string RpcName = "RacesOfValheim_Grudge";
{
public ZDOID Attacker;
public float Until;
}
// One grudge per mob, against the last thing that hit it. A creature can only chase one // One grudge per creature, against the last player that hit it. A creature can only chase
// target anyway, and if two players of the same race are both poking it, the one it wants // one target anyway, and if two players of the same race are both poking it, the one it
// is whoever hit it last. // wants is whoever hit it last.
private static readonly Dictionary<ZDOID, Grudge> grudges = new Dictionary<ZDOID, Grudge>(); private static readonly KeyValuePair<int, int> AttackerKey = ZDO.GetHashZDOID("RacesOfValheim_GrudgeAttacker");
private static float lastSweep = 0f; private static readonly int UntilKey = "RacesOfValheim_GrudgeUntil".GetStableHashCode();
private static float Duration => FactionsConfig.GrudgeSeconds; private static float Duration => FactionsConfig.GrudgeSeconds;
// Network time, the same on every machine, so an end time written by one owner means the
// same thing to the next. Milliseconds in a long: ZDO has no double.
private static long NowMs => ZNet.instance != null ? (long)(ZNet.instance.GetTimeSeconds() * 1000.0) : 0L;
private static ZDO ZdoOf(Character character)
{
if (character == null || ZDOMan.instance == null) return null;
ZDOID id = character.GetZDOID();
return id.IsNone() ? null : ZDOMan.instance.GetZDO(id);
}
/// <summary> /// <summary>
/// True while <paramref name="monster"/> is owed a hit by <paramref name="player"/>. Both /// True while <paramref name="monster"/> is owed a hit by <paramref name="player"/>. Both
/// truce postfixes ask this first and leave IsEnemy alone when it answers yes. /// truce postfixes ask this first and leave IsEnemy alone when it answers yes. Read on any
/// machine; it only matters on the owner's.
/// </summary> /// </summary>
public static bool Holds(Character monster, Character player) public static bool Holds(Character monster, Character player)
{ {
if (monster == null || player == null) return false; if (monster == null || player == null) return false;
if (Duration <= 0f) return false; if (Duration <= 0f) return false;
if (!grudges.TryGetValue(monster.GetZDOID(), out Grudge grudge)) return false; ZDO zdo = ZdoOf(monster);
if (Time.time >= grudge.Until) return false; if (zdo == null) return false;
return grudge.Attacker == player.GetZDOID(); long until = zdo.GetLong(UntilKey, 0L);
} if (until == 0L || NowMs >= until) return false;
public static void Remember(Character monster, Character attacker) return zdo.GetZDOID(AttackerKey) == player.GetZDOID();
{
if (monster == null || attacker == null) return;
if (Duration <= 0f) return;
grudges[monster.GetZDOID()] = new Grudge
{
Attacker = attacker.GetZDOID(),
Until = Time.time + Duration
};
Sweep();
} }
/// <summary> /// <summary>
/// Drops grudges nobody is owed any more. At most once per duration: a fight is a burst of /// Writes the grudge on the creature's ZDO if this machine owns it, and otherwise asks the
/// damage events and the list should not be walked on each one. /// owner to. Returns true when it was written here.
/// </summary> /// </summary>
private static void Sweep() public static bool Remember(Character monster, Character attacker)
{ {
if (Time.time - lastSweep < Duration) return; if (monster == null || attacker == null) return false;
lastSweep = Time.time; if (Duration <= 0f) return false;
List<ZDOID> expired = null; ZNetView nview = monster.GetComponent<ZNetView>();
foreach (var entry in grudges) if (nview == null || !nview.IsValid()) return false;
if (!nview.IsOwner())
{ {
if (Time.time < entry.Value.Until) continue; nview.InvokeRPC(RpcName, attacker.GetZDOID());
if (expired == null) expired = new List<ZDOID>(); return false;
expired.Add(entry.Key); }
Write(nview.GetZDO(), attacker.GetZDOID());
return true;
}
private static void Write(ZDO zdo, ZDOID attacker)
{
zdo.Set(AttackerKey, attacker);
zdo.Set(UntilKey, NowMs + (long)(Duration * 1000f));
}
/// <summary>
/// Every creature can be told about a grudge by a machine that does not own it. ZNetView's
/// InvokeRPC routes to the owner, so the handler always runs where the ZDO may be written,
/// and the owner checks it is still the owner: ownership can move while the RPC travels.
/// </summary>
[HarmonyPatch(typeof(Character), "Awake")]
public static class Character_Awake_GrudgeRpc_Patch
{
public static void Postfix(Character __instance)
{
if (__instance.IsPlayer()) return;
ZNetView nview = __instance.GetComponent<ZNetView>();
if (nview == null || !nview.IsValid()) return;
nview.Register<ZDOID>(RpcName, (sender, attacker) =>
{
if (__instance == null || !nview.IsValid() || !nview.IsOwner()) return;
if (attacker.IsNone() || Duration <= 0f) return;
Write(nview.GetZDO(), attacker);
__instance.GetBaseAI()?.Alert();
});
} }
if (expired == null) return;
foreach (ZDOID id in expired) grudges.Remove(id);
} }
/// <summary> /// <summary>
@ -125,14 +156,62 @@ namespace RacesOfValheim
} }
} }
// How deep we are inside one of vanilla's hit filters (see StrikeScope). A counter rather
// than a bool because Projectile.OnHit calls DoAOE, and the inner exit must not end the
// outer scope.
private static int strikeDepth = 0;
/// <summary>
/// True while vanilla is deciding whether <paramref name="attacker"/>'s own weapon, arrow or
/// area hit lands. Both truce postfixes stand down for that question: the truce is about
/// who a creature attacks, never about whether the player is allowed to strike it.
/// </summary>
public static bool PlayerStrikes(Character attacker)
{
return strikeDepth > 0 && attacker != null && attacker.IsPlayer();
}
/// <summary>
/// THE PLAYER COULD NOT HIT THEIR OWN FACTION AT ALL. Valheim 1.0's hit filters (Attack's
/// melee and area swings, Projectile's direct hit, its AoE and its IsValidTarget, Aoe's
/// ShouldHit) ask BaseAI.IsEnemy(attacker, target) and skip the target when it answers false
/// and the attacker is a player without PvP on - vanilla's guard for tames. Our truce
/// answers false for every allied creature, so the blow passed through it, it took no
/// damage, BaseAI.OnDamaged never ran and no grudge was ever born. That is both reports at
/// once: "it will not allow me" to attack, and kin that never fight back, group grudge on or
/// off, because nobody was ever hit. With PvP on the filter let the hit through, which is
/// why it looked fine in some tests.
///
/// The scope is open only around those six methods, so everything else that asks IsEnemy
/// with the player first keeps the truce: the green health bar on allied creatures, sneaking
/// past them, the Aswid's aura leaving kin alone.
/// </summary>
[HarmonyPatch]
public static class StrikeScope
{
public static IEnumerable<System.Reflection.MethodBase> TargetMethods()
{
yield return AccessTools.Method(typeof(Attack), "DoMeleeAttack");
yield return AccessTools.Method(typeof(Attack), "DoAreaAttack");
yield return AccessTools.Method(typeof(Projectile), "DoAOE");
yield return AccessTools.Method(typeof(Projectile), "IsValidTarget");
yield return AccessTools.Method(typeof(Projectile), "OnHit");
yield return AccessTools.Method(typeof(Aoe), "ShouldHit");
}
public static void Prefix() => strikeDepth++;
// Finalizer rather than Postfix: the count has to come down even when the method
// throws, or every IsEnemy afterwards would ignore the truce.
public static void Finalizer() => strikeDepth--;
}
/// <summary> /// <summary>
/// Vanilla's Dvergr camp, for every faction ("Grudge spreads to kin", off by default): hit /// Vanilla's Dvergr camp, for every faction ("Grudge spreads to kin", off by default): hit
/// a creature that is at peace with you and its kin around it take up the same grudge. /// a creature that is at peace with you and its kin around it take up the same grudge.
/// ///
/// Only the creatures this machine runs the AI for are told, because a grudge is read where /// Kin this machine owns are written here; kin owned by another player's machine are told
/// the AI runs (see WHERE IT RUNS above). The creatures around the one that was hit are /// through RpcName, and their owner writes the grudge and alerts them.
/// nearly always simulated by the same client; one owned by another player's machine stays
/// at peace until it is hit itself.
/// </summary> /// </summary>
private static void SpreadToKin(Character monster, Player player) private static void SpreadToKin(Character monster, Player player)
{ {
@ -144,12 +223,10 @@ namespace RacesOfValheim
foreach (Character other in Character.GetAllCharacters()) foreach (Character other in Character.GetAllCharacters())
{ {
if (other == null || other == monster || other.IsPlayer() || other.IsDead() || other.IsTamed()) continue; if (other == null || other == monster || other.IsPlayer() || other.IsDead() || other.IsTamed()) continue;
if (!other.IsOwner()) continue;
if (Vector3.Distance(other.transform.position, center) > radius) continue; if (Vector3.Distance(other.transform.position, center) > radius) continue;
if (!FactionHostilityPatch.IsAlliedMob(race, other.gameObject.name)) continue; if (!FactionHostilityPatch.IsAlliedMob(race, other.gameObject.name)) continue;
Remember(other, player); if (Remember(other, player)) other.GetBaseAI()?.Alert();
other.GetBaseAI()?.Alert();
} }
} }
} }

View file

@ -22,6 +22,9 @@ namespace RacesOfValheim
if (a == null || b == null) return; if (a == null || b == null) return;
// The player's own blow lands on kin too. See RaceGrudge.StrikeScope.
if (RaceGrudge.PlayerStrikes(a)) return;
Character playerCharacter = a.IsPlayer() ? a : (b.IsPlayer() ? b : null); Character playerCharacter = a.IsPlayer() ? a : (b.IsPlayer() ? b : null);
Character monster = a.IsPlayer() ? b : (b.IsPlayer() ? a : null); Character monster = a.IsPlayer() ? b : (b.IsPlayer() ? a : null);

View file

@ -115,13 +115,14 @@ namespace RacesOfValheim
} }
} }
/// <summary>F8 turns the reach readout on and off.</summary> /// <summary>The debug key (DebugConfig, F8 by default) turns the reach readout on and off.</summary>
[HarmonyPatch(typeof(Player), "Update")] [HarmonyPatch(typeof(Player), "Update")]
internal static class RaceMeleeReachDebugKey internal static class RaceMeleeReachDebugKey
{ {
private static void Postfix(Player __instance) private static void Postfix(Player __instance)
{ {
if (__instance != Player.m_localPlayer || !Input.GetKeyDown(KeyCode.F8)) return; if (__instance != Player.m_localPlayer || !DebugConfig.EnableDebugKey.Value) return;
if (!DebugConfig.DebugKey.Value.IsDownIgnoringHeldKeys()) return;
RaceMeleeReach.DebugOn = !RaceMeleeReach.DebugOn; RaceMeleeReach.DebugOn = !RaceMeleeReach.DebugOn;
__instance.Message(MessageHud.MessageType.TopLeft, $"[RoV reach] debug {(RaceMeleeReach.DebugOn ? "on" : "off")}"); __instance.Message(MessageHud.MessageType.TopLeft, $"[RoV reach] debug {(RaceMeleeReach.DebugOn ? "on" : "off")}");
AlfarMiner.DebugReport(__instance); AlfarMiner.DebugReport(__instance);

View file

@ -16,7 +16,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.6.8"; public const string PluginVersion = "1.6.11";
private readonly Harmony harmony = new Harmony(PluginGUID); private readonly Harmony harmony = new Harmony(PluginGUID);
@ -57,6 +57,8 @@ namespace RacesOfValheim
// Not a race either: the faction truce and the faction merchants, which cut across // Not a race either: the faction truce and the faction merchants, which cut across
// every race at once, so they bind last rather than inside the alphabetical run above. // every race at once, so they bind last rather than inside the alphabetical run above.
FactionsConfig.Bind(Config); FactionsConfig.Bind(Config);
// The mod-wide debug switches, at the bottom of the list on purpose.
DebugConfig.Bind(Config);
// After every Bind above: tags the gameplay entries for Jotunn's server-to-client sync. // After every Bind above: tags the gameplay entries for Jotunn's server-to-client sync.
ConfigSync.Apply(Config); ConfigSync.Apply(Config);
harmony.PatchAll(); harmony.PatchAll();

View file

@ -311,6 +311,29 @@ namespace RacesOfValheim
return true; return true;
} }
/// <summary>
/// How many hit events the form's clips have sent: the dragon's own "Hit" event, which
/// CharacterAnimEvent hands to the player's OnAttackTrigger and SkadiBlockAttackTriggerPatch
/// counts here instead of letting it through. FenrirForms.AttackEvents, the same idea.
/// </summary>
public static int AttackEvents { get; private set; }
public static void NotifyAttackTrigger() => AttackEvents++;
// Longest a melee waits for its Hit event before landing anyway, from the trigger. The
// slowest blow is the Moder's claw at 2.0 s of 3.75 s; a clip that never sends one must
// not leave the swing hitting nothing.
private const float HitEventTimeout = 3f;
/// <summary>
/// Waits for the clip's own blow. A fixed 0.5 s used to land every melee early, read off the
/// game's clips: Moder bite 0.60 s and claws 2.0 s, Fader bite 1.27 s, claws 1.24 s, spin 1.30 s.
/// </summary>
private IEnumerator WaitForHit(int baseline, float started)
{
while (AttackEvents == baseline && Time.time - started < HitEventTimeout) yield return null;
}
private IEnumerator PerformAttackCoroutine(int button) private IEnumerator PerformAttackCoroutine(int button)
{ {
lastAttackTime = Time.time; lastAttackTime = Time.time;
@ -409,13 +432,18 @@ namespace RacesOfValheim
breathingUntil = Time.time + projDelay + projCount * 0.05f + 0.5f; breathingUntil = Time.time + projDelay + projCount * 0.05f + 0.5f;
} }
int hitBaseline = AttackEvents;
float triggeredAt = Time.time;
SetAttackTrigger(attackTrigger); SetAttackTrigger(attackTrigger);
yield return new WaitForSeconds(projDelay);
if (isMelee) if (isMelee)
{ {
ExecuteMeleeDamage(MODER_MELEE_DAMAGE, MELEE_RADIUS); yield return WaitForHit(hitBaseline, triggeredAt);
ExecuteMeleeDamage(MODER_MELEE_DAMAGE, MELEE_RADIUS, MeleeWeapon(attackTrigger));
}
else
{
yield return new WaitForSeconds(projDelay);
} }
if (!isMelee && projName != null) if (!isMelee && projName != null)
@ -515,13 +543,18 @@ namespace RacesOfValheim
breathingUntil = Time.time + projDelay + projCount * 0.05f + 0.5f; breathingUntil = Time.time + projDelay + projCount * 0.05f + 0.5f;
} }
int hitBaseline = AttackEvents;
float triggeredAt = Time.time;
SetAttackTrigger(attackTrigger); SetAttackTrigger(attackTrigger);
yield return new WaitForSeconds(projDelay);
if (isMelee) if (isMelee)
{ {
ExecuteMeleeDamage(meleeDamage, meleeRadius); yield return WaitForHit(hitBaseline, triggeredAt);
ExecuteMeleeDamage(meleeDamage, meleeRadius, MeleeWeapon(attackTrigger));
}
else
{
yield return new WaitForSeconds(projDelay);
} }
if (!isMelee && projName != null) if (!isMelee && projName != null)
@ -583,7 +616,28 @@ namespace RacesOfValheim
// The dragon forms never go through Humanoid.StartAttack - SkadiAttackPatch blocks it, and // The dragon forms never go through Humanoid.StartAttack - SkadiAttackPatch blocks it, and
// they carry no weapon - so the bite, claw and spin animations landed no damage at all and // they carry no weapon - so the bite, claw and spin animations landed no damage at all and
// simply burned eitr. Sweep for targets the way FenrirBehaviors does for its claws. // simply burned eitr. Sweep for targets the way FenrirBehaviors does for its claws.
private void ExecuteMeleeDamage(float baseDamage, float radius) private string FormLabel => formRules != null ? formRules.Form.ToString() : "Skadi form";
/// <summary>
/// The real creature's attack item behind each melee trigger, for its impact sound. The
/// Fader's spin has no item of its own in the game's manifest, so it borrows the claw's.
/// </summary>
private string MeleeWeapon(string trigger)
{
bool fader = formRules != null && formRules.Form == SkadiProgression.FormType.SkeletonDragon;
switch (trigger)
{
case "attack_bite": return fader ? "Fader_Bite" : "dragon_bite";
case "attack_claw_left": return "dragon_claw_left";
case "attack_claw_right": return "dragon_claw_right";
case "attack_ClawL": return "Fader_Claw_Left";
case "attack_ClawR": return "Fader_Claw_Right";
case "attack_Spin": return "Fader_Claw_Left";
default: return null;
}
}
private void ExecuteMeleeDamage(float baseDamage, float radius, string weapon)
{ {
if (Player.m_localPlayer == null) return; if (Player.m_localPlayer == null) return;
@ -598,6 +652,8 @@ namespace RacesOfValheim
int layerMask = LayerMask.GetMask("Default", "static_solid", "Default_small", "piece", "piece_nonsolid", "terrain", "character", "character_net", "character_ghost", "hitbox", "character_noenv", "vehicle"); int layerMask = LayerMask.GetMask("Default", "static_solid", "Default_small", "piece", "piece_nonsolid", "terrain", "character", "character_net", "character_ghost", "hitbox", "character_noenv", "vehicle");
Collider[] hits = Physics.OverlapSphere(attackPoint, radius, layerMask); Collider[] hits = Physics.OverlapSphere(attackPoint, radius, layerMask);
FormMelee.LogSwing(FormLabel, hits.Length);
ItemDrop.ItemData.SharedData shared = FormMelee.CreatureWeapon(weapon);
System.Collections.Generic.HashSet<GameObject> hitObjects = new System.Collections.Generic.HashSet<GameObject>(); System.Collections.Generic.HashSet<GameObject> hitObjects = new System.Collections.Generic.HashSet<GameObject>();
bool hitCreature = false; bool hitCreature = false;
@ -613,18 +669,29 @@ namespace RacesOfValheim
if (characterTarget != null && characterTarget == Player.m_localPlayer) continue; if (characterTarget != null && characterTarget == Player.m_localPlayer) continue;
GameObject targetObj = (target as MonoBehaviour)?.gameObject; GameObject targetObj = (target as MonoBehaviour)?.gameObject;
if (targetObj != null) // Marked only once it is hit, further down: marking it here let the first collider
{ // found (a limb outside the arc) rule out a body squarely in the swing.
if (hitObjects.Contains(targetObj)) continue; if (targetObj != null && hitObjects.Contains(targetObj)) continue;
hitObjects.Add(targetObj);
}
Vector3 targetCenter = hit.bounds.center; Vector3 targetCenter = hit.bounds.center;
Vector3 dirToTarget = (targetCenter - playerPos).normalized; Vector3 dirToTarget = (targetCenter - playerPos).normalized;
if (!fullCircle && Vector3.Angle(forward, dirToTarget) >= 70f) continue; float angle = Vector3.Angle(forward, dirToTarget);
if (!fullCircle && angle >= 70f)
{
FormMelee.LogMiss(FormLabel, hit, $"outside the swing arc ({angle:0} deg)");
continue;
}
// FormMelee.CanReach, not a bare Linecast. The Linecast tested the piece layer and
// counted the target's own collider as cover, so anything living on that layer
// could never be hit: the T.W.I.G. training dummy is a Humanoid whose only collider
// is on "piece". Wildlife sits on "character" and was never affected.
Vector3 eyePos = playerPos + Vector3.up * 1.5f; Vector3 eyePos = playerPos + Vector3.up * 1.5f;
if (Physics.Linecast(eyePos, targetCenter, out RaycastHit rayHit, LayerMask.GetMask("Default", "static_solid", "terrain", "piece"))) continue; if (!FormMelee.CanReach(eyePos, attackPoint, hit, target, out string cover))
{
FormMelee.LogMiss(FormLabel, hit, "no clear line, blocked by '" + cover + "'");
continue;
}
HitData hitData = new HitData(); HitData hitData = new HitData();
// Frost-flavoured maul; SkadiDamagePatch tops this up with the per-tier frost bonus. // Frost-flavoured maul; SkadiDamagePatch tops this up with the per-tier frost bonus.
@ -640,8 +707,11 @@ namespace RacesOfValheim
hitData.m_toolTier = 0; hitData.m_toolTier = 0;
hitData.SetAttacker(Player.m_localPlayer); hitData.SetAttacker(Player.m_localPlayer);
if (targetObj != null) hitObjects.Add(targetObj);
FormMelee.LogHit(FormLabel, target, totalDamage);
target.Damage(hitData); target.Damage(hitData);
FormMelee.GrantAdrenaline(target); FormMelee.GrantAdrenaline(target);
shared?.m_hitEffect.Create(targetCenter, Quaternion.identity);
if (characterTarget != null) hitCreature = true; if (characterTarget != null) hitCreature = true;
} }

View file

@ -408,7 +408,11 @@ namespace RacesOfValheim
public static bool Prefix(Humanoid __instance) public static bool Prefix(Humanoid __instance)
{ {
if (__instance != Player.m_localPlayer) return true; if (__instance != Player.m_localPlayer) return true;
return __instance.GetComponentInChildren<DrakeFormBehavior>() == null; if (__instance.GetComponentInChildren<DrakeFormBehavior>() == null) return true;
// The dragon's own clip calling its blow: the hit cue for the form's melee.
DrakeFormBehavior.NotifyAttackTrigger();
return false;
} }
} }
} }

View file

@ -252,97 +252,6 @@ namespace RacesOfValheim
return bestCombo; return bestCombo;
} }
private void DumpTransformHierarchy(Transform t, string indent)
{
if (t == null) return;
Jotunn.Logger.LogInfo(indent + t.name + " (Active: " + t.gameObject.activeSelf + ")");
for(int i = 0; i < t.childCount; i++)
{
DumpTransformHierarchy(t.GetChild(i), indent + " ");
}
}
/// <summary>
/// F8 debug: fires a ray from the camera and logs whatever it hits. Cosmetic pieces
/// (hair, beard, helmet) carry no collider, so this mostly confirms terrain/creature hits
/// - LogHeadCosmeticsState below is what actually answers "what is that floating chunk."
/// Kept anyway because it is the general-purpose "what am I looking at" tool for any other
/// bone or prefab placement question that comes up later.
/// </summary>
private void LogRaycastHit()
{
Camera cam = Camera.main;
if (cam == null)
{
Jotunn.Logger.LogInfo("[F8] No camera found for raycast.");
return;
}
Ray ray = new Ray(cam.transform.position, cam.transform.forward);
if (Physics.Raycast(ray, out RaycastHit hit, 50f))
{
Jotunn.Logger.LogInfo("--- F8 RAYCAST HIT ---");
Jotunn.Logger.LogInfo($"Collider: '{hit.collider.gameObject.name}' at {hit.point:F2}, distance={hit.distance:F2}");
Jotunn.Logger.LogInfo($"Full path: {GetFullPath(hit.collider.transform)}");
Renderer renderer = hit.collider.GetComponentInParent<Renderer>();
if (renderer != null)
{
Jotunn.Logger.LogInfo($"Nearest renderer: '{renderer.gameObject.name}' ({renderer.GetType().Name}), enabled={renderer.enabled}, scale={renderer.transform.lossyScale:F3}");
}
Jotunn.Logger.LogInfo("----------------------");
}
else
{
Jotunn.Logger.LogInfo("[F8] Raycast hit nothing within 50m (cosmetic pieces usually have no collider anyway).");
}
}
private static string GetFullPath(Transform t)
{
string path = t.name;
for (Transform parent = t.parent; parent != null; parent = parent.parent)
{
path = parent.name + "/" + path;
}
return path;
}
/// <summary>
/// F8 debug: dumps the exact state of the three item slots this race hides (hair, beard,
/// helmet) - active flag, renderer enabled flag and scale for every renderer underneath.
/// This is the direct answer to "what is still visible and why": a chunk that survives
/// hiding will show up here as active=true, or as a renderer with enabled=true even while
/// its wrapper is scaled to zero (the skinned-mesh case scale alone cannot hide).
/// </summary>
private void LogHeadCosmeticsState()
{
if (Player.m_localPlayer == null) return;
VisEquipment vis = Player.m_localPlayer.GetComponent<VisEquipment>();
if (vis == null) return;
Jotunn.Logger.LogInfo("--- F8 SKELETON HEAD COSMETICS ---");
DumpItemInstanceField(vis, "m_hairItemInstance");
DumpItemInstanceField(vis, "m_beardItemInstance");
DumpItemInstanceField(vis, "m_helmetItemInstance");
Jotunn.Logger.LogInfo("----------------------------------");
}
private static void DumpItemInstanceField(VisEquipment vis, string fieldName)
{
GameObject go = HarmonyLib.Traverse.Create(vis).Field<GameObject>(fieldName).Value;
if (go == null)
{
Jotunn.Logger.LogInfo($"[F8] {fieldName}: null (nothing equipped/instantiated).");
return;
}
Jotunn.Logger.LogInfo($"[F8] {fieldName}: '{go.name}' active={go.activeSelf} scale={go.transform.localScale:F3}");
foreach (Renderer r in go.GetComponentsInChildren<Renderer>(true))
{
Jotunn.Logger.LogInfo($"[F8] renderer '{r.gameObject.name}' ({r.GetType().Name}) enabled={r.enabled}");
}
}
private void Update() private void Update()
{ {
if (Player.m_localPlayer == null) return; if (Player.m_localPlayer == null) return;

View file

@ -46,6 +46,7 @@ namespace RacesOfValheim
public static ConfigEntry<float> RavagerYawDegrees; public static ConfigEntry<float> RavagerYawDegrees;
public static ConfigEntry<float> RavagerAttackOffsetValue; public static ConfigEntry<float> RavagerAttackOffsetValue;
public static ConfigEntry<bool> RavagerSlamCraterValue; public static ConfigEntry<bool> RavagerSlamCraterValue;
public static ConfigEntry<float> RavagerDamageShareValue;
// ─── Colony caps ───────────────────────────────────────────────────── // ─── Colony caps ─────────────────────────────────────────────────────
// Every ceiling on how many things the colony can have alive at once, in one section, so // Every ceiling on how many things the colony can have alive at once, in one section, so
@ -231,6 +232,11 @@ namespace RacesOfValheim
"The middle-click slam digs into the ground where it lands, like a pickaxe blow. " + "The middle-click slam digs into the ground where it lands, like a pickaxe blow. " +
"Never inside a ward you have no access to."); "Never inside a ward you have no access to.");
RavagerDamageShareValue = config.Bind(ravager, "Ravager Attack Damage", 1f,
new ConfigDescription("Share of a real Seeker Brute's damage each Ravager attack deals. " +
"Your Unarmed skill then scales it the way it scales a weapon: about 40% at level 0, " +
"about 92% at level 100.", new AcceptableValueRange<float>(0.1f, 2f)));
EmberGlowStrength = config.Bind(ember, "Glow Strength", SvermConfig.EmberGlowStrength, EmberGlowStrength = config.Bind(ember, "Glow Strength", SvermConfig.EmberGlowStrength,
"How hot the chitin burns at Fader. This multiplies an HDR colour and it is applied " + "How hot the chitin burns at Fader. This multiplies an HDR colour and it is applied " +
"to the chest, the legs and the helmet at once, so it goes a very long way. Settled " + "to the chest, the legs and the helmet at once, so it goes a very long way. Settled " +
@ -364,6 +370,7 @@ namespace RacesOfValheim
public static float RavagerYaw => RavagerYawDegrees?.Value ?? 0f; public static float RavagerYaw => RavagerYawDegrees?.Value ?? 0f;
public static float RavagerAttackOffset => RavagerAttackOffsetValue?.Value ?? 1.5f; public static float RavagerAttackOffset => RavagerAttackOffsetValue?.Value ?? 1.5f;
public static bool RavagerSlamCrater => RavagerSlamCraterValue?.Value ?? true; public static bool RavagerSlamCrater => RavagerSlamCraterValue?.Value ?? true;
public static float RavagerDamageShare => RavagerDamageShareValue?.Value ?? 1f;
public static bool Spines => SpinesEnabled?.Value ?? false; public static bool Spines => SpinesEnabled?.Value ?? false;
public static float SizeSmall => SpineSizeSmall?.Value ?? SvermConfig.SpineSizeSmall; public static float SizeSmall => SpineSizeSmall?.Value ?? SvermConfig.SpineSizeSmall;

View file

@ -24,6 +24,29 @@ namespace RacesOfValheim
{ {
public string Trigger; public string Trigger;
public HitData.DamageTypes Damage; public HitData.DamageTypes Damage;
/// <summary>The Brute weapon itself, for its swing (m_triggerEffect) and impact
/// (m_hitEffect) sounds. Vanilla plays both inside Attack, which this form never runs,
/// so without them every hit landed silent. Null if the weapon was missing.</summary>
public ItemDrop.ItemData.SharedData Shared;
/// <summary>The weapon's own push (m_attackForce), tool tier and swing arc, the way
/// TrolTrueFormModel.Profile carries the troll's.</summary>
public float PushForce;
public int ToolTier;
public float Angle;
}
/// <summary>
/// One blow's damage: the Brute's, times Ravager Attack Damage, times the Unarmed skill
/// factor the way a weapon's skill scales it (0.25-0.55 at level 0, 0.85-1 at 100).
/// TrolTrueFormModel.DamageFor does the same with Clubs for the troll.
/// </summary>
public static HitData.DamageTypes DamageFor(Player player, Profile profile)
{
HitData.DamageTypes damage = profile.Damage.Clone();
damage.Modify(SvermConfigManagement.RavagerDamageShare * player.GetRandomSkillFactor(Skills.SkillType.Unarmed));
return damage;
} }
private static Profile bite; private static Profile bite;
@ -72,6 +95,10 @@ namespace RacesOfValheim
{ {
Trigger = shared.m_attack != null ? (shared.m_attack.m_attackAnimation ?? "") : "", Trigger = shared.m_attack != null ? (shared.m_attack.m_attackAnimation ?? "") : "",
Damage = shared.m_damages, Damage = shared.m_damages,
Shared = shared,
PushForce = shared.m_attackForce,
ToolTier = shared.m_toolTier,
Angle = shared.m_attack != null ? shared.m_attack.m_attackAngle : 90f,
}; };
Jotunn.Logger.LogInfo($"[Sverm] Ravager Strain reads '{profile.Trigger}' off '{sourcePrefabName}' - " + Jotunn.Logger.LogInfo($"[Sverm] Ravager Strain reads '{profile.Trigger}' off '{sourcePrefabName}' - " +

View file

@ -794,7 +794,7 @@ namespace RacesOfValheim
{ {
if (FormStagger.AttackInterrupted) return; if (FormStagger.AttackInterrupted) return;
if (slam) Slam(profile, radius, leftY, rightY, dropSamples); if (slam) Slam(profile, radius, leftY, rightY, dropSamples);
else ExecuteDamage(profile, radius); else ExecuteDamage(profile, radius, false);
}, () => }, () =>
{ {
if (leftClaw == null || rightClaw == null) return; if (leftClaw == null || rightClaw == null) return;
@ -828,7 +828,11 @@ namespace RacesOfValheim
{ {
Player player = Player.m_localPlayer; Player player = Player.m_localPlayer;
if (player != null) if (player != null)
ApplyDamageInSphere(player.transform.position + Vector3.up, SvermConfig.RavagerTauntRadius, profile.Damage); {
// No Strike: the roar above is the taunt's sound, the weapon's would double it.
if (ApplyDamageInSphere(player.transform.position + Vector3.up, SvermConfig.RavagerTauntRadius, profile, true))
FormMelee.RaiseSkill(Skills.SkillType.Unarmed);
}
}, null); }, null);
isAttacking = false; isAttacking = false;
@ -844,6 +848,11 @@ namespace RacesOfValheim
{ {
if (hasForwardSpeed) anim.SetFloat("forward_speed", 0f); if (hasForwardSpeed) anim.SetFloat("forward_speed", 0f);
// The Brute weapon's swing sound, which vanilla plays in Attack.Start (the bite's
// snap, the ram's charge, the slam's wind-up). The taunt's weapon has none.
Player player = Player.m_localPlayer;
if (player != null) profile.Shared?.m_startEffect.Create(player.transform.position, player.transform.rotation, player.transform);
if (string.IsNullOrEmpty(profile.Trigger) || !knownTriggers.Contains(profile.Trigger)) return false; if (string.IsNullOrEmpty(profile.Trigger) || !knownTriggers.Contains(profile.Trigger)) return false;
anim.SetTrigger(profile.Trigger); anim.SetTrigger(profile.Trigger);
@ -944,14 +953,14 @@ namespace RacesOfValheim
Transform claw = StrikingClaw(leftY, rightY, samples); Transform claw = StrikingClaw(leftY, rightY, samples);
if (claw == null) if (claw == null)
{ {
ExecuteDamage(profile, radius); ExecuteDamage(profile, radius, true);
Player player = Player.m_localPlayer; Player player = Player.m_localPlayer;
if (player != null) if (player != null)
DigCrater(player.transform.position + player.transform.forward * SvermConfigManagement.RavagerAttackOffset); DigCrater(player.transform.position + player.transform.forward * SvermConfigManagement.RavagerAttackOffset);
return; return;
} }
ApplyDamageInSphere(claw.position + Vector3.up * 0.5f, radius, profile.Damage); Strike(claw.position + Vector3.up * 0.5f, radius, profile, true);
DigCrater(claw.position); DigCrater(claw.position);
} }
@ -985,14 +994,14 @@ namespace RacesOfValheim
/// FenrirBehaviors.ExecuteClawDamage, unchanged in shape: a sphere swept against the same /// FenrirBehaviors.ExecuteClawDamage, unchanged in shape: a sphere swept against the same
/// broad layer mask every melee form in this mod already uses. /// broad layer mask every melee form in this mod already uses.
/// </summary> /// </summary>
private void ExecuteDamage(SvermRavagerAttacks.Profile profile, float radius) private void ExecuteDamage(SvermRavagerAttacks.Profile profile, float radius, bool slam)
{ {
Player player = Player.m_localPlayer; Player player = Player.m_localPlayer;
if (player == null) return; if (player == null) return;
float reach = SvermConfigManagement.RavagerAttackOffset; float reach = SvermConfigManagement.RavagerAttackOffset;
Vector3 attackPoint = player.transform.position + player.transform.forward * reach + Vector3.up; Vector3 attackPoint = player.transform.position + player.transform.forward * reach + Vector3.up;
ApplyDamageInSphere(attackPoint, radius, profile.Damage); Strike(attackPoint, radius, profile, slam);
} }
private const string CraterPrefab = "digg_v3"; private const string CraterPrefab = "digg_v3";
@ -1015,26 +1024,40 @@ namespace RacesOfValheim
if (crater != null) Object.Instantiate(crater, ground.point, Quaternion.identity); if (crater != null) Object.Instantiate(crater, ground.point, Quaternion.identity);
} }
private const string FormLabel = "Ravager";
private static readonly int HitMask = LayerMask.GetMask("Default", "static_solid", "Default_small", "piece",
"piece_nonsolid", "terrain", "character", "character_net", "character_ghost",
"hitbox", "character_noenv", "vehicle");
/// <summary> /// <summary>
/// The actual sweep, shared by every attack this form has (the three forward swings and /// The actual sweep, shared by every attack this form has. TrolTrueFormHit.SphereHit in
/// the taunt's own AoE) - only the sphere's centre and radius differ between them. /// shape: a forward swing stays inside its arc (the Brute's own, widened to 75 degrees each
/// side the way the troll's is), the slam's claws and the taunt reach all around, and
/// FormMelee.CanReach keeps a blow from landing through a wall. Each target that takes the
/// blow plays the Brute weapon's own impact effect, which vanilla plays inside Attack.
/// ///
/// m_skill is Swords, deliberately NOT Unarmed: Sverm_Damage_Patch rewrites any Unarmed /// m_skill is Swords, deliberately NOT Unarmed: Sverm_Damage_Patch rewrites any Unarmed
/// hit from a Sverm into the Chitin Claws' own tier damage, and that patch fires for THIS /// hit from a Sverm into the Chitin Claws' own tier damage, and that patch fires for THIS
/// call too, since it hooks Character.Damage itself rather than caring who dealt the hit. /// call too, since it hooks Character.Damage itself rather than caring who dealt the hit.
/// Swords keeps that rewrite from overwriting the Brute's real numbers with the claws'. /// Swords keeps that rewrite from overwriting the Brute's numbers with the claws'. It is
/// the Brute weapons' own skill too. The damage still scales with Unarmed (DamageFor).
/// </summary> /// </summary>
private static void ApplyDamageInSphere(Vector3 center, float radius, HitData.DamageTypes damage) /// <returns>True if the blow landed on a creature, so the caller raises the skill.</returns>
private static bool ApplyDamageInSphere(Vector3 center, float radius, SvermRavagerAttacks.Profile profile, bool allAround)
{ {
Player player = Player.m_localPlayer; Player player = Player.m_localPlayer;
if (player == null) return; if (player == null) return false;
int layerMask = LayerMask.GetMask("Default", "static_solid", "Default_small", "piece", Vector3 pos = player.transform.position;
"piece_nonsolid", "terrain", "character", "character_net", "character_ghost", Vector3 forward = player.transform.forward;
"hitbox", "character_noenv", "vehicle"); float halfAngle = allAround ? 180f : Mathf.Max(75f, profile.Angle * 0.5f);
HitData.DamageTypes damage = SvermRavagerAttacks.DamageFor(player, profile);
Collider[] hits = Physics.OverlapSphere(center, radius, layerMask); Collider[] hits = Physics.OverlapSphere(center, radius, HitMask);
FormMelee.LogSwing(FormLabel, hits.Length);
var hitObjects = new System.Collections.Generic.HashSet<GameObject>(); var hitObjects = new System.Collections.Generic.HashSet<GameObject>();
bool hitCreature = false;
foreach (Collider hit in hits) foreach (Collider hit in hits)
{ {
@ -1042,35 +1065,65 @@ namespace RacesOfValheim
if (hit.attachedRigidbody != null && hit.attachedRigidbody.gameObject == player.gameObject) continue; if (hit.attachedRigidbody != null && hit.attachedRigidbody.gameObject == player.gameObject) continue;
IDestructible target = hit.GetComponentInParent<IDestructible>(); IDestructible target = hit.GetComponentInParent<IDestructible>();
if (target == null) continue; if (target == null || (target is Character self && self == player)) continue;
if (target is Character characterTarget && characterTarget == player) continue;
// Marked only once it is hit, further down, so a limb outside the arc does not rule
// out a body squarely in the swing.
GameObject targetObj = (target as MonoBehaviour)?.gameObject; GameObject targetObj = (target as MonoBehaviour)?.gameObject;
if (targetObj != null) if (targetObj != null && hitObjects.Contains(targetObj)) continue;
{
if (hitObjects.Contains(targetObj)) continue;
hitObjects.Add(targetObj);
}
Vector3 targetCenter = hit.bounds.center; Vector3 targetCenter = hit.bounds.center;
Vector3 dirToTarget = (targetCenter - player.transform.position).normalized; Vector3 flat = targetCenter - pos;
flat.y = 0f;
float angle = flat.sqrMagnitude > 0.0001f ? Vector3.Angle(forward, flat) : 0f;
if (angle > halfAngle)
{
FormMelee.LogMiss(FormLabel, hit, $"outside the swing arc ({angle:0} deg)");
continue;
}
if (!FormMelee.CanReach(player.GetEyePoint(), center, hit, target, out string cover))
{
FormMelee.LogMiss(FormLabel, hit, "no clear line, blocked by '" + cover + "'");
continue;
}
HitData hitData = new HitData(); HitData hitData = new HitData();
hitData.m_damage = damage; hitData.m_damage = damage;
hitData.m_point = targetCenter; hitData.m_point = targetCenter;
hitData.m_dir = dirToTarget; hitData.m_dir = (targetCenter - pos).normalized;
hitData.m_pushForce = 40f; hitData.m_pushForce = profile.PushForce;
hitData.m_skill = Skills.SkillType.Swords; hitData.m_skill = Skills.SkillType.Swords;
hitData.m_dodgeable = true; hitData.m_dodgeable = true;
hitData.m_blockable = true; hitData.m_blockable = true;
hitData.m_hitType = HitData.HitType.PlayerHit; hitData.m_hitType = HitData.HitType.PlayerHit;
hitData.m_toolTier = 100; hitData.m_toolTier = (short)profile.ToolTier;
hitData.SetAttacker(player); hitData.SetAttacker(player);
if (targetObj != null) hitObjects.Add(targetObj);
FormMelee.LogHit(FormLabel, target, damage.GetTotalDamage());
target.Damage(hitData); target.Damage(hitData);
FormMelee.GrantAdrenaline(target); FormMelee.GrantAdrenaline(target);
} profile.Shared?.m_hitEffect.Create(targetCenter, Quaternion.identity);
if (target is Character) hitCreature = true;
}
return hitCreature;
}
/// <summary>
/// One blow of a Ravager attack: the Brute weapon's trigger effect (the slam's landing
/// thud; the bite and the ram have none), the sweep, and the Unarmed experience vanilla
/// pays inside Attack for a swing that reached a creature. The Ravager fights unarmed like
/// the rest of the Sverm, so that is the skill it trains.
/// </summary>
private static void Strike(Vector3 center, float radius, SvermRavagerAttacks.Profile profile, bool allAround)
{
Player player = Player.m_localPlayer;
if (player == null) return;
profile.Shared?.m_triggerEffect.Create(center, player.transform.rotation);
if (ApplyDamageInSphere(center, radius, profile, allAround)) FormMelee.RaiseSkill(Skills.SkillType.Unarmed);
} }
} }
} }

View file

@ -15,9 +15,9 @@ Support the mod: [Patreon — NandorTheModder](https://www.patreon.com/c/NandorT
--- ---
## New in v1.6.8 ## New in v1.6.11
**A Skeleton that eats, a bat that can't flee mid-fight, and a cheaper marble hall.** Each Skeleton player can choose to eat real food and to spend stamina. The Aswid can't take bat form until a few seconds after the last hit. The Dvergar build the black marble and Yggdrasil wood pieces with stone and fine wood. A faction can now fight as a group if you hit one of its own, and Valheim 1.0's new skeletons keep the swamp truce. Full details in the [changelog](#v168). **F8 no longer fires by accident.** The debug key now lives in a new `Debug` section of the config. It's off until you turn it on, and you can rebind it. Heads-up: `Debug: Log Form Hits` moved there from `Fenrir - Debug`, so if you had turned it on, turn it on again. Full details in the [changelog](#v1611).
--- ---
@ -110,7 +110,7 @@ Support the mod: [Patreon — NandorTheModder](https://www.patreon.com/c/NandorT
- **Hive Pheromones:** No invertebrate attacks you — leeches, ticks, deathsquitos, seekers and bees all ignore you, from tier zero. - **Hive Pheromones:** No invertebrate attacks you — leeches, ticks, deathsquitos, seekers and bees all ignore you, from tier zero.
- **Toxin Immunity:** Poison cannot touch you. Blunt and fire hit you 40% harder — until Fader, when the fire weakness burns out and comes back as a resistance. - **Toxin Immunity:** Poison cannot touch you. Blunt and fire hit you 40% harder — until Fader, when the fire weakness burns out and comes back as a resistance.
- **The Colony:** After the Elder, a Brood Mound, a Hive Market and a roster of insect troops bought with digested biomass. - **The Colony:** After the Elder, a Brood Mound, a Hive Market and a roster of insect troops bought with digested biomass.
- **Ravager Strain:** After Yagluth, become a Seeker Brute, with its own bite, lunging ram and two-claw ground slam that digs the earth. The carapace is worth double. - **Ravager Strain:** After Yagluth, become a Seeker Brute, with its own bite, lunging ram and two-claw ground slam that digs the earth. Its damage grows with Unarmed. The carapace is worth double.
### 11. Alfar ### 11. Alfar
- **Eitr Shield:** Eitr is your armour: blows land on the eitr pool first, and lightning and spirit cost double. Only drowning and the edge of the world ignore it. Every food you eat also feeds the pool. - **Eitr Shield:** Eitr is your armour: blows land on the eitr pool first, and lightning and spirit cost double. Only drowning and the edge of the world ignore it. Every food you eat also feeds the pool.
@ -296,7 +296,7 @@ Build a **Brood Mound** with the hammer — no more than two within its density
- **Base:** Tree-Born. Green skin/branches, plant diet, food lasts 2x. Photosynthesis: stand still in daylight for 10s = heal 10% max HP/sec for 8s, Rested buff (5 min +1min per boss). Greylings, greydwarves, fulings, trolls, leeches and deathsquitos ignore you. - **Base:** Tree-Born. Green skin/branches, plant diet, food lasts 2x. Photosynthesis: stand still in daylight for 10s = heal 10% max HP/sec for 8s, Rested buff (5 min +1min per boss). Greylings, greydwarves, fulings, trolls, leeches and deathsquitos ignore you.
- **Eikthyr:** Awakened Seeds – eat seeds/cones/acorns/mushrooms for strong food buffs. - **Eikthyr:** Awakened Seeds – eat seeds/cones/acorns/mushrooms for strong food buffs.
- **Elder:** Purple Rain (G): 8m toxic pollen heals you and your allies, poisons enemies, 20s CD. - **Elder:** Purple Rain (G): 8m toxic pollen heals you and your allies, poisons enemies, 20s CD. Heal and poison grow with Blood Magic (+40 each at level 100), and a cast that reaches someone else trains it.
- **Bonemass:** Swim uses no stamina and stamina comes back slowly in the water, immune to Poison/Wet. - **Bonemass:** Swim uses no stamina and stamina comes back slowly in the water, immune to Poison/Wet.
- **Moder:** Last Stand – armor rises as health falls (up to +50%), Thorns (reflects 20% damage). - **Moder:** Last Stand – armor rises as health falls (up to +50%), Thorns (reflects 20% damage).
- **Yagluth:** Homecoming Portal (H): portal to respawn point, anyone can use, 5min CD. - **Yagluth:** Homecoming Portal (H): portal to respawn point, anyone can use, 5min CD.
@ -492,6 +492,28 @@ Both halves have an off switch under `Factions` in Configuration Manager: **Fact
## Changelog ## Changelog
### v1.6.11
- **Heads-up - config key moved:** `Fenrir - Debug` → `Debug: Log Form Hits` is now `Debug` → `Debug: Log Form Hits`. If you had turned it on, turn it on again in Configuration Manager. The old entry stays in your .cfg but does nothing; delete it by hand if you like.
- **Change - the debug key is off by default and can be rebound:** F8 used to toggle the melee reach readout and write Alfar drone reports to the log for everyone, with no way to turn it off. It now sits in a new `Debug` section: `Debug: Enable Debug Key` (off by default) turns it on, and `Debug Key` (F8 by default) rebinds it. `Debug: Log Form Hits` moved into the same section, since it logs the Skadi, Sverm and Trol forms as well as the Fenrir ones. Thanks to Dagaz for the request. Not tested in game yet.
### v1.6.10
- **Fix - Skadi's Moder and Fader forms couldn't hit the training dummy:** their bites, claws and spin checked for cover with a line that counted the target's own body as a wall. Anything standing on the build layer, like the T.W.I.G. training dummy, could never be hit; wildlife worked. They now use the same reach check as the Fenrir forms, and each hit plays the real dragon's impact sound. The blow also lands on the clip's own hit frame instead of a fixed half second, which was early for every melee: the Moder's claws landed a second and a half before the claw came down. Thanks to lexsonn for the report. Not tested in game yet.
- **Change - Ravager Strain fights like the troll True Form:** the Brute's swing and impact sounds play on the bite, ram and slam, which were silent. Every attack that lands on a creature trains Unarmed, and the damage now grows with it the way a weapon grows with its skill: about 40% of a real Seeker Brute's at level 0, about 92% at level 100. The new key `Sverm - Ravager Strain` → `Ravager Attack Damage` (default 1) multiplies it. The bite and the ram now stay in front of you and no longer hit through walls, and each attack uses the Brute's own push and tool tier. Thanks to lexsonn for the report. Not tested in game yet.
- **Fix - Alfar Skrid blinked you onto the roof:** a blink aimed at the floor ended with your feet under it, and the check meant to lift you out of the ground measured from the sky, so under any roof (a crypt, a cave, a house) it put you on top of the roof instead. Skrid now lands you on the floor under the spot it reaches. Inside a dungeon or cave it is cancelled, at no cost, when there is no floor under that spot. Thanks to Joacwoo for the report and the videos. Not tested in game yet.
- **Fix - Alfar hair and beard flashed in for a moment:** changing anything in your hands made the game put the character's hair and beard back, and the Alfar only took them off again half a second later. They are now blocked where the game attaches them, so they never show. Thanks to Joacwoo for the report and the video. Not tested in game yet.
### v1.6.9
- **Fix - you couldn't hit your own faction:** since Valheim 1.0, a player's hit passes through any creature the game calls friendly unless PvP is on, and the faction truce called every creature of your faction friendly. Your blows did nothing, no grudge started, and `Grudge spreads to kin` had nothing to spread. Hitting one of your own works again, and it and its kin fight back as intended. The truce still keeps them off you; it no longer shields them from you. Thanks to Joacwoo and CrimsonAiro for the reports. Not tested in game yet.
- **Fix - grudges in multiplayer:** a creature now keeps its grudge when another player's game takes over running it mid-fight, for example when the first player walks away or logs out. `Grudge spreads to kin` now also reaches kin that another player's game is running; before, they stayed calm until hit themselves. Every player needs this version: a creature run by an older client behaves the old way. Not tested in multiplayer yet.
- **New - race attacks train their skills:** many attacks grew with a skill but gave no XP for it, so the skill never moved. Now an attack that lands on a creature gives the XP a weapon hit gives, and damage over time gives a share per second. Hitting trees or rocks gives nothing. Not tested in game yet.
- Fenrir: the Fenring, Cultist, Wolf and Ulv claws and bites train Unarmed. The Cultist's fire breath trains Elemental Magic.
- Skadi: the Drake forms' bites and claws train Unarmed.
- Trenta: the Muspell stomp trains Unarmed.
- Aswid: the Vampiric Aura slowly trains Blood Magic.
- Alfar: Geisli and Ljosstorm train Elemental Magic. The Sameining pulse trains it slowly.
- **Change - Purple Rain grows with Blood Magic:** at level 100 it heals and poisons for 40 more than its base 40. The bonus has two new keys under `Trenta - Purple Rain`: `Blood Magic Heal Bonus` and `Blood Magic Poison Bonus`. A cast that reaches anyone besides you trains Blood Magic, and the Compendium shows your current numbers. Not tested in game yet.
- **Fix - pukeberries and the Aswid's fourth stomach:** pukeberries emptied only the three vanilla food slots, so the Aswid's fourth meal stayed. It now goes like the others. Thanks to Joacwoo for the report.
### v1.6.8 ### v1.6.8
- **New - Skeleton Mortal Habits:** two options under `Skeleton - Mortal Habits`, both off by default, each player picking their own. *Eats Mortal Food*: the Skeleton eats like the living, and its health and stamina come from its meals. The boss-tier health bonus goes away, since it stood in for food. *Feels Fatigue*: the Skeleton spends stamina; if it doesn't eat, its stamina grows with its standing. Every other Skeleton power stays. Thanks to Celepito for the request. Not tested in game yet. - **New - Skeleton Mortal Habits:** two options under `Skeleton - Mortal Habits`, both off by default, each player picking their own. *Eats Mortal Food*: the Skeleton eats like the living, and its health and stamina come from its meals. The boss-tier health bonus goes away, since it stood in for food. *Feels Fatigue*: the Skeleton spends stamina; if it doesn't eat, its stamina grows with its standing. Every other Skeleton power stays. Thanks to Celepito for the request. Not tested in game yet.
- **New - Aswid bat form waits out a fight:** you can't take bat form until 2.5 seconds after you last lost health, from a hit or a tick of fire, poison or bleeding. Turning back is never blocked, and a hit still doesn't knock you out of bat form. `Aswid - Bat Form` → `Combat Lock` sets the time; 0 turns it off. Not tested in game yet. - **New - Aswid bat form waits out a fight:** you can't take bat form until 2.5 seconds after you last lost health, from a hit or a tick of fire, poison or bleeding. Turning back is never blocked, and a hit still doesn't knock you out of bat form. `Aswid - Bat Form` → `Combat Lock` sets the time; 0 turns it off. Not tested in game yet.

View file

@ -1,7 +1,7 @@
{ {
"name": "RacesOfValheim", "name": "RacesOfValheim",
"description": "A Valheim mod that adds eleven custom playable races (Alfar, 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 eleven custom playable races (Alfar, 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.6.8", "version_number": "1.6.11",
"website_url": "", "website_url": "",
"dependencies": [ "dependencies": [
"denikson-BepInExPack_Valheim-5.4.2333", "denikson-BepInExPack_Valheim-5.4.2333",