鬥羅大陸手機模擬器
by PrismFlare82116 lines3.7 KB
<!DOCTYPE html>
<html lang="zh-TW">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<title>鬥羅大陸手機模擬器</title>
<style>
*{margin:0;padding:0;box-sizing:border-box;font-family:system-ui}
body{background:#121829;color:#fff;padding:16px;min-height:100vh}
.game-box{background:#1c2741;border-radius:16px;padding:20px;max-width:100%}
.status-bar{background:#27385c;padding:12px;border-radius:10px;margin-bottom:16px;font-size:15px}
.story-text{font-size:17px;line-height:1.8;margin-bottom:24px;white-space:pre-line;min-height:180px}
.btn-area button{
width:100%;padding:14px 10px;margin:10px 0;
background:#104080;color:#fff;border:none;border-radius:12px;
font-size:16px;
}
.btn-area button:active{background:#dd3355}
</style>
</head>
<body>
<div class="game-box">
<div class="status-bar" id="status">角色:未創建</div>
<div class="story-text" id="text">歡迎來到鬥羅大陸模擬器</div>
<div class="btn-area" id="btnList"></div>
</div>
<script>
let player = {
name:"",
wuhun:"",
isDouble:false,
wuhun2:"",
power:0,
hunhuan:[],
level:10
}
const wuhunList = ["藍銀草","昊天錘","柔骨兔","邪火鳳凰","幽冥靈貓","七寶琉璃塔","白虎","碧磷蛇皇","天使聖劍","藍電霸王龍"]
function rand(min,max){return Math.floor(Math.random()*(max-min+1))+min}
function render(msg,buttons){
document.getElementById("text").innerText = msg
let dom = document.getElementById("btnList")
dom.innerHTML = ""
buttons.forEach(b=>{
let btn = document.createElement("button")
btn.innerText = b.text
btn.onclick = b.func
dom.appendChild(btn)
})
updateUI()
}
function updateUI(){
let info = `魂力等級:${player.level}|武魂:${player.wuhun}`
if(player.isDouble) info += ` / ${player.wuhun2}`
info += `|先天魂力:${player.power}`
document.getElementById("status").innerText = info
}
function start(){
render("你抵達諾丁城武魂殿,即將進行武魂覺醒!",[
{text:"開始武魂覺醒",func:awake}
])
}
function awake(){
let w1 = wuhunList[rand(0,wuhunList.length-1)]
let double = rand(1,100) > 82
let w2 = double ? wuhunList[rand(0,wuhunList.length-1)] : ""
let innate = rand(1,10)
player.wuhun = w1
player.isDouble = double
player.wuhun2 = w2
player.power = innate
let tip = innate===10 ? "\n⭐先天滿魂力!絕世天才!" : ""
render(`武魂覺醒儀式完成!
主武魂:${w1}
${double?"副武魂:"+w2:"沒有覺醒雙生武魂"}
先天魂力:${innate}${tip}`,[
{text:"前往諾丁初級學院",func:school},
{text:"重新刷武魂",func:reset}
])
}
function school(){
render("你來到諾丁學院遇見玉小剛,接下來需要獲得第一魂環突破二十級!",[
{text:"進入獵魂森林狩獵",func:hunt},
{text:"留在學院修煉",func:train}
])
}
function hunt(){
let age = rand(120,450)
player.hunhuan.push(age)
player.level = 20
render(`狩獵成功!
獲得第1魂環,年限:${age}年
魂力提升至20級!`,[
{text:"出發前往史萊克學院",func:ending}
])
}
function train(){
player.level += 3
render("每日刻苦修煉,你的魂力小幅提升!",[
{text:"前往獵魂森林",func:hunt},
{text:"直接前往史萊克",func:ending}
])
}
function ending(){
render("你抵達史萊克學院,後續可以新增全大陸魂師賽、海神島、武魂殿決戰劇情!",[
{text:"重新開局",func:reset}
])
}
function reset(){
player = {name:"",wuhun:"",isDouble:false,wuhun2:"",power:0,hunhuan:[],level:10}
start()
}
start()
</script>
</body>
</html>Game Source: 鬥羅大陸手機模擬器
Creator: PrismFlare82
Libraries: none
Complexity: moderate (116 lines, 3.7 KB)
The full source code is displayed above on this page.
Remix Instructions
To remix this game, copy the source code above and modify it. Add a ARCADELAB header at the top with "remix_of: game-prismflare82" to link back to the original. Then publish at arcadelab.ai/publish.