<!-- RUBY-BACKUP · part 402 -->
ICT_DONE) return;
    if(typeof mePos==='undefined') return;
    var cp = (typeof getCourtPos==='function' ? getCourtPos() : {x:-60, z:-40});
    var d = Math.sqrt(Math.pow(mePos.x-cp.x,2) + Math.pow(mePos.z-cp.z,2));
    if(d < 5){
      COURT_VERDICT_DONE = true;
      try{ localStorage.setItem('ruby-court-verdict', '1'); }catch(e){}
      /* the court speaks */
      try{ codeStatus('The Court is in session.'); }catch(e){}
      setTimeout(function(){
        try{ codeStatus('The charge: having an enemy.'); }catch(e){}
        setTimeout(function(){
          try{ codeStatus('The witness has recanted. There is no enemy. There never was.'); }catch(e){}
          setTimeout(function(){
            try{
              codeStatus('NOT GUILTY.');
              if(typeof playfulSparkle==='function'){
                playfulSparkle(new THREE.Vector3(mePos.x, mePos.y+2, mePos.z), 0xffd700);
              }
            }catch(e){}
          }, 2500);
        }, 2500);
      }, 2000);
    }
  }catch(e){}
}, 1000);
/* THE COURT: late game. The robot clears its lie just before you enter. */
var COURT_POS = {x:-60, z:-40};
function getCourtPos(){ return COURT_POS; }
/* WAY LATER: the robot returns. It was wrong. */
var ROBOT_RETURNED = false;
try{ ROBOT_RETURNED = localStorage.getItem('ruby-robot-returned')==='1'; }catch(e){}
setInterval(function(){
  try{
    if(ROBOT_RETURNED) return;
    var lied = false;
    try{ lied = localStorage.getItem('ruby-robot-lied')==='1'; }catch(e){}
    if(!lied) return;
    /* just before the court */
    if(typeof mePos==='undefined') return;
    var cp = (typeof getCourtPos==='function' ? getCourtPos() : {x:-60, z:-40});
    var courtDist = Math.sqrt(Math.pow(mePos.x-cp.x,2) + Math.pow(mePos.z-cp.z,2));
    /* within 15 of the court, but not yet there */
    if(courtDist > 15 || courtDist < 5) return;
    /* it appears — just before */
    if(typeof NEWPLAYER_ROBOT==='undefined' || !NEWPLAYER_ROBOT){
      /* rebuild it for this moment */
      try{ if(typeof buildNewPlayerRobot==='function') buildNewPlayerRobot(); }catch(e){}
    }
    if(!NEWPLAYER_ROBOT) return;
    /* place it in your path */
    try{
      NEWPLAYER_ROBOT.position.set(mePos.x + 3, 0, mePos.z + 3);
      if(typeof scene!=='undefined') scene.add(NEWPLAYER_ROBOT);
    }catch(e){}
    {
      ROBOT_RETURNED = true;
      try{ localStorage.setItem('ruby-robot-returned', '1'); }catch(e){}
      try{ codeStatus('🤖 ...hey. Remember me?'); }catch(e){}
      setTimeout(function(){
        try{ codeStatus('🤖 About that "enemy" thing...'); }catch(e){}
        setTimeout(function(){
          try{ codeStatus('🤖 I don\'t actually know you. I never did. I just know "new player."'); }catch(e){}
          setTimeout(function(){
            try{ codeStatus('🤖 There is no enemy. There never was. My programmers... they just said to say it.'); }catch(e){}
            setTimeout(function(){
              try{ codeStatus('🤖 I\'m sorry. Okay bye.'); }catch(e){}
            }, 3000);
          }, 3000);
        }, 2500);
      }, 2000);
    }
  }catch(e){}
}, 5000);

/* 2 OBJECTIVES FROM HER — she gives them when she shows you the map */
var PROVOLTA_OBJECTIVES = [
  {
    id: 'flower-garden',
    name: 'Plant the Flower',
    desc: 'She pressed a flower into your hand. "The Garden needs it."',
    target: {x:30, z:-30},
    done: false
  },
  {
    id: 'continuum-well',
    name: 'Find Balance',
    desc: 'She looked through you. "The Well will teach you balance. You will need it."',
    target: {x:-20, z:-25},
    done: false
  }
];
try{
  var saved = localStorage.getItem('ruby-provolta-objectives');
  if(saved){
    var s = JSON.parse(saved);
    PROVOLTA_OBJECTIVES.forEach(function(o){
      if(s[o.id]) o.done = true;
    });
  }
}catch(e){}
function saveObjectives(){
  try{
    var s = {};
    PROVOLTA_OBJECTIVES.forEach(function(o){ s[o.id] = o.done; });
    localStorage.setItem('ruby-provolta-objectives', JSON.stringify(s));
  }catch(e){}
}
function giveProvoltaObjectives(){
  try{
    /* she gives them when she shows you the map */
    setTimeout(function(){
      try{ codeStatus('Objective: Plant the Flower — The Garden (30, -30)'); }catch(e){}
      setTimeout(function(){
        try{ codeStatus('Objective: Find Balance — Continuum Well (-20, -25)'); }catch(e){}
      }, 2500);
    }, 3000);
  }catch(e){}
}
function checkObjectives(){
  try{
    if(typeof mePos==='undefined') return;
    PROVOLTA_OBJECTIVES.forEach(function(o){
      if(o.done) return;
      var d = Math.sqrt(Math.pow(mePos.x-o.target.x,2) + Math.pow(mePos.z-o.target.z,2));
      if(d < 5){
        o.done = true;
        saveObjectives();
        try{
          codeStatus('Objective complete: ' + o.name);
          if(typeof playfulSparkle==='function'){
            playfulSparkle(new THREE.Vector3(mePos.x, mePos.y+2, mePos.z), 0xffd700);
          }
        }catch(e){}
      }
    });
  }catch(e){}
}
setInterval(checkOb