public virtual void OnWireCut(int wire) { if (module.IsAnimating()) { return; } module.GetComponent <KMAudio>().PlayGameSoundAtTransform(KMSoundOverride.SoundEffect.WireSnip, module.transform); module.CutWire(wire); if (module.IsSolved()) { return; } if (!module.CheckValidComponents()) { Debug.LogFormat("[The Modkit #{0}] Strike! Cut wire {1} when component selection was [ {2} ] instead of [ {3} ].", moduleId, wire + 1, module.GetOnComponents(), module.GetTargetComponents()); module.CauseStrike(); module.RegenWires(); return; } module.StartSolve(); }
public GatedMaze(Modkit module, int moduleId, ComponentInfo info) : base(module, moduleId, info) { Debug.LogFormat("[The Modkit #{0}] Solving Gated Maze. LEDs are: {1}.", moduleId, info.LED.Select(x => ComponentInfo.COLORNAMES[x]).Join(", ")); destination = module.bomb.GetSerialNumberNumbers().Sum() % 64; if (numberGroup.Contains(destination)) { do { origin = rnd.Range(0, 64); } while (numberGroup.Contains(origin)); } else { do { origin = rnd.Range(0, 64); } while (!numberGroup.Contains(origin)); } Debug.LogFormat("[The Modkit #{0}] Origin: {1}. Destination: {2}.", moduleId, origin, destination); allMoves.Add(origin); for (int i = 0; i < maze.Length; i++) { for (int j = 0; j < maze[i].Length; j++) { if (maze[i][j] == origin) { row = i; col = j; break; } } } module.bomb.OnBombExploded += delegate { if (module.IsSolved()) { return; } Debug.LogFormat("[The Modkit #{0}] Moves taken up to detonation: {1} ", moduleId, allMoves.Join(" => ")); }; }