Commit graph

18 commits

Author SHA1 Message Date
df9c768f92 feat(factions): no raids made only of allies, and allies spare the whole base
A raid whose every spawn is at peace with the player's race is struck from
the list the client sends as possibleEvents, and from the server's valid
event points when raids are world-based.

The structure veto covered only 20 m from the creature, but
FindClosestStaticPriorityTarget searches the whole view range. It now holds
while any allied player is within 100 m, and reads the per-race lists too.
2026-09-28 21:41:29 +02:00
1bd09ed31d feat(text): merchants, troops and the hive's shelf come from translation files
The faction merchants' 90 jokes, their generic lines and their names now
read from merchants.json. Merchant names use the game's own creature
tokens where one matches, so they arrive translated in every language
Valheim ships; the Dverg keeps a key of its own, since vanilla's token
reads "Dvergr Rogue".

The Dvergar and Trol troop names and terms, and the Sverm hive's goods,
refusals, stage names and brood kinds, follow. Their panels fill TMP texts
themselves, so they localize the names where they draw them.

The jokes have English text only for now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 18:50:54 +02:00
Ferdinando
834d6647fd chore(release): v1.4.19 - eye height, remote forms, food refresh, faction retaliation
Race body scale moved the model and not the camera: Character.m_eye hangs
off the unscaled root, so a Trol or a Dvergar changed height for everyone
but themselves. RaceEyeHeight moves the eye by whatever scale the Visual
is wearing, for every player, so aim rays follow too.

Remote copies of a Fenrir form had no one writing to their Animator and
stood in the controller's default state, sliding. RemoteFenrirAnimator
mirrors the four local behaviours off the player's own replicated
animator, the way RemoteSkadiAnimator already did for Skadi.

Player.Food.m_time is time remaining, not time elapsed: the Aswid, Trenta
and Draugh repeat-meal branches all set it to 0 and expired the slot they
meant to renew, and left the nutrition values stale. RaceFoodRefresh does
what vanilla's own branch does, in one place instead of three. The Trenta
prefix now reports __result, or a working refresh would have renewed the
slot without consuming the seed.

Aswid devour was gated by one timestamp shared by every corpse, so a pack
killed at once fed the player once; it is now per corpse, floored at a
second, and a refused meal says $msg_nomore.

MonsterAI.UpdateTarget discards any target IsEnemy refuses, so a truced
mob could not retaliate at all - it stood still or fled. RaceGrudge
records the hit on the AI owner's client and both truce postfixes stand
down for that pair. The Aswid drain and the Skadi frost aura now skip
kin, as the Skeleton's fire aura already did, or an always-on aura would
hold every truce permanently broken.

Faction sets matched exact prefab names with families half-listed:
added Skeleton_NoArcher and Draugr_Ranged to the Swamp, Greyling to the
Black Forest.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-20 08:26:22 +02:00
Ferdinando
c7cbd6bece chore(release): v1.4.18 - Valheim hotfix flight fix, 1.0 shop fixes, Fenrir speed
Drake flight resolves ZInput.GetJoyLeftStickY at runtime, since the
hotfix dropped its bool parameter. Faction merchant TradeItems now set
the 1.0 fields StoreGui dereferences (m_tooltip, m_buyPlayerEffects),
and the Dvergar trader discount clones the whole TradeItem instead of
rebuilding four fields. Trol totem refusals return true so vanilla's
$msg_cantuseon no longer covers them. The Fenrir curse speed modifier
is the bonus alone (SE_Stats adds it), not 1 + bonus. New Discord link.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-18 17:10:24 +02:00
Ferdinando
6193b3ee2d 1.0 compatibility 2026-09-10 18:05:24 +02:00
Ferdinando
a60f5e8217 fix(factions): make the truce switch cover every player truce, not one of five
Reported from a live game: with "Faction truce" off, a Trenta's Greydwarves
stayed friendly. The switch was working - it just was not switched over the
patch that mattered.

Five separate Harmony postfixes answer BaseAI.IsEnemy, and only
FactionHostilityPatch was gated. A Trenta reads its Black Forest truce from
RaceHostilityManager, which had no switch, so turning the faction one off
changed nothing visible. The same held for the Fenrir's wolves, the Aswid's
progression list, the Draugh's undead, the Sverm's invertebrates, the
Furling's Plains roster and the Skeleton's undead.

Gated all four player-facing ones behind the existing flag rather than
adding a switch each: from the player's side there is one question being
asked, and a switch that answers a fifth of it is worse than none.

DvergarMercenaryTrucePatch is deliberately left alone - it is a truce
between a hired thrall and a wild dvergr, two NPCs, and has nothing to do
with whether mobs come after the player.

Key stays "Faction truce" though its scope grew: renaming it would orphan
the entry in every .cfg already written, and the file beats the default in
code, so anyone who had switched it off would silently get the truce back.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-25 19:13:16 +02:00
Ferdinando
34bdf35325 Merge branch 'war-vulture' into main
Sverm Ravager Strain (replacing the Stinger Morph), Trenta Elder Root, the
Trol food and Black Forest truce work, and the faction FindEnemy patch.

Conflicts resolved:

- FactionHostilityPatch.cs: both sides added a class at the same spot and
  they cover different holes, so both are kept - FactionStaticTargetPatch
  (main, stops same-faction mobs smashing structures) and
  FactionHuntPlayerPatch (war-vulture, closes the HuntPlayer fall-through).

- RaceCompendium.cs: both branches independently fixed the same off-by-one
  in the Trol's progression gates. Took main's wording, which matches the
  code - Axes are in the melee bonus (TrolDamagePatches sends them to
  m_slash), the 4th food slot has no gate at all, and Yagluth is +5 not +10
  (TrolConfig.YagluthMeleeBonus). Kept war-vulture's two new lines, the
  Kindling fire weakness and the Black Forest truce.

- Package/manifest.json: 1.4.8, which is what the root manifest and
  PluginVersion already said.

RacesOfValheim.cs referenced SvermConfig.StingerSE/StingerCdSE, which
war-vulture renamed to Ravager. Git merged those lines without a conflict
and the result did not compile; renamed.

Also in this commit:

- Factions on/off switches (FactionsConfig): "Faction truce" and "Faction
  merchants", both default on, both read live so they take effect without a
  restart. The truce gates its three postfixes; the merchants gate the
  Character.Awake setup plus every behavioural patch, so turning them off
  drops the prompt and the trade window on mobs already awake.

- SerpentMeat sells for 200 instead of 1 at the Fuling bench, moved to keep
  the list's ascending price order (the sell panel renders it as declared).

- DraughFoodPatches mapped "SerpentMeatRaw", which is not a prefab; the
  internal id is SerpentMeat, so serpent meat never cooked for a Draugh.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-25 18:52:10 +02:00
Ferdinando
ee5a2e2e7b warvulture 2026-08-24 19:17:47 +02:00
Ferdinando
e9d6e78ec8 warvulture 2026-08-19 19:18:24 +02:00
c2212df322 Merge branch 'war-vulture' into main
Brings in v1.4.3-v1.4.5 work: Trol's Hammer, Bone Servants, War Vulture
craftability, and the Aswid/Fenrir timed-claws rework, on top of the
bugfixes merged into main since v1.4.2.

Resolved conflicts in 7 files where main's post-v1.4.2 fixes overlapped
war-vulture's claws rework:
- README.md, manifest.json: took war-vulture's v1.4.5 content (main
  hadn't touched either since the v1.4.2 release).
- RacesOfValheim.cs: plugin version -> 1.4.5.
- RaceClaws.cs: kept war-vulture's lazy EnsureRoster() fix for the
  Fenrir claw-registration bug over main's belt-and-suspenders
  Register(this), and dropped the now-stale comment referencing the
  removed static constructor. Main's SetupDragItem race-ownership fix
  carried through untouched.
- AswidConfig.cs/AswidRace.cs/AswidPatches.cs: adopted war-vulture's
  single-key design (I toggles both Vampiric Aura and Devour together)
  to match the documented v1.4.5 trader-safety fix, removing a duplicate
  AuraEnabled field the two branches had each declared independently.
  Kept main's IsDownIgnoringHeldKeys() input fix on top.
- RaceCompendium.cs: kept main's fact-checked Aswid/Fenrir entries
  (war-vulture's copies were pre-fix stubs, one referencing a
  nonexistent variable) and layered in war-vulture's timed-claws
  wording.

Build verified clean (0 errors) after resolution.
2026-08-18 17:36:42 +02:00
Ferdinando
70bb263609 warvulture 2026-08-17 07:56:07 +02:00
Ferdinando
0aa1dc4dc8 warvulture 2026-08-16 07:44:44 +02:00
58f70f1a4c Merge branch 'war-vulture' into main
Brings in the Sverm race, the War Vulture flying mount, and Skadi's
Crystal Golem (replacing the Hidden Hollow). Resolved conflicts:
AswidVisuals.cs took war-vulture's skeleton-eye-light rewrite with
main's attach/attack/sleep timing guard re-applied on top, and
RaceCompendium.cs kept main's rewritten race entries while folding in
war-vulture's Sverm/War Vulture pages and the new Claws paragraphs for
Aswid and Fenrir.
2026-08-11 20:35:48 +02:00
Ferdinando
0294d6a71b feat(skadi): remove Skadis Nokkel and the hidden hollow
The staff opened a pair of client-side portals into a claimed troll cave,
and that whole mechanism broke in multiplayer. The two Harmony patches it
needed were the sharpest edge: SkadiNokkelCastPatch prefixed
Attack.OnAttackTrigger and SkadiNokkelFreeCastPatch postfixed the three
cost getters, so every attack by every character in the game went through
mod code before being filtered.

Nothing is put in its place, on purpose. The Crystal Golem is the Skadi's
station now and the balance was already settled around it, and the part of
the hollow that was actually worth having - Skadi and Trol building inside
any troll cave - lives in RaceCaveBuilding and is untouched.

Removed: SkadiNokkel.cs, SkadiHollow.cs, SkadiHollowPortal.cs, the
"Skadi - Hidden Hollow" config section, the HOLLOW_COOLDOWN_SE status
effect, the F8 dump, and the "Nothing takes root here" rule in
PieceDensityLimit, which existed only for the hollow.

Kept: SkadiIce, which the staff's file happened to host but the Frost
Heart and the golem both use - moved to its own file. Greater Frost Heart
stays on sale from the Fenring_Cultist at 1500 as it was.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-11 07:55:23 +02:00
fac6e3986c fix(factions): stop same-faction mobs from smashing player structures
The truce only ever patched BaseAI.IsEnemy, but MonsterAI.UpdateTarget
picks a structure to attack (m_targetStatic) through a completely
separate gate - m_attackPlayerObjects, a flag baked into the prefab
(true for Troll among others) - and never calls IsEnemy at all. A Trol
player, exempt from a cave's resident Troll in combat, could still
watch it flatten a workbench built moments earlier in its own cave.

FactionStaticTargetPatch postfixes UpdateTarget and vetoes the pick if
a same-faction player is within 20 m (matching FindRandomStaticTarget's
own 10 m search radius with room to spare), rather than trying to
intercept the two private target-selection methods themselves.

Confirmed fixed by build+playtest.
2026-08-09 16:46:23 +02:00
Ferdinando
5c5b8c34d2 feat(races): Skadi hollow chain, plus the pending Dvergar and Fenrir ones
Three per-race item chains had accumulated uncommitted. They land
together because FactionMerchantCatalog.cs carries hunks from all
three and cannot be split without interactive staging.

Skadi (new this session):
- SkadiNokkel - "Skadis Nokkel", a StaffSkeleton clone recoloured to
  ice, stripped of its eitr and health costs and of the skeleton
  summon, opening an ice-blue portal to a troll cave the player
  claims as their own. Crafted at the forge after Moder from a
  1500-coin Greater Frost Heart, a DragonTear and a TrophySkeleton.
- SkadiFrostHeart - the bought leg of that recipe, sold by the
  Cultist bench.
- SkadiHollow / SkadiHollowPortal - claims one existing TrollCave02
  in the Black Forest, half a world radius out and south of the
  equator, and opens a linked local portal pair to it.
- RaceCaveBuilding - Skadi and Trol may build inside any troll cave.

Two facts worth keeping, both paid for the hard way:
- a troll cave counts as a DUNGEON, so the flag that refuses a piece
  there is the per-piece Piece.m_allowedInDungeons, not the
  per-location Location.m_noBuild. Player.m_placementStatus names the
  exact refusal reason and is now logged.
- Object.DestroyImmediate is forbidden inside an animation event
  callback, and a staff cast runs in one - it fails silently there.

Also carried in, from earlier sessions and unverified in game:
- Dvergar contract bank and barrel (DvergarBanco*, DvergarBotte*)
- Fenrir Ulvsblod trough (FenrirMangiatoia*)
- the Wolf -> Ulv merchant bench move, so tameable wolves stop
  answering the E key with a shop window

Status: compiles clean with no new warnings. The Skadi chain has NOT
been confirmed working in game - the most recent fix to the troll
cave detection is still untested.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-08 14:58:43 +02:00
Ferdinando
91eb5ca8e5 feat(factions): merchant catalog entries and hostility rules
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-07 17:02:48 +02:00
Ferdinando
ce87e987c9 factionsmerchants 2026-08-06 10:13:57 +02:00