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>
This commit is contained in:
commit
34bdf35325
33 changed files with 1829 additions and 573 deletions
|
|
@ -33,7 +33,7 @@ namespace RacesOfValheim
|
|||
|
||||
public static bool Prefix(Trader __instance)
|
||||
{
|
||||
if (((Component)__instance).GetComponent<FactionMerchant>() != null)
|
||||
if (FactionsConfig.Merchants && ((Component)__instance).GetComponent<FactionMerchant>() != null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
@ -63,6 +63,7 @@ namespace RacesOfValheim
|
|||
{
|
||||
public static void Postfix(Trader __instance)
|
||||
{
|
||||
if (!FactionsConfig.Merchants) return;
|
||||
if (((Component)__instance).GetComponent<FactionMerchant>() == null) return;
|
||||
__instance.CancelInvoke("RandomTalk");
|
||||
}
|
||||
|
|
@ -88,6 +89,7 @@ namespace RacesOfValheim
|
|||
|
||||
public static void Postfix(Player __instance)
|
||||
{
|
||||
if (!FactionsConfig.Merchants) return;
|
||||
// Both fields are private in the assembly this project compiles against.
|
||||
var traverse = Traverse.Create(__instance);
|
||||
Character hovering = traverse.Field("m_hoveringCreature").GetValue<Character>();
|
||||
|
|
@ -117,7 +119,7 @@ namespace RacesOfValheim
|
|||
{
|
||||
public static bool Prefix(Player __instance, GameObject go, bool hold, bool alt)
|
||||
{
|
||||
if (go == null) return true;
|
||||
if (go == null || !FactionsConfig.Merchants) return true;
|
||||
FactionMerchant merchant = go.GetComponentInParent<FactionMerchant>();
|
||||
if (merchant == null) return true; // not ours - let vanilla's own resolution run
|
||||
|
||||
|
|
@ -141,6 +143,7 @@ namespace RacesOfValheim
|
|||
{
|
||||
public static bool Prefix(MonsterAI __instance, ref bool __result)
|
||||
{
|
||||
if (!FactionsConfig.Merchants) return true;
|
||||
// BaseAI.m_character is private in the assembly this project compiles against.
|
||||
Character character = Traverse.Create(__instance).Field("m_character").GetValue<Character>();
|
||||
if (FactionMerchantRuntime.IsProtected(character))
|
||||
|
|
@ -160,7 +163,7 @@ namespace RacesOfValheim
|
|||
{
|
||||
public static bool Prefix(Character __instance, HitData hit)
|
||||
{
|
||||
if (hit != null && hit.GetAttacker() == Player.m_localPlayer && FactionMerchantRuntime.IsProtected(__instance))
|
||||
if (FactionsConfig.Merchants && hit != null && hit.GetAttacker() == Player.m_localPlayer && FactionMerchantRuntime.IsProtected(__instance))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue