Фильтр логиста: отдельная группа «Корм для кур»; призраками - только торговцы игры (NPCCore)
Корм кур - группа 22 в конце (биты старых не сдвинуты); у урн из прошлых сейвов она берёт выбор «Сырого», где корм был раньше. Число групп теперь пишется вторым числом. Призрачный вид - только у точного класса EntityTrader: NPC NPCCore (наследники EntityTrader) становились почти невидимыми (Nexus, Crozekanov, 16.10). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
d0f66c784e
commit
1b60cfd627
@@ -168,7 +168,8 @@ namespace NecromancerTome
|
||||
t.Add(HasThreadTo ? 1 : 0);
|
||||
t.Add(ThreadTo.x); t.Add(ThreadTo.y); t.Add(ThreadTo.z);
|
||||
CinerariumWriteHelper.WriteInts(_bw, t.ToArray());
|
||||
CinerariumWriteHelper.WriteInts(_bw, new[] { unchecked((int)GroupMask) });
|
||||
// Второе число - сколько групп было при записи: новые группы (в конец) у старых урн включаются по правилу ниже.
|
||||
CinerariumWriteHelper.WriteInts(_bw, new[] { unchecked((int)GroupMask), CinerariumGroups.Count });
|
||||
}
|
||||
|
||||
public override void Read(PooledBinaryReader _br, StreamModeRead _eStreamMode)
|
||||
@@ -203,6 +204,7 @@ namespace NecromancerTome
|
||||
if (version >= 3)
|
||||
{
|
||||
int n = _br.ReadInt32();
|
||||
int known = 22; // до 17.10 число групп не писалось - их было 22
|
||||
for (int i = 0; i < n; i++)
|
||||
{
|
||||
int v = _br.ReadInt32();
|
||||
@@ -210,6 +212,16 @@ namespace NecromancerTome
|
||||
{
|
||||
GroupMask = unchecked((uint)v);
|
||||
}
|
||||
else if (i == 1)
|
||||
{
|
||||
known = v;
|
||||
}
|
||||
}
|
||||
// Группы, которых урна ещё не знала: корм кур раньше ехал с «Сырым» - берёт его выбор, прочие новые - включены.
|
||||
for (int g = known; g < CinerariumGroups.Count; g++)
|
||||
{
|
||||
bool on = g == CinerariumGroups.ChickenFeed ? (GroupMask & (1u << CinerariumGroups.Raw)) != 0 : true;
|
||||
GroupMask = on ? GroupMask | (1u << g) : GroupMask & ~(1u << g);
|
||||
}
|
||||
}
|
||||
_threadsDirty = true;
|
||||
|
||||
@@ -17,8 +17,10 @@ namespace NecromancerTome
|
||||
{
|
||||
public const int Cooked = 0, Canned = 1, Raw = 2, Harvest = 3, Flowers = 4, Seeds = 5, Drinks = 6, Medicine = 7, Ore = 8,
|
||||
Ingots = 9, Parts = 10, Materials = 11, Chemicals = 12, Tools = 13, Weapons = 14, Ammo = 15, Armor = 16, Mods = 17,
|
||||
Books = 18, Blocks = 19, Necro = 20, Other = 21;
|
||||
public const int Count = 22;
|
||||
Books = 18, Blocks = 19, Necro = 20, Other = 21,
|
||||
// 17.10: «Корм для кур вынеси в отдельную группу» (был в «Сыром»).
|
||||
ChickenFeed = 22;
|
||||
public const int Count = 23;
|
||||
public const uint All = (1u << Count) - 1;
|
||||
|
||||
/// <summary>Значок группы - иконка типичного предмета (ItemIconAtlas).</summary>
|
||||
@@ -27,10 +29,11 @@ namespace NecromancerTome
|
||||
"foodMeatStew", "foodCanChili", "foodRawMeat", "foodCropCorn", "plantedChrysanthemum3Harvest", "plantedCorn1",
|
||||
"drinkJarBoiledWater", "medicalFirstAidKit", "resourceRockSmall", "resourceForgedSteel", "resourceMechanicalParts",
|
||||
"resourceWood", "resourceGunPowder", "meleeToolPickT1IronPickaxe", "gunHandgunT1Pistol", "ammo9mmBulletBall",
|
||||
"armorMinerHelmet", "modGunLaserSight", "bookArtOfMiningLuckyStrike", "cobblestoneMaster", "necroSkull", "oldCash"
|
||||
"armorMinerHelmet", "modGunLaserSight", "bookArtOfMiningLuckyStrike", "cobblestoneMaster", "necroSkull", "oldCash",
|
||||
"resourceChickenFeed"
|
||||
};
|
||||
|
||||
/// <summary>Ключ названия группы в Localization.csv: necroGroup0..necroGroup21.</summary>
|
||||
/// <summary>Ключ названия группы в Localization.csv: necroGroup0..necroGroup22.</summary>
|
||||
public static string NameKey(int _g) => "necroGroup" + _g;
|
||||
|
||||
static readonly HashSet<string> OreNames = new HashSet<string>
|
||||
@@ -62,7 +65,7 @@ namespace NecromancerTome
|
||||
};
|
||||
static readonly HashSet<string> RawNames = new HashSet<string>
|
||||
{
|
||||
"foodRawMeat", "foodRawMeatBundle", "foodEgg", "foodHoney", "foodRottingFlesh", "resourceChickenFeed"
|
||||
"foodRawMeat", "foodRawMeatBundle", "foodEgg", "foodHoney", "foodRottingFlesh"
|
||||
};
|
||||
|
||||
/// <summary>Предметы и блоки самого мода - по его Config/items.xml и blocks.xml (у многих нет «necro» в имени: книги
|
||||
@@ -124,6 +127,10 @@ namespace NecromancerTome
|
||||
{
|
||||
return Necro;
|
||||
}
|
||||
if (n == "resourceChickenFeed")
|
||||
{
|
||||
return ChickenFeed;
|
||||
}
|
||||
if (_ic is ItemClassModifier)
|
||||
{
|
||||
return Mods;
|
||||
|
||||
@@ -319,7 +319,9 @@ namespace NecromancerTome
|
||||
{
|
||||
if (_entity is EntityTrader)
|
||||
{
|
||||
return true;
|
||||
// Только торговцы самой игры (класс EntityTrader). 16.10 (Nexus, Crozekanov): NPC мода NPCCore построены на
|
||||
// наследнике EntityTrader и тоже становились призраками - «практически невидимыми».
|
||||
return _entity.GetType() == typeof(EntityTrader);
|
||||
}
|
||||
EntityClass entityClass = EntityClass.list[_entity.entityClass];
|
||||
if (entityClass == null || entityClass.entityClassName == null)
|
||||
|
||||
Reference in New Issue
Block a user