Remove undead and inorganic enemies from Aswid diet

This commit is contained in:
Ferdinando 2026-07-30 22:22:24 +02:00
commit 68dd2329dd
2 changed files with 9 additions and 17 deletions

View file

@ -20,17 +20,8 @@ namespace RacesOfValheim
{ "Deer", "TrophyDeer" },
{ "Wolf", "TrophyWolf" },
{ "Fenring", "TrophyFenring" },
{ "Draugr", "TrophyDraugr" },
{ "Draugr_Elite", "TrophyDraugrElite" },
{ "Skeleton", "TrophySkeleton" },
{ "Skeleton_Poison", "TrophySkeletonPoison" },
{ "Surtling", "TrophySurtling" },
{ "Blob", "TrophyBlob" },
{ "BlobElite", "TrophyBlobElite" },
{ "Leech", "TrophyLeech" },
{ "Wraith", "TrophyWraith" },
{ "Hatchling", "TrophyHatchling" },
{ "StoneGolem", "TrophySGolem" },
{ "Lox", "TrophyLox" },
{ "Fuling", "TrophyGoblin" },
{ "FulingShaman", "TrophyGoblinShaman" },
@ -46,10 +37,6 @@ namespace RacesOfValheim
{ "Cultist", "TrophyCultist" },
{ "Bat", "TrophyBat" },
{ "Asksvin", "TrophyAsksvin" },
{ "Charred_Melee", "TrophyCharredMelee" },
{ "Charred_Archer", "TrophyCharredArcher" },
{ "Charred_Mage", "TrophyCharredMage" },
{ "Morgen", "TrophyMorgen" },
{ "Volture", "TrophyVolture" }
};

View file

@ -124,21 +124,26 @@ namespace RacesOfValheim
GameObject trophyPrefab = PrefabManager.Cache.GetPrefab<ItemDrop>("TrophyGoblin")?.gameObject;
if (trophyPrefab != null)
{
// instantiateInWorldSpace = false per ereditare esattamente la trasformazione base
bool wasActive = trophyPrefab.activeSelf;
trophyPrefab.SetActive(false);
GameObject trophyVisual = UnityEngine.Object.Instantiate(trophyPrefab, headBone, false);
trophyPrefab.SetActive(wasActive);
trophyVisual.name = "FurlingHead_Trophy";
// Rimuoviamo tutti gli script (HoverText, ZNetView, ItemDrop, ecc.) per evitare prompt a schermo
foreach (var comp in trophyVisual.GetComponentsInChildren<MonoBehaviour>())
{
UnityEngine.Object.Destroy(comp);
UnityEngine.Object.DestroyImmediate(comp);
}
if (trophyVisual.GetComponent<Rigidbody>() != null)
UnityEngine.Object.Destroy(trophyVisual.GetComponent<Rigidbody>());
UnityEngine.Object.DestroyImmediate(trophyVisual.GetComponent<Rigidbody>());
foreach (var col in trophyVisual.GetComponentsInChildren<Collider>())
{
UnityEngine.Object.Destroy(col);
UnityEngine.Object.DestroyImmediate(col);
}
trophyVisual.SetActive(true);
// Valheim rig scales are huge (100).
// Spostiamo la testa leggermente in alto (asse Y = 0.0015) e 5cm indietro rispetto al centro (asse X positivo = 0.0005)
trophyVisual.transform.localPosition = new Vector3(0.0005f, 0.0015f, 0f);