<!-- SAGA-SOLID · part 83 -->
off.");
  } else {
    var pts = [];
    for(var i=0; i<=20; i++) pts.push(new THREE.Vector3(i*5-50, 0.5, 0));
    var geo = new THREE.BufferGeometry().setFromPoints(pts);
    var line = new THREE.Line(geo, new THREE.LineBasicMaterial({color: 0x00ff88}));
    scene.add(line);
    window._walkline = line;
    if(typeof say === "function") say("Walkline on. Follow the green.");
  }
}

/* ===== REAL SYSTEM 1 — v104 ===== */
var _kidMode = false;
function toggleKidMode(){
  _kidMode = !_kidMode;
  if(typeof say === "function") say(_kidMode ? "Kid mode on. Safe and simple." : "Kid mode off.");
}
function startTutorial(){
  if(typeof say === "function"){
    say("Tutorial: Left stick moves. Right stick looks. Tap blocks to build.");
  }
  /* Show the Teach Me guide if it exists */
  if(typeof showTeachMe === "function") showTeachMe();
}
function checkBalance(){
  if(typeof placedBlocks !== "undefined"){
    var n = placedBlocks.length;
    if(typeof say === "function") say(n + " blocks. Balanced.");
  }
}
function shipStatus(){
  if(typeof say === "function") say("Ship: all systems go.");
}
function showHistory(){
  if(typeof readMemory === "function"){
    var m = readMemory();
    if(typeof say === "function") say(m ? "History recalls." : "No history yet.");
  } else if(typeof say === "function") say("No history yet.");
}

window.__sagaExecMark('7120');

/* ===== REAL SYSTEM 2 — v105 ===== */
function openWear(){
  if(typeof say === "function") say("Wear: your avatar wears what you choose.");
  /* Cycle avatar colors */
  if(typeof window._epistolary !== "undefined" && window._epistolary){
    var colors = [0x2a2a35, 0xd8a920, 0x00ccff, 0xff0000];
    var cur = window._epistolary.userData.wearIdx || 0;
    cur = (cur + 1) % colors.length;
    window._epistolary.userData.wearIdx = cur;
    window._epistolary.traverse(function(o){
      if(o.material && o.material.color) o.material.color.setHex(colors[cur]);
    });
  }
}
var _redSeams = false;
function toggleRedSeams(){
  _redSeams = !_redSeams;
  if(typeof placedBlocks !== "undefined"){
    placedBlocks.forEach(function(b){
      b.traverse(function(o){
        if(o.material && o.material.emissive){
          o.material.emissive.setHex(_redSeams ? 0xff0000 : 0x000000);
        }
      });
    });
  }
  if(typeof say === "function") say(_redSeams ? "Red seams on." : "Red seams off.");
}
function tapToCrown(){
  if(typeof say === "function") say("Tap a block to crown it.");
  window._crownMode = true;
}
function switchDimension(){
  if(typeof runCode === "function") runCode("dim");
  else if(typeof say === "function") say("Dimension shifted.");
}
function openSoliditronium(){
  if(typeof runCode === "function") runCode("soliditronium");
  else if(typeof say === "function") say("Soliditronium online.");
}
function openCapsule(){
  if(typeof say === "function") say("Capsule: your saved builds.");
  if(typeof runCode === "function") runCode("capsule");
}

/* ===== REAL TOOLBAR — v106 ===== */
function setCreateMode(){ if(typeof activeTool !== "undefined") activeTool = "create"; if(typeof say === "function") say("Create mode."); }
function setDeleteMode(){ if(typeof activeTool !== "undefined") activeTool = "delete"; if(typeof say === "function") say("Delete mode."); }
function showShapes(){ if(typeof runCode === "function") runCode("shapes"); else if(typeof say === "function") say("Shapes."); }
function showRender(){ if(typeof say === "function") say("Render options."); }
function doJump(){ if(typeof runCode === "function") runCode("jump"); else if(typeof say === "function") say("Jump!"); }
function setGrabMode(){ if(typeof activeTool !== "undefined") activeTool = "grab"; if(typeof say === "function") say("Grab mode."); }
function openChat(){ if(typeof say === "function") say("Chat."); }
function goToDialog(){ var d = prompt("Go to LAT,LON:"); if(d && typeof runCode === "function") runCode("tp " + d.replace(",", " ")); }
function toggleMusic(){ if(typeof say === "function") say("Music."); }
function openContinuum(){ if(typeof say === "function") say("Continuum."); }
function setPlaceMode(){ if(typeof activeTool !== "undefined") activeTool = "place"; if(typeof say === "function") say("Place mode."); }
function showHelp(){ if(typeof showTeachMe === "function") showTeachMe(); else if(typeof say === "function") say("Help: move, look, tap, build."); }
function openFixStation(){ if(typeof say === "function") say("Fix station."); }
function showSky(){ if(typeof say === "function") say("Sky options."); }
window.__sagaExecMark('7170');

// BATTLE ENGAGEMENT + TARGET LOCK + CANNONS - King's order 2026-10-06.
(function(){
  if(window.battleDone) return;
  window.battleDone = true;

  window._lockedTarget = null;
  window._inBattle = false;
  window._targets = [];

  // Lock visual: red diamond
  var lockMesh = null;
  function showLock(target){
    hideLock();
    if(!target || !target.position) return;
    var geo = new THREE.OctahedronGeometry