feat(dvergar): add Fire Construct base-defense piece (Mountain faction feature)

Stationary Hammer piece cloned from DvergerMageFire: scans a configurable
radius for hostile, non-Mountain-faction, non-player Characters and fires its
own fireball (real attack data pulled off Humanoid.m_defaultItems, grounded in
an in-game dumpelder dump, not guessed).

Fire-only for this first pass; Ice/Support are a later append to the same
pattern. Several in-game fixes along the way: a missing piece icon (Jotunn
silently drops any piece without one), a missing known-piece teach on spawn
(same fix RaceMenuWard already needed), a kinematic Rigidbody fighting
Character's own velocity writes, and MonsterAI needing to be disabled rather
than destroyed - several vanilla systems (EnemyHud, most likely damage
registration too) assume any combat-relevant Character has one.

FactionHostilityPatch gains a public IsMountainFactionMob accessor so the
construct's target filter shares the same Mountain roster as the rest of
Factions instead of a second hand-maintained list.
This commit is contained in:
kanym 2026-08-07 08:23:04 +02:00
commit 2e31f98380
5 changed files with 291 additions and 0 deletions

View file

@ -70,6 +70,14 @@ namespace RacesOfValheim
return mobs.Contains(prefabName);
}
// Shared with DvergarFireConstruct's target scan, so its friendly-fire filter reads off
// the same Mountain roster as everything else in Factions rather than a second
// hand-maintained copy of it.
public static bool IsMountainFactionMob(string prefabName)
{
return MontagnaMobs.Contains(prefabName);
}
public static void Postfix(Character a, Character b, ref bool __result)
{
if (!__result) return; // already not enemies, nothing to add