Commit graph

19 commits

Author SHA1 Message Date
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
d9bca1934f fix(skills): hand-built attacks level the skill they scale with
Form attacks and powers called Damage directly, and vanilla only raises
a skill inside Attack and Projectile.OnHit, so the skill never moved.
FormMelee.RaiseSkill pays once per swing or tick that hit a creature.

- Fenrir forms' claws and bites: Unarmed; Cultist fire: Elemental Magic
- Skadi drake melee and Trenta stomp: Unarmed
- Aswid aura: Blood Magic, 0.1 per second like the Frost Aura
- Alfar Geisli and Ljosstorm: Elemental Magic; Sameining pulse 0.1/s
- Trenta Purple Rain scales with Blood Magic (two new bonus keys) and
  levels it once per cast that reaches someone besides the caster
2026-11-06 21:21:11 +01:00
0f5b5e4868 feat(skadi): each dragon form flies and cools down on its own terms
The Drake and the Moder shared one set of flight numbers, so once the
Moder lost its time limit at the Queen the Drake had no reason left.
Now the Drake is the scout: quick to turn, fast, free to fly, but it
will not take off while encumbered. The Moder is the freighter: slow to
turn, 3 stamina a second to beat its wings, and it lifts a heavy pack at
25% extra cost.

"Skadi - Directed Flight" becomes "Skadi - Dragon Forms", with every
flight number per form plus the bat's Flight Stamina, While Encumbered,
Encumbered Extra Stamina Cost, Max Duration, Duration Per State and
Cooldown. Duration and cooldown default to -1, which keeps the
boss-tier table.

Each form also gets its own cooldown effect and icon, so a cooldown on
one form no longer blocks another. Suggested by Dissolution.
2026-11-02 15:58:17 +01:00
b7b9cbcbd5 fix(forms): Trol, Skadi, Sverm and Muspell form hits build adrenaline
The same bug the Fenrir forms had until d8dcecb. Vanilla grants a hit's
adrenaline inside Attack; these forms skip Attack and call Damage
directly, so only the stagger bonus in Character.Damage ever reached the
player.

FormMelee.GrantAdrenaline now runs after each hit of the True Form
troll's punch and log swings, the drake's maul, the Ravager's swings and
the Muspell's stomp. The troll's ground slam hits through an Aoe, which
never touches Attack either: the slam marks its Aoe, and a postfix on
Aoe.OnHit grants the adrenaline for each creature it lands on.

Projectiles (Throw Rock, the Muspell spike, drake breath) were never
affected: Projectile grants its own adrenaline on a hit.
2026-10-29 01:52:10 +01:00
77cdc67e97 feat(aswid): bat flies on the Skadi's directed flight
The bat flew on vanilla's debug-fly flag: 50 m/s, free, blind to carry
weight, and invisible to monsters until six patches lied about the flag.
It now flies on m_flying with the drake's controls, moved out of
SkadiPatches into a shared DirectedFlight core that both forms feed
their own numbers into. Powered flight and the sprint cost stamina; out
of stamina the bat glides. Encumbered flight costs 15% more, or is
blocked with 'While Encumbered'. Optional duration and cooldown, off by
default. The aggro/damage patches, the debug-fly speed patch and their
three settings are removed; the drake's behaviour is unchanged.
2026-10-26 14:26:42 +01:00
0a0d9410e7 fix(skadi): Middle Mouse in Drake form no longer spends the attack cooldown on nothing
PerformAttackCoroutine starts the cooldown and shows its icon before it
looks at the form, and the Drake has no Middle Mouse attack, so the press
cost a cooldown and fired nothing. HasAttackForButton now answers for the
Drake too and guards all three buttons, as it already did Left Mouse.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-27 00:52:01 +02:00
b0d18b0654 feat(text): on-screen messages come from translation files
Every message the mod puts in the middle or corner of the screen now reads
its text through ModText.Get, and messages.json holds 191 texts in English
and Italian. Values computed in code become $1, $2 in the text, so a
translator can put them wherever the sentence needs them. Branching
messages get one key per branch.

A few messages travel through a field before they are shown: thralls'
refusals and the building limits now hold a token or key there. Boss and
form names inside messages use tokens too, the bosses the game's own, so
"The Elder" arrives translated.

ModText.Get now localizes each argument before inserting it. A token
argument left for a later pass ran into the text after it: "$1's power"
became the unknown token "enemy_eikthyr's".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-26 20:30:03 +02:00
Ferdinando
e7325e4d25 chore(release): v1.4.21 - dragon form multiplayer sync, Sverm Ravager networking, dorsal spine fix
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-23 11:56:09 +02:00
Ferdinando
6e87be3c77 minor bugfix and pad support 2026-09-12 10:42:01 +02:00
Ferdinando
ce671e7124 jotunn 2.30 compatibility + minor bugs 2026-09-10 19:14:05 +02:00
Ferdinando
6193b3ee2d 1.0 compatibility 2026-09-10 18:05:24 +02:00
5532842ebc fix(skadi): keep the dragon breath and its VFX pointing the same way
The ice breath and the model's own breath VFX could end up aimed in
completely different directions, most visibly on Fader where the VFX
is green poison and the divergence is obvious.

Two causes, both fixed here:

- Every one of the 60 projectiles re-read GetLookDir() inside the
  spawn loop, so over the ~3 s a breath lasts the ice tracked the
  crosshair live while the VFX - baked into the animation, always
  leaving the muzzle - stayed with the body.

- Character.UpdateRotation only steers the body by m_lookYaw when
  AlwaysRotateCamera() is true or the player is standing still;
  otherwise it faces m_moveDir. Running or strafing mid-breath turned
  the model towards the run while the projectiles kept going where the
  player aimed.

The breath now holds the body on the aim for its duration (a deadline
rather than a flag, so an interrupted coroutine cannot leave the body
pinned) and the projectiles come out along the body's forward, so the
two cannot separate: the mouse steers the head and the whole breath
follows it. Applied to Moder's ground breath as well, which had the
same shape.

Also replaces anim.SetTrigger with SetAttackTrigger, which warns when
a trigger name is not on the animator - Unity ignores those silently,
so a wrong name was indistinguishable from an animation not playing.
2026-08-09 12:33:54 +02:00
7708599ff9 feat(skadi): add rebindable keybinds for abilities and special attacks
Adds a Skadi - Keybinds config section (bound first, ahead of the other
Skadi sections) covering every ability/attack trigger: dragon primary
attack, cold spell cast, breath attack, Fader spin, flight toggle, and the
three transform keys (Drake/Moder/Fader). Defaults match the previous
fixed inputs exactly. SkadiAttackPatch's kick-suppression check now reads
the configured Cold Spell key instead of a hardcoded Middle Mouse, so it
stays correct if that key is rebound.

Entries within Keybinds carry an explicit Order (via the new
ConfigurationManagerAttributes shim, per CONFIGURATION-MANAGER-HOWTO.md)
so they list as attack -> cast -> breath -> spin -> flight -> the three
transform keys, rather than alphabetically.
2026-08-06 13:08:05 +02:00
c088eb74f4 feat(skadi): make abilities and special attacks BepInEx-configurable
Binds every tunable number behind Skadi's Cold Spell, frost aura, bonus
frost damage, dragon-form scale/melee/ranged attacks, and directed flight
as BepInEx ConfigEntry values (SkadiConfig.cs), following
CONFIGURATION-MANAGER-HOWTO.md. Defaults match the previous hardcoded
constants exactly, so this is config-only, no gameplay change.

BepInEx writes these to BepInEx/config/com.nandor.racesofvalheim.cfg on
first run regardless of whether Configuration Manager is installed - a
plain, commented, hand-editable text file - so players without the plugin
can still retune values by hand.
2026-08-06 12:45:53 +02:00
5350ebda5d Add the Race Menu Ward; WIP on remote Trol/Skadi visuals
Race Menu Ward: a buildable ward (2 wood, hammer/Misc, no crafting station)
that manages your race outside the debug console - reset the race, switch
between the server's boss progression and your own, and advance that personal
progression by offering a boss's secondary drop to it. One is placed near the
sacrificial stones on first load of a world, by the host only.

BossProgressionManager grows a personal mode alongside the world one. The tier
is stored on the character rather than the world, so a personal tier travels
with the player between servers instead of being tied to whichever world
unlocked it. resetrace and the ward now share RacesOfValheim.ResetRace so both
paths clean up identical state.

Also in progress, and NOT yet working: remote Trol sizing and remote Skadi
flight. Both are computed from the observer instead of the observed -

- Remote Trols are scaled from the observing player's own progression, and
  never show True Form, because SE_TrolTrueForm only exists on the transformed
  player's client. Each Trol now publishes its state and True Form flag onto
  its own ZDO for others to read.
- Remote Skadi dragons sink to the terrain regardless of the altitude being
  replicated: Character.m_flying is only ever set on the flying player's
  client, so observers run grounded motion under gravity. Flight is mirrored
  through the ZDO and the remote copy's rigidbody gravity is disabled while it
  lasts.

Neither has fixed the symptom yet, so both paths keep a throttled diagnostic
log reporting what each observer actually computes. Committed to get the
instrumentation onto the branch, not because it works.

Packaging no longer hardcodes another machine's desktop path: Thunderstore and
Nexus zips go to dist/ on Release builds only, and the DLL is copied into
Valheim only when VALHEIM_INSTALL actually points at a plugins folder.
2026-08-02 08:45:47 +02:00
fc7fd54404 Rework Skadi combat costs, fix dead melee, add cooldown icons
Dragon melee never dealt damage at all: the damage block sat behind
!isMelee, so bite, claw and spin played an animation, charged eitr and
did nothing. Melee now sweeps for targets the way Fenrir's claws do, and
costs nothing - it is the baseline attack that has to work at every tier.

Everything Skadi casts now runs on stamina rather than eitr. Eitr food
only exists from the Mistlands on, while the Cold Spell unlocks at
Eikthyr and the drake at the Elder, so the old costs were either
unpayable or, in the drake's case, silently ignored because UseEitr
never checked affordability. Ranged volleys are charged per projectile
so the sixty shard breath no longer costs the same as a three shard
spit, capped so the widest one stays castable.

The Cold Spell also stopped borrowing the Staff of Frost's damage, which
handed out Mistlands numbers from Eikthyr and multiplied them by every
shard. It now scales with progression, and the improved cast spreads one
budget across its shards: wider, not stronger.

The kick that played over every cast was Valheim's own SecondaryAttack,
bound to the same Middle Mouse button - suppressed for a Skadi holding
the spell. Moder now keeps its ranged attack on Middle Mouse in the air
as on the ground, with no left hand attack aloft, and Fader's airborne
branch is gone since its form cannot fly.

Ability cooldowns finally show on the HUD, each with its own icon and a
live countdown.
2026-08-01 18:02:24 +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
cccabe16ef Rework Skadi dragon flight, enforce form duration, surface timers in HUD
Flight ran on the debug-fly noclip, so it ignored aim entirely and needed
Space/Ctrl for height. It now uses Character's native flying-creature
movement with the camera's full look direction fed in each frame:

- Aim steers, including climb and dive; W powers forward, releasing it
  holds level briefly and then settles into a glide instead of coasting
  along the aim vector (which let you climb forever without input).
- The body actually turns now. m_flyTurnSpeed sat at Character's 12 deg/s
  default because the Player prefab was never set up to fly, so a quarter
  turn took over seven seconds and read as no rotation at all.
- Touching down no longer slides you forward forever. Zeroing the fly
  speeds stops the character without fighting the AddForce UpdateFlying
  queues, which had caused frame-to-frame jitter and TAA ghosting.

DurationMinutes was never wired to anything, so timed forms never expired
and their cooldown, which only starts on reversion, was unreachable in
practice. Timed forms now drop on their own, and both the remaining time
and the cooldown show up beside the minimap as a Moder trophy icon.

Attack capability was snapshotted when the form was entered, so reaching
the Bonemass tier while already transformed left the drake unarmed until
the player reverted and transformed again; it is re-read live now.
2026-07-31 16:25:06 +02:00
Ferdinando
c4a24c9fdf Initial commit 2026-07-30 19:00:13 +02:00