Commit graph

82 commits

Author SHA1 Message Date
26bfd339e8 fix(visuals): stop the glow eyes from occasionally landing behind the skull
AswidVisuals/DvergarVisuals measure which way the head bone faces
exactly once, the first time BuildEyes runs for a given character, by
reading the bone's live pose at that instant and snapping it to the
nearest axis - then cache the result for as long as the eyes exist.
Taken while sitting, attached, mid-attack or asleep, the head can be
turned away from the body's own forward, and the snap picks whichever
axis is closest to that pose - landing the eyes behind the skull
instead of on the face, and staying wrong for the rest of the session.

ApplyEyes now defers the first build while the player is attached,
attached to a ship, mid-attack or asleep, since it runs again on every
subsequent UpdateColors anyway. Reduces the obvious bad-timing cases;
does not by itself rule out a mistimed read during ordinary idle
animation, which would need the measurement moved to the model's bind
pose (animation-independent) to close out completely.

Also shrinks the Aswid's eyes by 10% (EyeSize 0.062 -> 0.0558), per
request.

Confirmed improved by playtest.
2026-08-09 16:48:35 +02:00
25795a05e9 fix(input): abilities no longer die while a movement key is held
BepInEx's KeyboardShortcut.IsDown() ends in ModifierKeyTest, which
requires that no key outside the shortcut is currently held - it only
exempts the mouse buttons. That is right for a config-menu hotkey and
wrong for a game ability: holding W (or any other movement key) made
every bound ability in the mod stop responding, for every race, mouse
bindings included. Vanilla attacks kept working because they go
through ZInput, which is what made it look like a Skadi/dragon bug.

Adds RaceInput.IsDownIgnoringHeldKeys / IsPressedIgnoringHeldKeys -
main key down plus every modifier held, without the blocking rule -
and switches all 27 call sites across Aswid, Dvergar, Fenrir, Skadi,
Trenta and Trol over to them.

Arrived with the rebindable-keybind work that shipped in 1.4.0.
2026-08-09 12:33:41 +02:00
f60b8d8f7d Merge branch 'main' into race-chains-and-stations
# Conflicts:
#	JotunnModStub/Aswid/AswidRace.cs
#	JotunnModStub/Factions/FactionHostilityPatch.cs
#	JotunnModStub/Factions/FactionMerchantCatalog.cs
#	JotunnModStub/Furling/FurlingPatches.cs
2026-08-07 17:15:10 +02:00
Ferdinando
fae82162be feat(aswid): blood refinery and blood potions
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-07 17:02:34 +02:00
f4eaf9e53c fix(aswid): use the real Goblin prefab ids for Fuling-family food nutrition
Same root cause as the Factions fix (9287bd0): mobToTrophyMap keyed the
Goblin family by "Fuling"/"FulingShaman"/"FulingBerserker" - none of which
are real prefab ids - instead of "Goblin"/"GoblinShaman"/"GoblinBrute".

The trophy icon lookup was unaffected (it already used the correct
TrophyGoblin/TrophyGoblinShaman/TrophyGoblinBrute ids on the dictionary's
value side), but the food-tuning block gated on
PrefabManager.Cache.GetPrefab<GameObject>(mobName) succeeding silently
never ran for any of the three - so their food fell back to generic
CookedMeat nutrition instead of a Goblin-scaled amount, and never got the
20-minute humanoid-prey burn time the "StartsWith Fuling" check was meant
to grant them. Renamed the check to "StartsWith Goblin" to match.

Verified in-game.
2026-08-07 11:48:31 +02:00
629a534bc3 feat(aswid): make abilities and special attacks BepInEx-configurable
Adds AswidConfig.cs, following the SkadiConfig pattern: one Configuration
Manager section per topic (Keybinds, Passive Combat, Vampiric Aura,
Superhuman Senses, Eclipse, Devour, Domination), covering every tunable
number and all five ability keybinds (Bat Form, Mist Form, Eclipse, Tame,
Toggle Devour). Defaults match the previous hardcoded constants exactly.

Also fixes a real mismatch found along the way: the tame hover-text
hardcoded "[K] Tame" while the key that actually triggered taming was U.
Both now read the same configured Tame key, so the hint stays correct if
it's rebound.

Config sections are bound alphabetically by race (Aswid before Skadi) in
RacesOfValheim.Awake(), since Configuration Manager's category list
follows bind order.
2026-08-06 13:33:39 +02:00
Ferdinando
46f45ed1e3 aswid eye fix 2026-08-05 22:52:05 +02:00
Ferdinando
a29b7e54b4 fix(aswid): make the Vampiric Aura land, and run it passively in every form
The aura dealt its damage through Character.ApplyDamage, which only edits
the local copy of a character. On anything we do not own - in multiplayer
that is most mobs - the owner overwrote the health change on the next sync,
so the aura neither hurt anything nor showed anything. It also bypassed our
own Character.Damage patches, which is why it never healed and never
triggered devour-on-kill despite being the *vampiric* aura. It now calls
Character.Damage, which routes RPC_Damage to whoever owns the target, and
sets m_dir so the target reacts to the hit.

The aura no longer has to be channelled by holding block in bat or mist
form. It ticks on its own in every form, with no key to hold and no icon or
message of its own; the form only decides how hard it bites - half damage
as a human, full as a bat, double as mist.

Also guarded the sunrise mist auto-revert with isTransformingSequence.
Without it the revert re-triggered on every frame of its own one-second
animation, stacking coroutines that fought over the same visuals and status
effect.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-04 11:04:41 +02:00
bc9bb302db fix(aswid): let Blood Magic Mastery actually free the cast
Mastery forced Player.HaveEitr true and skipped Player.UseEitr, and neither is
what refuses the attack. Attack.Start gates on Character.TryUseEitr, whose first
test is GetMaxEitr() == 0 - an Aswid carrying no eitr food has a maximum of
zero, so the cast was rejected there and HaveEitr was never consulted at all.

That is also why it looked intermittent: it appeared to work for anyone who
happened to be eating eitr food and failed for exactly the player it was written
for, one leaning on blood magic without eitr.

TryUseEitr only gates - the spend is a separate UseEitr call - so returning true
there costs nothing, and the existing UseEitr prefix still blocks the drain. The
health price is untouched; it is meant to be the whole price.

The local-Aswid-holding-blood-magic test was written out three times and now
lives in one helper, so the weapon lookup cannot drift between them.
2026-08-04 00:22:30 +02:00
Ferdinando
1dbfbd02b6 fix(aswid): center Vampiric Aura on the caster and stop transforms from casting the real Guardian Power
Vampiric Aura was centered 2m in front of the player instead of on
them, and its Blood Magic scaling only ever added up to +1 damage at
level 100; rebalanced to a 1 base + up to 5 scaled split.

Aswid Bat Form, Skadi Cold Spell, Skadi Drake/Moder Form and Fenrir
Wolf Form all borrow the native "gpower" animator trigger for its
arms-raised casting pose. That clip carries a baked-in Animation Event
that calls Player.ActivateGuardianPower(), which fired regardless of
who triggered the animation - borrowing it silently cast the player's
real Guardian Power (and burned its cooldown) whenever one was
available. Added a brief, time-based suppression window in RaceInput
around each borrowed trigger so only that one call is swallowed.

Also includes AswidSpectralClaw.cs, a boss-scaled bare-fist damage
item for Aswid, currently disabled pending equip-state fixes.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-03 21:37:58 +02:00
c3a3bd2864 chore(logging): strip the AswidDebug tracing and silence the visual hider
The [AswidDebug] logging shipped in 1.3.8 wrote a line per aura tick per enemy
in radius, four times a second while channelling, plus a line for every devour
attempt and every inedible kill. It filled BepInEx's log for anyone playing an
Aswid. Genuine failure warnings are kept and retagged [Aswid]; the F8
consume-nearest-mob test patch goes with it.

PlayerVisualHider.Diagnostics is off now that transformed bodies are confirmed
hidden. It is a static rather than a const so flipping it back does not leave
the guarded calls unreachable.

The 1.3.9 changelog also records the logging removal, and that remote Skadi
flight now works for observers - the second of the two known issues left open
in 1.3.8, confirmed in multiplayer.
2026-08-02 19:07:59 +02:00
4793811978 fix(transform): return from monster forms without replaying the spawn animation
Hiding the human body with SetActive(false) on the player's "Visual" also
disabled the Animator that lives on it, and Unity rebinds an Animator when it
is re-enabled: the controller restarts from its entry state, which for the
player is the get-up clip played when joining a world. Every Skadi dragon form,
Bat Form and Mist Form therefore ended with the player standing back up off the
ground.

PlayerVisualHider hides the body by suppressing its renderers instead, leaving
the GameObject active so the Animator and ZSyncAnimation keep running for the
whole transformation. Hiding uses forceRenderingOff on top of Renderer.enabled,
which nothing else in the game writes on a character, so the body cannot be
un-hidden behind our back.

Applied to the local and remote paths of both races, and to the ZDO sync's
revert so a remote player who dies mid-form cannot stay invisible.
2026-08-02 18:56:51 +02:00
Ferdinando
1bdf77e8d6 aswig and multiplayer fixes 2026-08-02 17:54:39 +02:00
Ferdinando
be2f7a73cd draughfirstdraft 2026-08-02 08:30:53 +02:00
Ferdinando
272adddd75 small fix to aswin aura 2026-08-01 17:49:12 +02:00
51a23202ff Merge branch 'fix-skadi-race' 2026-08-01 13:50:25 +02:00
bca47beda6 Ignore race ability input while a GUI has focus
UnityEngine.Input reads the device directly, so abilities bound to keys
or mouse buttons kept firing with the map, the inventory, a chest, the
chat or a menu open - clicking an item in a container also swung the
transformed attack.

Route that input through Player.TakeInput, which is what Valheim runs
its own controls through and already reports false for those states
(InventoryGui covers the backpack and chests alike). Aswid's transform
keys were the only place already doing this; the shared helper replaces
that one-off and covers Skadi's cold spell, form keys, flight toggle,
form attacks and flight boost, Fenrir's form keys and the attacks of all
four form behaviors, Trol's rock throw and true form, and Aswid's devour
toggle.

Cultist fire is a held button, so it is gated per read rather than
around the block: opening a GUI mid-stream now falls through to
StopFire() instead of leaving the flames running.
2026-08-01 13:25:02 +02:00
Ferdinando
d387131086 start draugh race 2026-08-01 13:17:13 +02:00
Ferdinando
ff9fc4db2d Bind Taming ability to K key instead of E 2026-07-31 09:42:07 +02:00
Ferdinando
225b7115bc Allow Aswid stomach to refresh blinking duplicate foods when slots are fully occupied 2026-07-31 09:35:15 +02:00
Ferdinando
ad74ca3219 Revert force-feed logic to respect Aswid stomach limitations 2026-07-31 09:31:43 +02:00
Ferdinando
6170c060ac Add force-feed fallback to TryConsumeMob to bypass stomach limits on execute 2026-07-31 09:27:07 +02:00
Ferdinando
152a2f21ad Add extra debug logs for Aura execute and consume 2026-07-31 09:24:07 +02:00
Ferdinando
e31ed458bd Update execute logic to also automatically devour 2026-07-31 08:56:59 +02:00
Ferdinando
c580871a2d Add execute mechanic to Vampiric Aura and bump version to 1.3.5 2026-07-31 08:49:55 +02:00
Ferdinando
55d2cc97bb Add Aswid passive lifesteal scaling with progression state 2026-07-30 22:34:26 +02:00
Ferdinando
9c64ed0072 Fix Aswid devour failing during attack animation 2026-07-30 22:31:43 +02:00
Ferdinando
3104e5fabf Remove Charred and Morgen from Aswid diet again 2026-07-30 22:29:08 +02:00
Ferdinando
31beda5eea Restore Ashlands enemies (Charred/Morgen) to Aswid diet 2026-07-30 22:25:43 +02:00
Ferdinando
68dd2329dd Remove undead and inorganic enemies from Aswid diet 2026-07-30 22:22:24 +02:00
Ferdinando
7f7b92a191 Update Aswid devour toggle, player scaling fix, and README encoding 2026-07-30 19:32:17 +02:00
Ferdinando
c4a24c9fdf Initial commit 2026-07-30 19:00:13 +02:00