warvulture

This commit is contained in:
Ferdinando 2026-08-19 19:18:24 +02:00
commit e9d6e78ec8
15 changed files with 1041 additions and 489 deletions

View file

@ -24,19 +24,24 @@ namespace RacesOfValheim
Player p = playerCharacter as Player;
if (p != null)
{
// Reads the ZDO copy of the race first - see GetPlayerRace's comment in
// FactionHostilityPatch for why m_customData alone breaks this for anyone
// but the local client (e.g. a dedicated server owning the mob's AI).
string playerRace = FactionHostilityPatch.GetPlayerRace(p);
// Fenrir Race Logic
if (p.m_customData.ContainsKey("Race") && p.m_customData["Race"] == "Fenrir")
if (playerRace == "Fenrir")
{
string prefabName = monster.gameObject.name.ToLower();
if (prefabName.Contains("wolf") || prefabName.Contains("fenring") ||
if (prefabName.Contains("wolf") || prefabName.Contains("fenring") ||
prefabName.Contains("ulv") || prefabName.Contains("cultist"))
{
__result = false;
}
}
// Aswid Race Logic
if (p.m_customData.ContainsKey("Race") && p.m_customData["Race"] == "Aswid")
if (playerRace == "Aswid")
{
string prefabName = monster.gameObject.name.ToLower();
int state = BossProgressionManager.GetCurrentProgressionState();
@ -51,7 +56,7 @@ namespace RacesOfValheim
}
// Draugh Race Logic
if (p.m_customData.ContainsKey("Race") && p.m_customData["Race"] == "Draugh")
if (playerRace == "Draugh")
{
string prefabName = monster.gameObject.name.ToLower();
if (prefabName.Contains("skeleton") || prefabName.Contains("draugr") ||
@ -71,7 +76,7 @@ namespace RacesOfValheim
// Fuling/Troll "choose" not to fight one - but there is no third state to code
// for: vanilla's own damage-response AI already makes any of them retaliate if
// the Trenta strikes first, same as it does for Fenrir's wolves above.
if (p.m_customData.ContainsKey("Race") && p.m_customData["Race"] == TrentaConfig.RaceId)
if (playerRace == TrentaConfig.RaceId)
{
string prefabName = monster.gameObject.name.ToLower();
@ -105,7 +110,7 @@ namespace RacesOfValheim
//
// Bonemass is deliberately NOT here. It is a mass of ooze and it would
// qualify, but a boss that ignores the player is not a boss.
if (p.m_customData.ContainsKey("Race") && p.m_customData["Race"] == SvermConfig.RaceId)
if (playerRace == SvermConfig.RaceId)
{
string prefabName = monster.gameObject.name.ToLower();