|
|
第21行: |
第21行: |
| |- | | |- |
| | 95 || 60 || 120 || 60 || 95 || 75 || 505 | | | 95 || 60 || 120 || 60 || 95 || 75 || 505 |
| |}<html> | | |} |
| <style>
| |
| .stat-wrapper {
| |
| display: grid;
| |
| grid-template-columns: repeat(4, 1fr);
| |
| gap: 10px;
| |
| font-family: sans-serif;
| |
| max-width: none; /* 取消居中限制 */
| |
| margin: 20px 0; /* 上下20px,左右0 */
| |
| transform: scale(0.9); /* 稍微缩小一点 */
| |
| }
| |
| | |
| fieldset {
| |
| padding: 10px 15px;
| |
| border: 1px solid #aaa;
| |
| border-radius: 8px;
| |
| background: #ffffffcc;
| |
| }
| |
| | |
| legend {
| |
| font-weight: bold;
| |
| }
| |
| | |
| label {
| |
| display: flex
| |
| justify-content: space-between;
| |
| display: inline-block;
| |
| margin: 5px 0;
| |
| | |
| }
| |
| | |
| | |
| input[type="number"], select {
| |
| width: 60px;
| |
| }
| |
| | |
| .stat-table {
| |
| width: 100%;
| |
| border-collapse: collapse;
| |
| }
| |
| | |
| .stat-table td, .stat-table th {
| |
| border: 1px solid #aaa;
| |
| text-align: center;
| |
| padding: 4px;
| |
| }
| |
| </style>
| |
| | |
| <div class="stat-wrapper">
| |
| <!-- 基础配置 -->
| |
| <fieldset>
| |
| <legend>基础配置</legend>
| |
| <label><span>等级:</span><input id="level" type="number" value="100" min="1" max="100"></label><br>
| |
| <label><span>个体值:</span><input id="iv" type="number" value="31" min="0" max="31"></label><br>
| |
| <label><span>性格:</span>
| |
| <select id="nature">
| |
| <option value="adamant">固执(+攻击 -特攻)</option>
| |
| <option value="lonely">孤独(+攻击 -防御)</option>
| |
| <option value="naughty">调皮(+攻击 -特防)</option>
| |
| <option value="brave">勇敢(+攻击 -速度)</option>
| |
| | |
| <option value="modest">保守(+特攻 -攻击)</option>
| |
| <option value="mild">稳重(+特攻 -防御)</option>
| |
| <option value="rash">马虎(+特攻 -特防)</option>
| |
| <option value="quiet">冷静(+特攻 -速度)</option>
| |
| | |
| <option value="jolly">开朗(+速度 -特攻)</option>
| |
| <option value="timid">胆小(+速度 -攻击)</option>
| |
| <option value="hasty">急躁(+速度 -防御)</option>
| |
| <option value="naive">天真(+速度 -特防)</option>
| |
| | |
| <option value="bold">大胆(+防御 -攻击)</option>
| |
| <option value="impish">顽皮(+防御 -特攻)</option>
| |
| <option value="lax">无虑(+防御 -特防)</option>
| |
| <option value="relaxed">悠闲(+防御 -速度)</option>
| |
| | |
| <option value="calm">沉着(+特防 -攻击)</option>
| |
| <option value="gentle">温顺(+特防 -防御)</option>
| |
| <option value="careful">慎重(+特防 -特攻)</option>
| |
| <option value="sassy">狂妄(+特防 -速度)</option>
| |
| | |
| <option value="bashful">害羞(平衡)</option>
| |
| <option value="hardy">实干(平衡)</option>
| |
| <option value="serious">认真(平衡)</option>
| |
| <option value="quirky">浮躁(平衡)</option>
| |
| <option value="docile">坦率(平衡)</option>
| |
| | |
| | |
| </select>
| |
| | |
| </label><br><br>
| |
| <button onclick="resetStats()">重置</button>
| |
| <button onclick="calcStats()">计算</button>
| |
| </fieldset>
| |
| | |
| <!-- 学习力 -->
| |
| <fieldset>
| |
| <legend>学习力</legend>
| |
| <label>体力:<input name="ev" type="number" value="0"></label><br>
| |
| <label>攻击:<input name="ev" type="number" value="0"></label><br>
| |
| <label>防御:<input name="ev" type="number" value="0"></label><br>
| |
| <label>特攻:<input name="ev" type="number" value="0"></label><br>
| |
| <label>特防:<input name="ev" type="number" value="0"></label><br>
| |
| <label>速度:<input name="ev" type="number" value="0"></label><br>
| |
| <b>剩余学习力:<span id="ev-remaining">510</span></b>
| |
| </fieldset>
| |
| | |
| <!-- 种族值 -->
| |
| <fieldset>
| |
| <legend>种族值</legend>
| |
| <table class="stat-table">
| |
| <tr><th>项目</th><th>值</th></tr>
| |
| <tr><td>体力</td><td><input name="base" class="base" type="number" value="0" min="0"></td></tr>
| |
| <tr><td>攻击</td><td><input name="base" class="base" type="number" value="0" min="0"></td></tr>
| |
| <tr><td>防御</td><td><input name="base" class="base" type="number" value="0" min="0"></td></tr>
| |
| <tr><td>特攻</td><td><input name="base" class="base" type="number" value="0" min="0"></td></tr>
| |
| <tr><td>特防</td><td><input name="base" class="base" type="number" value="0" min="0"></td></tr>
| |
| <tr><td>速度</td><td><input name="base" class="base" type="number" value="0" min="0"></td></tr>
| |
| </table>
| |
| </fieldset>
| |
| | |
| <!-- 计算结果 -->
| |
| <fieldset>
| |
| <legend>计算结果</legend>
| |
| <table class="stat-table">
| |
| <tr><th>项目</th><th>结果</th></tr>
| |
| <tr><td>体力</td><td class="result">0</td></tr>
| |
| <tr><td>攻击</td><td class="result">0</td></tr>
| |
| <tr><td>防御</td><td class="result">0</td></tr>
| |
| <tr><td>特攻</td><td class="result">0</td></tr>
| |
| <tr><td>特防</td><td class="result">0</td></tr>
| |
| <tr><td>速度</td><td class="result">0</td></tr>
| |
| </table>
| |
| </fieldset>
| |
| </div>
| |
| | |
| <script>
| |
| function getNatureModifiers(nature) {
| |
| const map = {
| |
| hardy: [1.0, 1.0, 1.0, 1.0, 1.0],
| |
| lonely: [1.1, 0.9, 1.0, 1.0, 1.0],
| |
| brave: [1.1, 1.0, 1.0, 1.0, 0.9],
| |
| adamant: [1.1, 1.0, 1.0, 0.9, 1.0],
| |
| naughty: [1.1, 1.0, 1.0, 1.0, 0.9],
| |
| | |
| bold: [0.9, 1.1, 1.0, 1.0, 1.0],
| |
| docile: [1.0, 1.0, 1.0, 1.0, 1.0],
| |
| relaxed: [1.0, 1.1, 1.0, 1.0, 0.9],
| |
| impish: [1.0, 1.1, 1.0, 0.9, 1.0],
| |
| lax: [1.0, 1.1, 1.0, 1.0, 0.9],
| |
| | |
| timid: [0.9, 1.0, 1.0, 1.0, 1.1],
| |
| hasty: [1.0, 0.9, 1.0, 1.0, 1.1],
| |
| serious: [1.0, 1.0, 1.0, 1.0, 1.0],
| |
| jolly: [1.0, 1.0, 0.9, 1.0, 1.1],
| |
| naive: [1.0, 1.0, 1.0, 0.9, 1.1],
| |
| | |
| modest: [0.9, 1.0, 1.1, 1.0, 1.0],
| |
| mild: [1.0, 0.9, 1.1, 1.0, 1.0],
| |
| quiet: [1.0, 1.0, 1.1, 1.0, 0.9],
| |
| bashful: [1.0, 1.0, 1.0, 1.0, 1.0],
| |
| rash: [1.0, 1.0, 1.1, 1.0, 0.9],
| |
| | |
| calm: [0.9, 1.0, 1.0, 1.1, 1.0],
| |
| gentle: [1.0, 0.9, 1.0, 1.1, 1.0],
| |
| sassy: [1.0, 1.0, 1.0, 1.1, 0.9],
| |
| careful: [1.0, 1.0, 0.9, 1.1, 1.0],
| |
| quirky: [1.0, 1.0, 1.0, 1.0, 1.0]
| |
| };
| |
| return map[nature] || map.hardy;
| |
| }
| |
| | |
| | |
| function calcStats() {
| |
| const level = parseInt(document.getElementById("level").value);
| |
| const iv = parseInt(document.getElementById("iv").value);
| |
| const evs = document.getElementsByName("ev");
| |
| const bases = document.querySelectorAll(".base");
| |
| const results = document.querySelectorAll(".result");
| |
| const nature = document.getElementById("nature").value;
| |
| const modifiers = getNatureModifiers(nature);
| |
|
| |
| let totalEV = 0;
| |
| for (let i = 0; i < 6; i++) {
| |
| const base = parseInt(bases[i].value || "0");
| |
| const ev = parseInt(evs[i].value || "0");
| |
| totalEV += ev;
| |
| let stat;
| |
| if (i === 0) {
| |
| stat = Math.floor(((base * 2 + iv + Math.floor(ev / 4)) * level) / 100 + level + 10);
| |
| } else {
| |
| stat = Math.floor(((((base * 2 + iv + Math.floor(ev / 4)) * level) / 100) + 5) * modifiers[i - 1]);
| |
| }
| |
| results[i].textContent = stat;
| |
| }
| |
| document.getElementById("ev-remaining").textContent = Math.max(510 - totalEV, 0);
| |
| }
| |
| | |
| function resetStats() {
| |
| document.getElementById("level").value = 100;
| |
| document.getElementById("iv").value = 31;
| |
| document.getElementById("nature").value = "neutral";
| |
| document.querySelectorAll("input[name='ev']").forEach(i => i.value = 0);
| |
| document.querySelectorAll(".result").forEach(i => i.textContent = "0");
| |
| document.getElementById("ev-remaining").textContent = "510";
| |
| }
| |
| </script>
| |
| </html>
| |
|
| |
|
| ==技能列表== | | ==技能列表== |