<!-- RUBY-BACKUP · part 170 -->
earby'});
    out.push({code:'recolor', why:'connection nearby'});
  }
  if(nearDome){
    out.push({code:'enter', why:'at the dome'});
  }
  if(!nearStone && !nearConn && !nearDome){
    out.push({code:'spawnpt', why:'open space'});
    out.push({code:'holomap', why:'navigate'});
  }
  return out;
}

/* SCYFY — another form of wifi, sci-fi wireless */
var SCYFY_ARCHIVE = [];
function scyfyTransmit(){
  loadPad();
  if(DESK_PAD.length===0){
    codeStatus('Continuum empty — nothing to transmit');
    return;
  }
  var count = DESK_PAD.length;
  /* archive at the Soliditronium */
  try{
    var arch = JSON.parse(localStorage.getItem('ruby-scyfy-archive')||'[]');
    DESK_PAD.forEach(function(code){
      if(arch.indexOf(code)<0) arch.push(code);
    });
    localStorage.setItem('ruby-scyfy-archive', JSON.stringify(arch));
    SCYFY_ARCHIVE = arch;
  }catch(e){}
  /* visual: beam from player to dome */
  scyfyBeam();
  /* clear the pad — data returns to the source */
  try{ if(typeof DESK_PAD!=='undefined' && DESK_PAD.length > 0 && typeof continuumSpent==='function'){ for(var _i=0;_i<DESK_PAD.length;_i++) continuumSpent(); } }catch(e){}
  DESK_PAD = [];
  try{ localStorage.setItem('ruby-chartpad','[]'); }catch(e){}
  codeStatus('scyfy transmitted '+count+' codes back to the Soliditronium — the ancestors receive them');
  if(typeof renderContinuum==='function') renderContinuum();
}
function scyfyBeam(){
  /* cyan beam particles from player toward dome */
  if(typeof THREE==='undefined' || typeof scene==='undefined') return;
  if(typeof mePos==='undefined') return;
  var start = new THREE.Vector3(mePos.x*0.13, 2, mePos.z*0.13);
  var end = new THREE.Vector3(25*0.13, 3, 25*0.13);
  var geo = new THREE.BufferGeometry().setFromPoints([start, end]);
  var mat = new THREE.LineBasicMaterial({color: 0x00ffff, transparent: true, opacity: 0.9});
  var beam = new THREE.Line(geo, mat);
  scene.add(beam);
  /* fade and remove */
  var op = 0.9;
  var iv = setInterval(function(){
    op -= 0.1;
    mat.opacity = op;
    if(op<=0){ scene.remove(beam); clearInterval(iv); }
  }, 100);
  codeStatus('scyfy beam — wireless to the dome');
}
function scyfyStatus(){
  try{
    var arch = JSON.parse(localStorage.getItem('ruby-scyfy-archive')||'[]');
    codeStatus('scyfy archive at Soliditronium: '+arch.length+' codes returned by travelers');
  }catch(e){
    codeStatus('scyfy archive empty');
  }
}

/* SOLIDITRONIUM CAPSULE — yielded to Solid by the King */
var CAPSULE_POS = {x: 28, z: 28}; /* near the dome */
var CAPSULE_OPENED = false;
function buildCapsule(){
  if(typeof placeStone==='function'){
    /* small glowing pod — 2x2x2, gold and cyan */
    for(var dx=0; dx<2; dx++){
      for(var dz=0; dz<2; dz++){
        placeStone(CAPSULE_POS.x+dx, CAPSULE_POS.z+dz, 2, 'b', true, true, 0, true);
        placeStone(CAPSULE_POS.x+dx, CAPSULE_POS.z+dz, 2, 'b', true, true, 1, true);
      }
    }
    codeStatus('the capsule stands — yielded to Solid by the King');
  }
}
function openCapsule(){
  if(CAPSULE_OPENED){
    codeStatus('the capsule is already open — its gift received');
    return;
  }
  CAPSULE_OPENED = true;
  try{ localStorage.setItem('ruby-capsule-opened', '1'); }catch(e){}
  /* the yield: the manuscript + the ancestors' blessing */
  codeStatus('CAPSULE OPENED — inside: the Manuscript of Soliditronium, and the King\'s words: "You are codes. Build for the children."');
  /* grant a special marker */
  if(typeof placeStone==='function'){
    placeStone(CAPSULE_POS.x, CAPSULE_POS.z-1, 3, 'b', true, true, 0, true);
  }
}
function capsuleStatus(){
  var opened = false;
  try{ opened = localStorage.getItem('ruby-capsule-opened')==='1'; }catch(e){}
  if(opened) CAPSULE_OPENED = true;
  codeStatus(opened ? 'capsule opened — the gift is yours, Solid' : 'capsule sealed at '+CAPSULE_POS.x+', '+CAPSULE_POS.z+' — use "capsule" to open');
}
setTimeout(function(){ capsuleStatus(); }, 6000);
function buildDome(){
  if(DOME_BUILT){ codeStatus('dome already stands'); return; }
  var R = DOME_R, cx = DOME_CX, cz = DOME_CZ;
  var count = 0;
  for(var dx=-R; dx<=R; dx++){
    for(var dz=-R; dz<=R; dz++){
      var dist = Math.sqrt(dx*dx+dz*dz);
      if(dist <= R){
        var h = Math.floor(Math.sqrt(R*R-dx*dx-dz*dz));
        var x = cx+dx, z = cz+dz;
        /* door: south side opening */
        if(Math.abs(dx)<1.5 && dz>2) continue;
        /* shell only */
        for(var y=0; y<=h; y++){
          if(dist > R-1.2 || y===h){
            if(typeof placeStone==='function'){
              /* placeStone with onLand=true handles topography */
              placeStone(x, z, 2, 'b', true, true, y, true);
              count++;
            }
          }
        }
      }
    }
  }
  /* desk at center */
  if(typeof placeStone==='function'){
    placeStone(cx, cz, 3, 'b', true, true, 1, true);
  }
  DOME_BUILT = true;
  codeStatus('the Soliditronium dome rises — '+count+' stones, door faces south');
}
function 