Книга некроманта 1.0 — первая публичная версия
Мод для 7 Days to Die 3.2: навык «Некромантия», растущий от счётчика убитых зомби, тёмное оружие с шестью собственными модами, призывная нежить, пирамида духов и сюжетный финал через Чёрный портал. Локализация на 13 языках. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MaNro5hAGTzcQ7rJNN2tCX
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<!-- Tiny satellite assembly, separate from NecromancerHarmony.csproj on purpose - see
|
||||
PyramidWardWriteHelper.cs's own doc comment for the full reasoning. In short: calling
|
||||
PooledBinaryWriter.Write(bool) (or any of its overloads) from the main project fails to
|
||||
compile with CS7069 ("Reference to type 'ReadOnlySpan<>' requires it be defined in
|
||||
'mscorlib', but it could not be found") - Assembly-CSharp.dll's own ReadOnlySpan<char> usage
|
||||
resolves against Unity/Mono's own mscorlib.dll, not the modern .NET SDK's corlib the main
|
||||
project's plain netstandard2.1 setup implicitly references, and the compiler needs to fully
|
||||
resolve BinaryWriter.Write's entire overload set (including its ReadOnlySpan<byte> overload)
|
||||
just to pick the bool one. Confirmed via an isolated throwaway repro (multiple configurations
|
||||
tried - NoStdLib+explicit mscorlib.dll DOES fix it, but ALSO referencing UnityEngine's own
|
||||
DLLs alongside that setup breaks on UnityEngine.Vector3/Color/etc. needing `System.ValueType`
|
||||
from netstandard instead, and referencing BOTH mscorlib and netstandard together in the same
|
||||
project makes ReadOnlySpan<T> itself ambiguous and breaks System.Object/System.String
|
||||
resolution entirely) - there is no single project-wide combination of references that
|
||||
satisfies both "call BinaryWriter.Write" and "use UnityEngine types" at once. Rather than
|
||||
risk that fragility across this mod's ENTIRE existing, working codebase (every other
|
||||
HarmonySrc file uses UnityEngine types constantly), this one tiny helper - which needs
|
||||
NOTHING but PooledBinaryWriter/bool - gets its own project with the NoStdLib+mscorlib-only
|
||||
setup that specifically fixes it, compiled to its own small DLL dropped into the mod root
|
||||
alongside NecromancerHarmony.dll (the game scans every assembly in a mod's folder, not just
|
||||
one - confirmed by ModEntry.cs's own doc comment on how IModApi is discovered). The main
|
||||
project calls into this DLL instead of calling PooledBinaryWriter.Write directly. -->
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.1</TargetFramework>
|
||||
<AssemblyName>NecromancerTEPersistence</AssemblyName>
|
||||
<RootNamespace>NecromancerTome</RootNamespace>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<Nullable>disable</Nullable>
|
||||
<GenerateDependencyFile>false</GenerateDependencyFile>
|
||||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
||||
<OutputPath>bin\</OutputPath>
|
||||
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
|
||||
<NoStdLib>true</NoStdLib>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<!-- The game's OWN mscorlib (Mono/IL2CPP's backport, where Assembly-CSharp.dll's
|
||||
ReadOnlySpan<char> actually lives) instead of the .NET SDK's implicit one - this is the
|
||||
one substitution that actually fixes the overload-resolution error, confirmed empirically. -->
|
||||
<Reference Include="mscorlib">
|
||||
<HintPath>..\..\..\7DaysToDie_Data\Managed\mscorlib.dll</HintPath>
|
||||
<Private>false</Private>
|
||||
</Reference>
|
||||
<Reference Include="Assembly-CSharp">
|
||||
<HintPath>..\..\..\7DaysToDie_Data\Managed\Assembly-CSharp.dll</HintPath>
|
||||
<Private>false</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,26 @@
|
||||
namespace NecromancerTome
|
||||
{
|
||||
/// <summary>
|
||||
/// Exists ONLY because `PooledBinaryWriter.Write(bool)` (and every other Write overload) cannot
|
||||
/// be called from the main NecromancerHarmony project at all - see
|
||||
/// NecromancerTEPersistence.csproj's own comment for the full decompiled/tested reasoning
|
||||
/// (Assembly-CSharp.dll's overload set for Write includes a ReadOnlySpan<byte> variant
|
||||
/// that resolves against Unity/Mono's own mscorlib, which the main project's plain netstandard2.1
|
||||
/// setup can't see - the compiler needs to resolve the WHOLE overload set just to pick the bool
|
||||
/// one, and fails hard). PooledBinaryReader.ReadBoolean() has no such problem (confirmed
|
||||
/// separately - it's a plain no-overload method, not an ambiguous Write-style one) and is called
|
||||
/// directly from TEFeaturePyramidWard.Read() in the main project as normal; only the WRITE side
|
||||
/// needs to go through this satellite assembly.
|
||||
///
|
||||
/// TEFeaturePyramidWard.Write() (HarmonySrc/PyramidWardPatch.cs, in the main project) calls this
|
||||
/// instead of touching PooledBinaryWriter.Write itself.
|
||||
/// </summary>
|
||||
public static class PyramidWardWriteHelper
|
||||
{
|
||||
public static void Write(PooledBinaryWriter _bw, bool _effectOn, bool _zoneShown)
|
||||
{
|
||||
_bw.Write(_effectOn);
|
||||
_bw.Write(_zoneShown);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user