Рабочий гасит огонь, когда делать нечего; команды necrostation, necrourn contents

Гашение было только в настоящем шаге, а он запускается, лишь когда пробный нашёл дело -
пробный гашение делом не считал, огонь горел до конца топлива. Теперь погасить - дело:
дух летит к станции и гасит.

Проверено в игре: верстак (патроны), химстанция (клей), бетономешалка (песок), кузня
(переплавка лома и глины -> дротики), костёр; огонь гаснет у костра, химстанции и кузни;
разрушение урны - выпадают череп и образец; окно «Содержимое» - череп и образец.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
AlexCube
2026-10-18 17:26:37 +03:00
co-authored by Claude Opus 5.5
parent 5ba10eb59b
commit ab11517029
4 changed files with 61 additions and 1 deletions
+12 -1
View File
@@ -186,10 +186,21 @@ namespace NecromancerTome
st.Te.IsBurning = true;
}
}
else if (!_dry && st.Te.IsBurning)
else if (st.Te.IsBurning)
{
// Погасить - тоже дело: дух летит к станции. Пробный шаг должен его найти - иначе настоящий шаг не
// запускается и огонь горел до конца топлива (проверка 18.10: костёр, химстанция, кузня).
if (_dry)
{
return st.Pos;
}
st.Te.IsBurning = false;
Debug.Log("[NecromancerTome] Cinerarium: рабочий погасил станцию " + st.Pos + (full ? " - выход полон" : " - делать нечего"));
if (full)
{
_stuck = true;
}
return st.Pos;
}
if (full)
{
+49
View File
@@ -113,6 +113,45 @@ namespace NecromancerTome
Out("necroclear: растений убрано " + n);
break;
}
case "necrostation":
{
// necrostation x y z - станция текстом: огонь, топливо, вход, очередь, выход (проверка урны рабочего)
TileEntityWorkstation ws = CinerariumThreads.StationAt(w, P(_params, 0));
if (ws == null)
{
Out("necrostation: нет станции");
break;
}
string Stacks(ItemStack[] _a)
{
StringBuilder s = new StringBuilder();
if (_a != null)
{
foreach (ItemStack st in _a)
{
if (st != null && !st.IsEmpty())
{
s.Append(' ').Append(st.itemValue.ItemClass?.GetItemName()).Append('x').Append(st.count);
}
}
}
return s.Length > 0 ? s.ToString() : " -";
}
int q = 0;
if (ws.Queue != null)
{
foreach (RecipeQueueItem r in ws.Queue)
{
if (r != null && r.Recipe != null && r.Multiplier > 0)
{
q += r.Multiplier;
}
}
}
Out("necrostation: огонь " + (ws.IsBurning ? "горит" : "погашен") + ", топливо" + Stacks(ws.Fuel) + ", вход" + Stacks(ws.Input) +
", очередь " + q + ", выход" + Stacks(ws.Output));
break;
}
case "necrogod": God(pl, _params.Count == 0 || _params[0] != "off"); break;
case "necroclick":
// necroclick 0|1 [x y z] - по блоку под прицелом или по указанной клетке (луч не всегда попадает в низкий череп).
@@ -326,6 +365,7 @@ namespace NecromancerTome
case "sample":
u.SetSample(_p.Count > 5 ? new ItemStack(ItemClass.GetItem(_p[4], true), int.Parse(_p[5])) : ItemStack.Empty.Clone());
break;
case "contents": CinerariumContents.Open(GameManager.Instance.World.GetPrimaryPlayer(), u); break;
case "run": u.ZoneCommand("zurn_run", GameManager.Instance.World.GetPrimaryPlayer()); break;
case "stop": u.ZoneCommand("zurn_stop", null); break;
case "size": u.ZoneSide = int.Parse(_p[4]); u.SetModified(); break;
@@ -464,4 +504,13 @@ namespace NecromancerTome
public override bool AllowedInMainMenu => false;
public override void Execute(List<string> _params, CommandSenderInfo _senderInfo) => NecroDev.Run("necroclear", _params);
}
[Preserve]
public class ConsoleCmdNecroStation : ConsoleCmdAbstract
{
public override string[] getCommands() => new[] { "necrostation" };
public override string getDescription() => "NecromancerTome (разработка): станция текстом x y z";
public override bool AllowedInMainMenu => false;
public override void Execute(List<string> _params, CommandSenderInfo _senderInfo) => NecroDev.Run("necrostation", _params);
}
}
Binary file not shown.
Binary file not shown.