Кровавый камень - вечное топливо скакуна и оссуария; сферы чинятся пакетом крови
- Камень в любой ячейке скакуна - вечно полный бак, сферы рядом не тратятся. - Камень в отсеке топлива гео-оссуария - работает вечно (FuelTypes + removeFuel). - Кровавая сфера чинится пакетом крови: 250 прочности за пакет (2 пакета - полная). - Описания сферы, камня, оссуария и скакуна дополнены (13 языков); в описании скакуна по-корейски и по-китайски название сферы приведено к принятому в моде. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
a6e3f12eb4
commit
d35b77be1b
@@ -53,6 +53,23 @@ namespace NecromancerTome
|
||||
public static bool IsSphere(ItemValue iv) =>
|
||||
iv != null && !iv.IsEmpty() && iv.ItemClass != null && iv.ItemClass.Name == BoneSteed.FuelItem;
|
||||
|
||||
/// <summary>Кровавый камень - неиссякаемая сфера (01.10: «полная замена сферы»): один камень
|
||||
/// в любой ячейке - вечный полный бак, сферы рядом с ним не тратятся.</summary>
|
||||
public const string StoneItem = "resourceBloodStone";
|
||||
|
||||
public static bool IsStone(ItemValue iv) =>
|
||||
iv != null && !iv.IsEmpty() && iv.ItemClass != null && iv.ItemClass.Name == StoneItem;
|
||||
|
||||
public static bool HasStone(ItemValue item)
|
||||
{
|
||||
if (item == null)
|
||||
return false;
|
||||
for (int i = 0; i < item.ModificationCount; i++)
|
||||
if (IsStone(item.GetModification(i)))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>Остаток сферы 0..1.</summary>
|
||||
static float Left(ItemValue sphere)
|
||||
{
|
||||
@@ -67,6 +84,8 @@ namespace NecromancerTome
|
||||
ItemValue item = v?.itemValue;
|
||||
if (item == null)
|
||||
return 0f;
|
||||
if (HasStone(item))
|
||||
return MaxFuel;
|
||||
float fuel = 0f;
|
||||
for (int i = 0; i < item.ModificationCount; i++)
|
||||
{
|
||||
@@ -81,6 +100,8 @@ namespace NecromancerTome
|
||||
public static float Burn(Vehicle v, float amount)
|
||||
{
|
||||
ItemValue item = v.itemValue;
|
||||
if (HasStone(item))
|
||||
return MaxFuel;
|
||||
for (int i = 0; i < item.ModificationCount && amount > 0f; i++)
|
||||
{
|
||||
ItemValue m = item.GetModification(i);
|
||||
@@ -225,7 +246,7 @@ namespace NecromancerTome
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>В ячейки скакуна - только кровавые сферы с остатком прочности.</summary>
|
||||
/// <summary>В ячейки скакуна - только кровавые сферы с остатком прочности и кровавые камни.</summary>
|
||||
[HarmonyPatch(typeof(XUiC_ItemPartStack), "CanSwap")]
|
||||
public static class Patch_XUiC_ItemPartStack_CanSwap_BoneSteed
|
||||
{
|
||||
@@ -235,9 +256,10 @@ namespace NecromancerTome
|
||||
if (current == null || !BoneSteedFuel.IsSteedItem(current.itemValue))
|
||||
return true;
|
||||
ItemValue here = __instance.ItemValue;
|
||||
__result = BoneSteedFuel.IsSphere(stack.itemValue) &&
|
||||
stack.itemValue.UseTimes < stack.itemValue.MaxUseTimes &&
|
||||
(here == null || here.IsEmpty() || BoneSteedFuel.IsSphere(here));
|
||||
ItemValue add = stack.itemValue;
|
||||
bool blood = BoneSteedFuel.IsStone(add) ||
|
||||
BoneSteedFuel.IsSphere(add) && add.UseTimes < add.MaxUseTimes;
|
||||
__result = blood && (here == null || here.IsEmpty() || BoneSteedFuel.IsSphere(here) || BoneSteedFuel.IsStone(here));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user