Skip to main content

Schmenny's PB Health Survey

Phoenixborn Power Level Survey

Help the community rank the power levels of Phoenixborn and chart our Rin-difference curve!

 


  


    
    
    <ins class="diffins">Phoenixborn Power Level Survey</ins>
    

Phoenixborn Power Level Survey

Help the community rank the power levels of Phoenixborn and chart our Rin-difference curve!

    <form id="surveyForm">
        <!-- Question 1: Select Baseline -->
        <div class="question-section">
            <div class="question-title">Step 1: Choose your baseline Phoenixborn</div>
            <div class="question-help">
                Select the Phoenixborn you consider most "middle-of-the-road" in power level. 
                This represents your baseline (0 adjustment needed).
            </div>
            <select id="baselineSelect" required>
                <option value="">-- Select a Phoenixborn --</option>
            </select>
        </div>

        <!-- Question 2: Health Adjustments -->
        <div class="question-section hidden" id="adjustmentSection">
            <div class="question-title">Step 2: Adjust health for each Phoenixborn</div>
            <div class="question-help">
                For each Phoenixborn below, enter how much health to add or subtract from their BASE health 
                to make them equal in power to your baseline. Use negative numbers to reduce health, 
                positive to add health.
            </div>
            
            <div class="warning" id="baselineWarning">
                Your baseline: <strong id="baselineName"></strong> — automatically set to 0 adjustment
            </div>
            
            <table class="adjustment-table">
                <thead>
                    <tr>
                        <th>Phoenixborn</th>
                        <th style="text-align: center;">Base HP</th>
                        <th style="text-align: center;">Adjustment</th>
                        <th style="text-align: center;">Adjusted HP</th>
                    </tr>
                </thead>
                <tbody id="adjustmentTableBody">
                    <!-- Populated by JavaScript -->
                </tbody>
            </table>
        </div>

        <button type="button" id="submitBtn" disabled>Submit Survey</button>
    </form>

    <div class="results" id="results">
        <h2>Survey Complete!</h2>
        <p><strong>Copy the text below and paste it into Discord:</strong></p>
        <textarea id="resultsData" readonly style="min-height: 80px; font-size: 14px;"></textarea>
        <div class="button-group">
            <button type="button" onclick="copyForDiscord()">📋 Copy for Discord</button>
            <button type="button" onclick="downloadCSV()">💾 Download CSV (backup)</button>
        </div>
        <p style="margin-top: 15px; color: #666; font-size: 0.9em;">
            Note: After everyone submits, Nathan will collect all responses and run the analysis.
        </p>
    </div>
</div>

<script>
    // Phoenixborn data with base health
    const phoenixbornData = {
        "Aradel Summergaard": 16,
        "Arren Frostpeak": 15,
        "Astrea": 19,
        "Brennen Blackcloud": 16,
        "Coal Roarkwin": 15,
        "Dimona Odinstar": 16,
        "Echo Greystorm": 19,
        "Fiona Mercywind": 15,
        "Harold Westraven": 16,
        "Hope Everthorn": 17,
        "Issa Brightmore": 18,
        "James Endersight": 19,
        "Jericho, Reborn": 17,
        "Jessa Na Ni": 19,
        "Koji Wolfcub": 16,
        "Leo Sunshadow": 19,
        "Lulu Firststone": 16,
        "Maeoni Viper": 20,
        "Namine Hymntide": 17,
        "Noah Redmoon": 16,
        "Odette Diamondcrest": 18,
        "Orrick Gilstream": 19,
        "Rimea Careworn": 17,
        "Rin Northfell": 17,
        "Rowan Umberend": 18,
        "Saria Guideman": 20,
        "Sembali Grimtongue": 19,
        "Tristan Darkwater": 17,
        "Victoria Glassfire": 18,
        "Xander Heartsblood": 20
    };

    let selectedBaseline = null;
    let adjustments = {};

    // Initialize the survey
    function init() {
        const baselineSelect = document.getElementById('baselineSelect');
        const phoenixborn = Object.keys(phoenixbornData).sort();
        
        // Populate baseline dropdown
        phoenixborn.forEach(pb => {
            const option = document.createElement('option');
            option.value = pb;
            option.textContent = `${pb} (${phoenixbornData[pb]} HP)`;
            baselineSelect.appendChild(option);
        });
        
        // Listen for baseline selection
        baselineSelect.addEventListener('change', function() {
            if (this.value) {
                selectBaseline(this.value);
            }
        });
    }

    function selectBaseline(pb) {
        selectedBaseline = pb;
        document.getElementById('baselineName').textContent = `${pb} (${phoenixbornData[pb]} HP)`;
        document.getElementById('adjustmentSection').classList.remove('hidden');
        document.getElementById('submitBtn').disabled = false;
        
        // Populate adjustment table
        const tbody = document.getElementById('adjustmentTableBody');
        tbody.innerHTML = '';
        
        const phoenixborn = Object.keys(phoenixbornData).sort();
        
        phoenixborn.forEach(name => {
            const row = document.createElement('tr');
            const isBaseline = name === selectedBaseline;
            if (isBaseline) row.className = 'baseline';
            
            const baseHealth = phoenixbornData[name];
            adjustments[name] = 0;
            
            row.innerHTML = `
                <td class="pb-name-cell">${name}${isBaseline ? ' ⭐' : ''}</td>
                <td class="hp-cell">${baseHealth}</td>
                <td style="text-align: center;">
                    <input type="number" 
                           id="adj-${name}" 
                           value="0" 
                           min="-10" 
                           max="10" 
                           ${isBaseline ? 'disabled' : ''}
                           onchange="updateAdjustment('${name}')">
                </td>
                <td class="adjusted-hp" id="adjusted-${name}">${baseHealth}</td>
            `;
            
            tbody.appendChild(row);
        });
        
        // Scroll to adjustment section
        document.getElementById('adjustmentSection').scrollIntoView({ behavior: 'smooth', block: 'nearest' });
    }

    function updateAdjustment(pbName) {
        const input = document.getElementById(`adj-${pbName}`);
        const value = parseInt(input.value) || 0;
        const baseHealth = phoenixbornData[pbName];
        const adjustedHealth = baseHealth + value;
        
        adjustments[pbName] = value;
        document.getElementById(`adjusted-${pbName}`).textContent = adjustedHealth;
    }

    document.getElementById('submitBtn').addEventListener('click', function() {
        if (!selectedBaseline) {
            alert('Please select a baseline Phoenixborn first.');
            return;
        }
        
        // Prepare Discord-friendly results
        const resultsDiv = document.getElementById('results');
        const resultsData = document.getElementById('resultsData');
        
        // Create compact one-line format
        let discordText = `Baseline: ${selectedBaseline} | `;
        
        const adjustmentPairs = [];
        Object.entries(adjustments)
            .sort(([a], [b]) => a.localeCompare(b))
            .forEach(([name, value]) => {
                const adj = value > 0 ? `+${value}` : value.toString();
                adjustmentPairs.push(`${name}=${adj}`);
            });
        
        discordText += adjustmentPairs.join(', ');
        
        resultsData.value = discordText;
        resultsDiv.style.display = 'block';
        resultsDiv.scrollIntoView({ behavior: 'smooth' });
    });

    function copyForDiscord() {
        const textarea = document.getElementById('resultsData');
        textarea.select();
        document.execCommand('copy');
        alert('Copied! Now paste this into Discord.');
    }

    function downloadCSV() {
        let csv = 'Phoenixborn,Base Health,Health Adjustment,Adjusted Health,Is Baseline\n';
        Object.entries(adjustments)
            .sort(([a], [b]) => a.localeCompare(b))
            .forEach(([name, value]) => {
                const baseHP = phoenixbornData[name];
                const adjHP = baseHP + value;
                const isBaseline = name === selectedBaseline ? 'Yes' : 'No';
                csv += `"${name}",${baseHP},${value},${adjHP},${isBaseline}\n`;
            });
        
        // Add metadata rows
        csv += `\nBaseline,${selectedBaseline}\n`;
        csv += `Baseline Health,${phoenixbornData[selectedBaseline]}\n`;
        csv += `Timestamp,${new Date().toISOString()}\n`;
        
        const blob = new Blob([csv], { type: 'text/csv' });
        const url = window.URL.createObjectURL(blob);
        const a = document.createElement('a');
        a.href = url;
        a.download = `phoenixborn_survey_${Date.now()}.csv`;
        a.click();
        window.URL.revokeObjectURL(url);
    }

    // Initialize on page load
    init();
</script>