Upload from upload_mods.ps1

This commit is contained in:
Nathaniel Cosford
2025-06-04 16:44:53 +09:30
commit f1fbbe67bb
1722 changed files with 165268 additions and 0 deletions

View File

@@ -0,0 +1,53 @@
using DynamicMusic;
using MusicUtils.Enums;
using System.Collections.Generic;
namespace Harmony.PlayerTrackerPatches
{
[HarmonyPatch(typeof(PlayerTracker))]
[HarmonyPatch("determineTrader")]
public class determineTraderPatch
{
public static bool Prefix(PlayerTracker __instance, ref SectionType __result,
List<Entity> ___npcs,
Vector3 ___boundingBoxRange
)
{
___npcs.Clear();
GameManager.Instance.World.GetEntitiesInBounds(typeof(EntityTrader), new Bounds(GameManager.Instance.World.GetPrimaryPlayer().position, ___boundingBoxRange), ___npcs);
if (___npcs.Count > 0)
{
EntityTrader entityTrader = ___npcs[0] as EntityTrader;
if (entityTrader != null)
{
string npcID = entityTrader.npcID;
if (npcID == "traitorjoel")
{
__result = SectionType.TraderJoel;
}
if (npcID == "traderjen")
{
__result = SectionType.TraderJen;
}
if (npcID == "traderbob")
{
__result = SectionType.TraderBob;
}
if (npcID == "traderhugh")
{
__result = SectionType.TraderHugh;
}
if (npcID == "traderrekt")
{
__result = SectionType.TraderRekt;
}
//Log.Warning(entityTrader.npcID + " is not a known trader name to DMS");
return false;
}
}
__result = SectionType.None;
return false;
}
}
}