diff --git a/HarmonySrc/CinerariumCraft.cs b/HarmonySrc/CinerariumCraft.cs index 3f1c56c..44d24b4 100644 --- a/HarmonySrc/CinerariumCraft.cs +++ b/HarmonySrc/CinerariumCraft.cs @@ -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) { diff --git a/HarmonySrc/NecroDevCommands.cs b/HarmonySrc/NecroDevCommands.cs index 5f1c736..5b1ffe5 100644 --- a/HarmonySrc/NecroDevCommands.cs +++ b/HarmonySrc/NecroDevCommands.cs @@ -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 _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 _params, CommandSenderInfo _senderInfo) => NecroDev.Run("necrostation", _params); + } } diff --git a/NecromancerHarmony.dll b/NecromancerHarmony.dll index 2b39832..fe8668a 100644 Binary files a/NecromancerHarmony.dll and b/NecromancerHarmony.dll differ diff --git a/NecromancerHarmony.pdb b/NecromancerHarmony.pdb index 43099a0..4d8b199 100644 Binary files a/NecromancerHarmony.pdb and b/NecromancerHarmony.pdb differ