用户:RedDragon/Test2:修订间差异
来自Rizline中文维基
更多操作
小 |
小 |
||
| (未显示同一用户的6个中间版本) | |||
| 第36行: | 第36行: | ||
</tbody> | </tbody> | ||
</table> | </table> | ||
<script> | <script> | ||
document.addEventListener('DOMContentLoaded', function () { | document.addEventListener('DOMContentLoaded', function () { | ||
| 第109行: | 第108行: | ||
author: columns[2].replace(/^\|/, '').trim(), | author: columns[2].replace(/^\|/, '').trim(), | ||
duration: columns[3].replace(/^\|/, '').trim(), | duration: columns[3].replace(/^\|/, '').trim(), | ||
ez | } | ||
hd | if (song.title === "BRAVE: ROAD") { | ||
in | song.ez = "" | ||
song.hd = columns[4].replace(/^\|/, '').trim() | |||
song.in = columns[5].replace(/^\|/, '').trim() | |||
song.at = columns[6].replace(/^\|/, '').trim() | |||
} else { | |||
song.ez = columns[4].replace(/^\|/, '').trim() | |||
song.hd = columns[5].replace(/^\|/, '').trim() | |||
song.in = columns[6].replace(/^\|/, '').trim() | |||
} | } | ||
| 第226行: | 第232行: | ||
container.innerHTML = `<a href="${data.pageUrl}" target="_blank"><img id="song-image" width="300" height="300" src="${data.imageUrl || '/images/thumb/4/41/插画图标.png/300px-插画图标.png'}"></a>` | container.innerHTML = `<a href="${data.pageUrl}" target="_blank"><img id="song-image" width="300" height="300" src="${data.imageUrl || '/images/thumb/4/41/插画图标.png/300px-插画图标.png'}"></a>` | ||
var availableDifficulties = [] | |||
if (song.ez) availableDifficulties.push({ type: "EZ", value: song.ez }) | |||
if (song.hd) availableDifficulties.push({ type: "HD", value: song.hd }) | |||
if (song.in) availableDifficulties.push({ type: "IN", value: song.in }) | |||
'<span style="width:max-content;text-align:center;display:inline-block;border-radius:1em;color:white;background:#53D6FF;padding:0 0.80em;margin:0.1em 0.50em">无限制</span>' | if (song.at) availableDifficulties.push({ type: "AT", value: song.at }) | ||
window.difficultyArray = availableDifficulties.map(function (diff) { | |||
return createDiffSpan(diff.type, diff.value); | |||
}); | |||
window.difficultyArray.push('<span style="width:max-content;text-align:center;display:inline-block;border-radius:1em;color:white;background:#53D6FF;padding:0 0.80em;margin:0.1em 0.50em">无限制</span>'); | |||
generateRandomRestrictions() | generateRandomRestrictions() | ||
| 第237行: | 第246行: | ||
function createDiffSpan(diff, level) { | function createDiffSpan(diff, level) { | ||
var colors = { EZ: '#57E4C4', HD: '#FDBA61', IN: '#FE8661' } | var colors = { | ||
EZ: '#57E4C4', HD: '#FDBA61', IN: '#FE8661', AT: '#4C364B' | |||
} | |||
return `<span style="width:max-content;text-align:center;display:inline-block;border-radius:1em;color:white;background:${colors[diff]};padding:0 0.80em;margin:0.1em 0.50em">${diff} ${level}</span>` | return `<span style="width:max-content;text-align:center;display:inline-block;border-radius:1em;color:white;background:${colors[diff]};padding:0 0.80em;margin:0.1em 0.50em">${diff} ${level}</span>` | ||
} | } | ||
| 第245行: | 第256行: | ||
var speeds = Array(40).fill("无限制").concat(Array.from({ length: 91 }, function (_, i) { return (i + 10) / 10 })) | var speeds = Array(40).fill("无限制").concat(Array.from({ length: 91 }, function (_, i) { return (i + 10) / 10 })) | ||
// 随机流速 | // 随机流速 | ||
var selectedSpeed = speeds[Math.floor(Math.random() * speeds.length)] | |||
// 随机难度 | |||
var selectedDifficulty = window.difficultyArray[Math.floor(Math.random() * window.difficultyArray.length)] | |||
// | // 流速难度显示 | ||
document.getElementById(' | document.getElementById('speed-data').textContent = selectedSpeed | ||
document.getElementById('difficulty-data').innerHTML = selectedDifficulty | |||
// MOD权重配置 | // MOD权重配置 | ||
var modOptions = [ | var modOptions = [ | ||
{ name: "无MOD", weight: | { name: "无MOD", weight: 9 }, | ||
{ name: "无限制", weight: | { name: "无限制", weight: 9 }, | ||
{ name: "观赏模式", weight: 1 }, | { name: "观赏模式", weight: 1 }, | ||
{ name: "镜像模式", weight: | |||
{ name: "保护模式", weight: | { name: "镜像模式", weight: 4 }, | ||
{ name: "Bad保护模式", weight: | { name: "保护模式", weight: 4 }, | ||
{ name: "特殊计量条", weight: | { name: "Bad保护模式", weight: 4 }, | ||
{ name: "特殊计量条100%", weight: | { name: "特殊计量条", weight: 1, exclude: ["特殊计量条100%", "特殊计量条110%", "特殊计量条120%"] }, | ||
{ name: "特殊计量条110%", weight: | { name: "特殊计量条100%", weight: 1, exclude: ["特殊计量条", "特殊计量条110%", "特殊计量条120%"] }, | ||
{ name: "特殊计量条120%", weight: | { name: "特殊计量条110%", weight: 1, exclude: ["特殊计量条", "特殊计量条100%", "特殊计量条120%"] }, | ||
{ name: "隐藏计量条", weight: | { name: "特殊计量条120%", weight: 1, exclude: ["特殊计量条", "特殊计量条100%", "特殊计量条110%"] }, | ||
{ name: "隐藏计量条", weight: 4 } | |||
] | ] | ||
| 第269行: | 第284行: | ||
{ name: "无限制", weight: 12 }, | { name: "无限制", weight: 12 }, | ||
{ name: "静音", weight: 2 }, | { name: "静音", weight: 2 }, | ||
{ name: "单手", weight: 2, exclude: ["全拆打法", "全换打法"] }, | { name: "单手", weight: 2, exclude: ["全拆打法", "全换打法", "禁止出张"] }, | ||
{ name: "手持", weight: 2 }, | { name: "手持", weight: 2 }, | ||
{ name: "Bad数比Hit数多", weight: 1 }, | { name: "Bad数比Hit数多", weight: 1 }, | ||
{ name: "Combo低于50", weight: 1 }, | { name: "Combo低于50", weight: 1 }, | ||
{ name: "全拆打法", weight: 2, exclude: ["单手"] }, | { name: "全拆打法", weight: 2, exclude: ["单手", "全换打法"] }, | ||
{ name: "全换打法", weight: 2, exclude: ["单手"] }, | { name: "全换打法", weight: 2, exclude: ["单手", "全拆打法"] }, | ||
{ name: "禁止出张", weight: 2 }, | { name: "禁止出张", weight: 2, exclude: ["单手"] }, | ||
{ name: "反色", weight: 1 } | { name: "反色", weight: 1 } | ||
] | ] | ||
| 第320行: | 第335行: | ||
var maxAttempts = 20 | var maxAttempts = 20 | ||
while (selectedItems.length < count | while (maxAttempts > 0) { | ||
if (selectedItems.length < count) { | |||
if (weightedOptions.length > 0) { | |||
maxAttempts-- | |||
var randomIndex = Math.floor(Math.random() * weightedOptions.length) | |||
var candidate = weightedOptions[randomIndex] | |||
var canAdd = true | |||
for (var j = 0; j < selectedItems.length; j++) { | |||
var selectedItem = selectedItems[j] | |||
if (candidate.exclude) { | |||
if (candidate.exclude.includes(selectedItem)) { | |||
canAdd = false | canAdd = false | ||
break | |||
} | |||
} | |||
var selectedOption = availableOptions.find(function (opt) { return opt.name === selectedItem }) | |||
if (selectedOption) { | |||
if (selectedOption.exclude) { | |||
if (selectedOption.exclude.includes(candidate.name)) { | |||
canAdd = false | |||
break | |||
} | |||
} | |||
} | |||
} | } | ||
if (canAdd) { | |||
selectedItems.push(candidate.name) | |||
weightedOptions = weightedOptions.filter(function (opt) { return opt.name !== candidate.name }) | |||
} else { | |||
weightedOptions.splice(randomIndex, 1) | |||
} | } | ||
} else { | |||
break | |||
} | } | ||
} else { | } else { | ||
break | |||
} | } | ||
} | } | ||
| 第367行: | 第390行: | ||
function updateRestrictionElement(elementId, items) { | function updateRestrictionElement(elementId, items) { | ||
var element = document.getElementById(elementId) | var element = document.getElementById(elementId) | ||
if (items.length | if (items.length == 1) { | ||
element.textContent = items[0] | element.textContent = items[0] | ||
} else { | } else { | ||
| 第378行: | 第401行: | ||
var belowText = "" | var belowText = "" | ||
if (mods | if (mods[0] == "观赏模式") { | ||
if (mods[0] === " | belowText = "WOW奖励关!" | ||
} else if (difficulty.includes('EZ')) { | |||
if (speed == "无限制") { | |||
if (mods[0] == "无限制") { | |||
if (others[0] == "无限制") { | |||
belowText = "最简单的一集" | |||
} | |||
} | |||
} | } | ||
}else if (difficulty.includes(' | } else if (difficulty.includes('无限制')) { | ||
if (speed | if (speed == "无限制") { | ||
if (mods[0] == "无限制") { | |||
if (others[0] == "无限制") { | |||
belowText = "无限制!" | |||
} | } | ||
} | } | ||
} | } | ||
}else if (difficulty.includes('AT')) { | } else if (difficulty.includes('AT')) { | ||
belowText = "这么强?!" | belowText = "这么强?!" | ||
} | } | ||
2025年10月23日 (四) 01:34的最新版本
| 曲目 | |
|---|---|
|
|
|
| 限制 | |
| 难度 | a |
| 流速 | b |
| MOD | c |
| 其他 | d |
神秘的随机挑战!
Ver.1.6
{{Infobox
|name = 随机挑战
|title = 曲目
|titlestyle = background:#ccc
|image = [[File:插画图标.png|100px]]
|headerstyle = background:#ccf
|labelstyle = background:#ddf
|header1 = 限制
|label2 = 难度
|data2 = a
|label3 = 流速
|data3 = b
|label4 = MOD
|data4 = c
|label5 = 其他
|data5 = d
|belowstyle = background:#ddf;
|below = e
}}
User:RedDragon/Test User:RedDragon/Test1 User:RedDragon/Test2