MediaWiki:StatCalcTemplate:修订间差异
跳转到导航
跳转到搜索
无编辑摘要 |
无编辑摘要 |
||
(未显示同一用户的17个中间版本) | |||
第3行: | 第3行: | ||
.stat-wrapper { | .stat-wrapper { | ||
display: grid; | display: grid; | ||
grid-template-columns: repeat( | grid-template-columns: repeat(4, 1fr); | ||
gap: | gap: 10px; | ||
font-family: sans-serif; | font-family: sans-serif; | ||
max-width: 800px; | |||
margin-left: 0; /* 靠左显示 */ | |||
transform: scale(0.9); /* 稍微缩小一点 */ | |||
} | } | ||
fieldset { | fieldset { | ||
padding: 10px 15px; | padding: 10px 15px; | ||
第15行: | 第17行: | ||
background: #ffffffcc; | background: #ffffffcc; | ||
} | } | ||
legend { | legend { | ||
font-weight: bold; | font-weight: bold; | ||
} | } | ||
label { | label { | ||
display: flex | |||
justify-content: space-between; | |||
display: inline-block; | display: inline-block; | ||
margin: 5px 0; | margin: 5px 0; | ||
} | } | ||
input[type="number"], select { | input[type="number"], select { | ||
width: 60px; | width: 60px; | ||
} | } | ||
.stat-table { | .stat-table { | ||
width: 100%; | width: 100%; | ||
border-collapse: collapse; | border-collapse: collapse; | ||
} | } | ||
.stat-table td, .stat-table th { | .stat-table td, .stat-table th { | ||
border: 1px solid #aaa; | border: 1px solid #aaa; | ||
第40行: | 第51行: | ||
<fieldset> | <fieldset> | ||
<legend>基础配置</legend> | <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"> | <select id="nature"> | ||
<option value="hardy">实干(无修正)</option> | |||
<option value="lonely">孤独(+攻击 -防御)</option> | |||
<option value="brave">勇敢(+攻击 -速度)</option> | |||
<option value="adamant">固执(+攻击 -特攻)</option> | |||
<option value="naughty">调皮(+攻击 -特防)</option> | |||
<option value="bold">大胆(+防御 -攻击)</option> | |||
<option value="docile">坦率(无修正)</option> | |||
<option value="relaxed">悠闲(+防御 -速度)</option> | |||
<option value="impish">顽皮(+防御 -特攻)</option> | |||
<option value="lax">无虑(+防御 -特防)</option> | |||
<option value="timid">胆小(+速度 -攻击)</option> | |||
<option value="hasty">急躁(+速度 -防御)</option> | |||
<option value="serious">认真(无修正)</option> | |||
<option value="jolly">开朗(+速度 -特攻)</option> | |||
<option value="naive">天真(+速度 -特防)</option> | |||
<option value="modest">保守(+特攻 -攻击)</option> | |||
<option value="mild">稳重(+特攻 -防御)</option> | |||
<option value="quiet">冷静(+特攻 -速度)</option> | |||
<option value="bashful">害羞(无修正)</option> | |||
<option value="rash">马虎(+特攻 -特防)</option> | |||
<option value="calm">沉着(+特防 -攻击)</option> | |||
<option value="gentle">温顺(+特防 -防御)</option> | |||
<option value="sassy">狂妄(+特防 -速度)</option> | |||
<option value="careful">慎重(+特防 -特攻)</option> | |||
<option value="quirky">浮躁(无修正)</option> | |||
</select> | |||
</label><br><br> | </label><br><br> | ||
<button onclick="resetStats()">重置</button> | <button onclick="resetStats()">重置</button> | ||
第73行: | 第108行: | ||
<table class="stat-table"> | <table class="stat-table"> | ||
<tr><th>项目</th><th>值</th></tr> | <tr><th>项目</th><th>值</th></tr> | ||
<tr><td>体力</td><td class=" | <tr><td>体力</td><td><input name="base" class="base" type="number" value="0" min="0"></td></tr> | ||
<tr><td>攻击</td><td class=" | <tr><td>攻击</td><td><input name="base" class="base" type="number" value="0" min="0"></td></tr> | ||
<tr><td>防御</td><td class=" | <tr><td>防御</td><td><input name="base" class="base" type="number" value="0" min="0"></td></tr> | ||
<tr><td>特攻</td><td class=" | <tr><td>特攻</td><td><input name="base" class="base" type="number" value="0" min="0"></td></tr> | ||
<tr><td>特防</td><td class=" | <tr><td>特防</td><td><input name="base" class="base" type="number" value="0" min="0"></td></tr> | ||
<tr><td>速度</td><td class=" | <tr><td>速度</td><td><input name="base" class="base" type="number" value="0" min="0"></td></tr> | ||
</table> | </table> | ||
</fieldset> | </fieldset> | ||
第100行: | 第135行: | ||
function getNatureModifiers(nature) { | function getNatureModifiers(nature) { | ||
const map = { | 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], | 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], | bold: [0.9, 1.1, 1.0, 1.0, 1.0], | ||
calm: [0.9, 1.0, 1.0, 1.0, 1.1], | 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. | return map[nature] || map.hardy; | ||
} | } | ||
function calcStats() { | function calcStats() { | ||
第114行: | 第173行: | ||
const iv = parseInt(document.getElementById("iv").value); | const iv = parseInt(document.getElementById("iv").value); | ||
const evs = document.getElementsByName("ev"); | const evs = document.getElementsByName("ev"); | ||
const bases = document.querySelectorAll(". | const bases = document.querySelectorAll(".base"); | ||
const results = document.querySelectorAll(".result"); | const results = document.querySelectorAll(".result"); | ||
const nature = document.getElementById("nature").value; | const nature = document.getElementById("nature").value; | ||
const modifiers = getNatureModifiers(nature); | const modifiers = getNatureModifiers(nature); | ||
let totalEV = 0; | let totalEV = 0; | ||
for (let i = 0; i < 6; i++) { | for (let i = 0; i < 6; i++) { | ||
const base = parseInt(bases[i]. | const base = parseInt(bases[i].value || "0"); | ||
const ev = parseInt(evs[i].value || "0"); | const ev = parseInt(evs[i].value || "0"); | ||
totalEV += ev; | totalEV += ev; |
2025年5月11日 (日) 08:52的最新版本
👥 当前在线人数:77