R&R CRDD: Difference between revisions

From The Jadnix Codex

No edit summary
No edit summary
Line 1: Line 1:
<div class="faction-skipper">
/* ============================================================
  R&R CRDD CALCULATOR LOGIC (V2 - Fixed Display)
  ============================================================ */
$(function() {
    // Only run if the calculator exists
    if (!$('#crdd-interface').length) return;


<html>
     // 1. UPDATE INDIVIDUAL NUMBERS INSTANTLY
<!-- HEADER SECTION (Inside HTML for the image) -->
    $('.crdd-range').on('input', function() {
<div style="display: flex; align-items: center; gap: 20px; margin-bottom: 20px;">
         // Find the "0" next to this slider and update it
     <!-- FIXED IMAGE: Added width constraint in style so it can't blow up -->
         $(this).next('.crdd-value-display').text($(this).val());
    <img src="https://files.catbox.moe/8gs8n5.png"
     });
        style="width: 100px; height: auto; filter: drop-shadow(0 0 5px #21b0cd);">
   
    <div>
         <h1 style="margin: 0; color: #21b0cd; font-family: monospace; font-size: 1.8em; line-height: 1.2;">Rescue & Removal Corps’ Rating Detection Device</h1>
         <small style="color: #888; font-size: 0.8em;">CORPS RATING DETECTION DEVICE // V.1.0.4</small>
     </div>
</div>
</html>


Welcome! So, it’s your first time out there on the field, and you really need to figure out the up’s and down’s of a Seam. Not only that, your teammates are relying on you to do it right (and not break anything)! There’s so many things to keep track of, how’s one to do it all by their lonesome?! Fear not, fellow Surveyor, we at the R&R Corps worked hard with the rest of the W.S.G. to make everyone’s jobs easier with… the R&RC RDD! Or… the R&R CRDD…? Just call it the CRDD! Unsure what that stands for? Look at the header of this entry…
    // 2. CALCULATE TOTALS
    function updateCRDD() {
        let totalScore = 0;
        let activeMaxScore = 0;
        let criticalOverride = false;
       
        // --- SECTION 1: SUBJECT ---
        let subjSkip = $('#skip-subject').is(':checked');
        if (!subjSkip) {
            let s1 = parseInt($('#s-strength').val()) || 0;
            let s2 = parseInt($('#s-durability').val()) || 0;
            let s3 = parseInt($('#s-mobility').val()) || 0;
            let s4 = parseInt($('#s-intel').val()) || 0;
            let s5 = parseInt($('#s-stamina').val()) || 0;
            let s6 = parseInt($('#s-threat').val()) || 0;
            let s7 = parseInt($('#s-swarm').val()) || 0;
           
            if (s6 > 24) criticalOverride = true;
           
            let avg = (s1+s2+s3+s4+s5+s6+s7) / 7;
            totalScore += avg;
            activeMaxScore += 33;
           
            let rating = "DOCILE";
            if (avg > 8) rating = "NEUTRAL";
            if (avg > 16) rating = "HOSTILE";
            if (avg > 24) rating = "VILE";
            $('#result-subject').text(avg.toFixed(1) + " (" + rating + ")");
           
            if (avg > 24) criticalOverride = true;
        } else {
            $('#result-subject').text("SKIPPED");
        }


== What is the CRDD? ==
        // --- SECTION 2: ITEM ---
Our Corps’ Rating Detection Device is a nifty little machine that combines the permanence skills of the Stills with the contract-magic (and money) of the Dealers and the secret know-how of us Skippers! It’s designed to… think of it like a calculator that does the hard part of CORRECTLY rating a Seam for you! All you have to do is put in the numbers, scan the stuff, and send it over to the others. Easy, right?
        let itemSkip = $('#skip-item').is(':checked');
        if (!itemSkip) {
            let i1 = parseInt($('#i-entropy').val()) || 0;
            let i2 = parseInt($('#i-instability').val()) || 0;
            let i3 = parseInt($('#i-radiation').val()) || 0;
            let i4 = parseInt($('#i-corrupt').val()) || 0;
            let i5 = parseInt($('#i-volatility').val()) || 0;
            let i6 = parseInt($('#i-unport').val()) || 0;
            let i7 = parseInt($('#i-anomalous').val()) || 0;
            let i8 = parseInt($('#i-qty').val()) || 0;


Everyone’s supposed to be issued one, but so far only the R&R have it, all the more reason to stick together, eh? Seriously, don’t lose this.
            if (i7 > 24) criticalOverride = true;


== THE CALCULATOR ==
            let avg = (i1+i2+i3+i4+i5+i6+i7+i8) / 8;
<html>
            totalScore += avg;
<!-- CALCULATOR START -->
            activeMaxScore += 33;
<div id="crdd-interface">
           
    <div class="crdd-header">
            let rating = "FUNCTIONAL";
         SYSTEM ONLINE // CONNECTED<br>
            if (avg > 8) rating = "ALTERED";
         USER: GUEST SURVEYOR
            if (avg > 16) rating = "UNSTABLE";
    </div>
            if (avg > 24) rating = "VOID";
            $('#result-item').text(avg.toFixed(1) + " (" + rating + ")");
         } else {
            $('#result-item').text("SKIPPED");
         }


    <!-- SECTION 1: SUBJECT -->
        // --- SECTION 3: SEAM ---
    <div class="crdd-section">
        let seamSkip = $('#skip-seam').is(':checked');
         <div class="crdd-section-title">1 / 3 SUBJECT INFO</div>
         if (!seamSkip) {
        <label class="crdd-skip-label"><input type="checkbox" id="skip-subject"> SKIP THIS SECTION (Data will be excluded)</label>
            let m1 = parseInt($('#m-instability').val()) || 0;
            let m2 = parseInt($('#m-leakage').val()) || 0;
            let m3 = parseInt($('#m-geo').val()) || 0;
            let m4 = parseInt($('#m-atmo').val()) || 0;
            let m5 = parseInt($('#m-topo').val()) || 0;
            let m6 = parseInt($('#m-dead').val()) || 0;
            let m7 = parseInt($('#m-laws').val()) || 0;


        <div class="crdd-input-group"><label>Strength</label><input type="range" class="crdd-range" id="s-strength" max="33" value="0"><span class="crdd-value-display">0</span></div>
            if (m3 > 24 || m4 > 24 || m6 > 24 || m7 > 24) criticalOverride = true;
        <div class="crdd-input-group"><label>Durability</label><input type="range" class="crdd-range" id="s-durability" max="33" value="0"><span class="crdd-value-display">0</span></div>
        <div class="crdd-input-group"><label>Mobility</label><input type="range" class="crdd-range" id="s-mobility" max="33" value="0"><span class="crdd-value-display">0</span></div>
        <div class="crdd-input-group"><label>Intelligence</label><input type="range" class="crdd-range" id="s-intel" max="33" value="0"><span class="crdd-value-display">0</span></div>
        <div class="crdd-input-group"><label>Stamina</label><input type="range" class="crdd-range" id="s-stamina" max="33" value="0"><span class="crdd-value-display">0</span></div>
        <div class="crdd-input-group"><label style="color: #ff4500;">THREAT INDEX</label><input type="range" class="crdd-range" id="s-threat" max="33" value="0"><span class="crdd-value-display">0</span></div>
        <div class="crdd-input-group"><label>Swarm Qty</label><input type="range" class="crdd-range" id="s-swarm" max="33" value="0"><span class="crdd-value-display">0</span></div>
       
        <div style="text-align: right; margin-top: 10px; border-top: 1px solid #333; padding-top: 5px;">
            ESTIMATED BEHAVIOR: <span id="result-subject" style="color:#fff; font-weight:bold;">0.0 (DOCILE)</span>
        </div>
    </div>


    <!-- SECTION 2: ITEM -->
            let avg = (m1+m2+m3+m4+m5+m6+m7) / 7;
    <div class="crdd-section">
            totalScore += avg;
        <div class="crdd-section-title">2 / 3 ITEM INFO</div>
            activeMaxScore += 33;
        <label class="crdd-skip-label"><input type="checkbox" id="skip-item"> SKIP THIS SECTION</label>
           
            let rating = "ANCHORED";
            if (avg > 8) rating = "VOLATILE";
            if (avg > 16) rating = "FRACTURED";
            if (avg > 24) rating = "NULL";
            $('#result-seam').text(avg.toFixed(1) + " (" + rating + ")");
            if (avg > 24) criticalOverride = true;
        } else {
            $('#result-seam').text("SKIPPED");
        }


         <div class="crdd-input-group"><label>Entropy</label><input type="range" class="crdd-range" id="i-entropy" max="33" value="0"><span class="crdd-value-display">0</span></div>
         // --- FINAL RESULT ---
        <div class="crdd-input-group"><label>Instability</label><input type="range" class="crdd-range" id="i-instability" max="33" value="0"><span class="crdd-value-display">0</span></div>
         let finalBox = $('#crdd-final-output');
         <div class="crdd-input-group"><label>Radiation</label><input type="range" class="crdd-range" id="i-radiation" max="33" value="0"><span class="crdd-value-display">0</span></div>
         let finalLabel = $('#crdd-final-label');
         <div class="crdd-input-group"><label>Corruptivity</label><input type="range" class="crdd-range" id="i-corrupt" max="33" value="0"><span class="crdd-value-display">0</span></div>
          
         <div class="crdd-input-group"><label>Volatility</label><input type="range" class="crdd-range" id="i-volatility" max="33" value="0"><span class="crdd-value-display">0</span></div>
         if (activeMaxScore === 0) {
         <div class="crdd-input-group"><label>Unportability</label><input type="range" class="crdd-range" id="i-unport" max="33" value="0"><span class="crdd-value-display">0</span></div>
            finalBox.text("ERROR: NO DATA");
        <div class="crdd-input-group"><label style="color: #ff4500;">ANOMALOUS PROP.</label><input type="range" class="crdd-range" id="i-anomalous" max="33" value="0"><span class="crdd-value-display">0</span></div>
            finalBox.css('color', 'red');
         <div class="crdd-input-group"><label>Quantity</label><input type="range" class="crdd-range" id="i-qty" max="33" value="0"><span class="crdd-value-display">0</span></div>
            return;
         }


         <div style="text-align: right; margin-top: 10px; border-top: 1px solid #333; padding-top: 5px;">
         let percent = (totalScore / activeMaxScore) * 100;
            ESTIMATED UTILITY: <span id="result-item" style="color:#fff; font-weight:bold;">0.0 (FUNCTIONAL)</span>
          
         </div>
         if (criticalOverride) {
    </div>
            finalLabel.text("CRITICAL THREAT DETECTED");
 
            finalBox.text("NULL (LEAVE NOW)");
    <!-- SECTION 3: SEAM -->
            finalBox.css({
    <div class="crdd-section">
                'color': '#000000',
         <div class="crdd-section-title">3 / 3 SEAM INFO</div>
                'background': '#fff',
        <label class="crdd-skip-label"><input type="checkbox" id="skip-seam"> SKIP THIS SECTION</label>
                'text-shadow': '0 0 10px red'
 
             });
        <div class="crdd-input-group"><label>Instability</label><input type="range" class="crdd-range" id="m-instability" max="33" value="0"><span class="crdd-value-display">0</span></div>
         } else {
        <div class="crdd-input-group"><label>Leakage</label><input type="range" class="crdd-range" id="m-leakage" max="33" value="0"><span class="crdd-value-display">0</span></div>
            let finalRating = "ANCHORED";
        <div class="crdd-input-group"><label style="color: #ff4500;">GEOMETRIC VIOL.</label><input type="range" class="crdd-range" id="m-geo" max="33" value="0"><span class="crdd-value-display">0</span></div>
            let finalColor = "#00ff9f";  
        <div class="crdd-input-group"><label style="color: #ff4500;">TOXICITY</label><input type="range" class="crdd-range" id="m-atmo" max="33" value="0"><span class="crdd-value-display">0</span></div>
            let finalMsg = "YOU ARE SAFE";
        <div class="crdd-input-group"><label>Topo Hazards</label><input type="range" class="crdd-range" id="m-topo" max="33" value="0"><span class="crdd-value-display">0</span></div>
        <div class="crdd-input-group"><label style="color: #ff4500;">DEAD ENDS</label><input type="range" class="crdd-range" id="m-dead" max="33" value="0"><span class="crdd-value-display">0</span></div>
        <div class="crdd-input-group"><label style="color: #ff4500;">BROKEN LAWS</label><input type="range" class="crdd-range" id="m-laws" max="33" value="0"><span class="crdd-value-display">0</span></div>
 
        <div style="text-align: right; margin-top: 10px; border-top: 1px solid #333; padding-top: 5px;">
             ESTIMATED STABILITY: <span id="result-seam" style="color:#fff; font-weight:bold;">0.0 (ANCHORED)</span>
         </div>
    </div>
 
    <!-- RESULT -->
    <div id="crdd-final-result">
        <div id="crdd-final-label" style="font-size: 0.6em; margin-bottom: 10px;">STAND BY...</div>
        <div id="crdd-final-output">ANCHORED (0.0%)</div>
    </div>
</div>
<!-- END OF HTML (Closing the tag before going back to Wiki Text) -->
</html>


== P.S. ==
            if (percent > 25) { finalRating = "VOLATILE"; finalColor = "#ffd700"; finalMsg = "PROCEED WITH CAUTION"; }
P.S. it won’t tell you purple Ratings. :)
            if (percent > 50) { finalRating = "FRACTURED"; finalColor = "#ff4500"; finalMsg = "YOU ARE IN DANGER"; }
            if (percent > 75) { finalRating = "NULL"; finalColor = "#555"; finalMsg = "LEAVE NOW"; }


—the Rescue and Removal Corps.
            finalLabel.text(finalMsg);
            finalBox.text(finalRating + " (" + percent.toFixed(1) + "%)");
            finalBox.css({
                'color': finalColor,
                'background': 'transparent',
                'text-shadow': '0 0 10px ' + finalColor
            });
        }
    }


</div>
    // Trigger update on any change
    $('.crdd-range, input[type=checkbox]').on('input change', updateCRDD);
});

Revision as of 13:32, 9 February 2026

/* ============================================================

  R&R CRDD CALCULATOR LOGIC (V2 - Fixed Display)
  ============================================================ */

$(function() {

   // Only run if the calculator exists
   if (!$('#crdd-interface').length) return;
   // 1. UPDATE INDIVIDUAL NUMBERS INSTANTLY
   $('.crdd-range').on('input', function() {
       // Find the "0" next to this slider and update it
       $(this).next('.crdd-value-display').text($(this).val());
   });
   // 2. CALCULATE TOTALS
   function updateCRDD() {
       let totalScore = 0;
       let activeMaxScore = 0;
       let criticalOverride = false;
       
       // --- SECTION 1: SUBJECT ---
       let subjSkip = $('#skip-subject').is(':checked');
       if (!subjSkip) {
           let s1 = parseInt($('#s-strength').val()) || 0;
           let s2 = parseInt($('#s-durability').val()) || 0;
           let s3 = parseInt($('#s-mobility').val()) || 0;
           let s4 = parseInt($('#s-intel').val()) || 0;
           let s5 = parseInt($('#s-stamina').val()) || 0;
           let s6 = parseInt($('#s-threat').val()) || 0;
           let s7 = parseInt($('#s-swarm').val()) || 0;
           
           if (s6 > 24) criticalOverride = true;
           
           let avg = (s1+s2+s3+s4+s5+s6+s7) / 7;
           totalScore += avg;
           activeMaxScore += 33;
           
           let rating = "DOCILE";
           if (avg > 8) rating = "NEUTRAL";
           if (avg > 16) rating = "HOSTILE";
           if (avg > 24) rating = "VILE";
           $('#result-subject').text(avg.toFixed(1) + " (" + rating + ")");
           
           if (avg > 24) criticalOverride = true;
       } else {
            $('#result-subject').text("SKIPPED");
       }
       // --- SECTION 2: ITEM ---
       let itemSkip = $('#skip-item').is(':checked');
       if (!itemSkip) {
           let i1 = parseInt($('#i-entropy').val()) || 0;
           let i2 = parseInt($('#i-instability').val()) || 0;
           let i3 = parseInt($('#i-radiation').val()) || 0;
           let i4 = parseInt($('#i-corrupt').val()) || 0;
           let i5 = parseInt($('#i-volatility').val()) || 0;
           let i6 = parseInt($('#i-unport').val()) || 0;
           let i7 = parseInt($('#i-anomalous').val()) || 0;
           let i8 = parseInt($('#i-qty').val()) || 0;
           if (i7 > 24) criticalOverride = true;
           let avg = (i1+i2+i3+i4+i5+i6+i7+i8) / 8;
           totalScore += avg;
           activeMaxScore += 33;
           
           let rating = "FUNCTIONAL";
           if (avg > 8) rating = "ALTERED";
           if (avg > 16) rating = "UNSTABLE";
           if (avg > 24) rating = "VOID";
           $('#result-item').text(avg.toFixed(1) + " (" + rating + ")");
       } else {
           $('#result-item').text("SKIPPED");
       }
       // --- SECTION 3: SEAM ---
       let seamSkip = $('#skip-seam').is(':checked');
       if (!seamSkip) {
           let m1 = parseInt($('#m-instability').val()) || 0;
           let m2 = parseInt($('#m-leakage').val()) || 0;
           let m3 = parseInt($('#m-geo').val()) || 0;
           let m4 = parseInt($('#m-atmo').val()) || 0;
           let m5 = parseInt($('#m-topo').val()) || 0;
           let m6 = parseInt($('#m-dead').val()) || 0;
           let m7 = parseInt($('#m-laws').val()) || 0;
           if (m3 > 24 || m4 > 24 || m6 > 24 || m7 > 24) criticalOverride = true;
           let avg = (m1+m2+m3+m4+m5+m6+m7) / 7;
           totalScore += avg;
           activeMaxScore += 33;
           
           let rating = "ANCHORED";
           if (avg > 8) rating = "VOLATILE";
           if (avg > 16) rating = "FRACTURED";
           if (avg > 24) rating = "NULL";
           $('#result-seam').text(avg.toFixed(1) + " (" + rating + ")");
           if (avg > 24) criticalOverride = true;
       } else {
           $('#result-seam').text("SKIPPED");
       }
       // --- FINAL RESULT ---
       let finalBox = $('#crdd-final-output');
       let finalLabel = $('#crdd-final-label');
       
       if (activeMaxScore === 0) {
           finalBox.text("ERROR: NO DATA");
           finalBox.css('color', 'red');
           return;
       }
       let percent = (totalScore / activeMaxScore) * 100;
       
       if (criticalOverride) {
           finalLabel.text("CRITICAL THREAT DETECTED");
           finalBox.text("NULL (LEAVE NOW)");
           finalBox.css({
               'color': '#000000',
               'background': '#fff',
               'text-shadow': '0 0 10px red'
           });
       } else {
           let finalRating = "ANCHORED";
           let finalColor = "#00ff9f"; 
           let finalMsg = "YOU ARE SAFE";
           if (percent > 25) { finalRating = "VOLATILE"; finalColor = "#ffd700"; finalMsg = "PROCEED WITH CAUTION"; }
           if (percent > 50) { finalRating = "FRACTURED"; finalColor = "#ff4500"; finalMsg = "YOU ARE IN DANGER"; }
           if (percent > 75) { finalRating = "NULL"; finalColor = "#555"; finalMsg = "LEAVE NOW"; }
           finalLabel.text(finalMsg);
           finalBox.text(finalRating + " (" + percent.toFixed(1) + "%)");
           finalBox.css({
               'color': finalColor,
               'background': 'transparent',
               'text-shadow': '0 0 10px ' + finalColor
           });
       }
   }
   // Trigger update on any change
   $('.crdd-range, input[type=checkbox]').on('input change', updateCRDD);

});