ZAKO情報
ZAKO: "御命令を!"
任務情報
ZAKOの感情:
ステータス
結果
<!DOCTYPE html> <html> <head> <title>ZAKO戦術シミュレータ</title> <style> #zako-container { text-align: center; } #zako-info { margin-bottom: 20px; } #mission-info { margin-bottom: 20px; } #status-info { margin-bottom: 20px; } #outcome-info { margin-bottom: 20px; } #game-buttons { text-align: center; } #result { text-align: center; font-size: 24px; font-weight: bold; } </style> </head> <body> <div id="zako-container"> <div id="zako-info"> <h2>ZAKO情報</h2> <p id="zako-data"></p> <p>ZAKO: "御命令を!"</p> </div> <div id="mission-info"> <h2>任務情報</h2> <p id="mission-data"></p> <p>ZAKOの感情: <span id="emotion"></span></p> </div> <div id="status-info"> <h2>ステータス</h2> <p id="status-data"></p> </div> <div id="outcome-info"> <h2>結果</h2> <p id="outcome-data"></p> </div> <div id="game-buttons"> <button id="produce-btn">ZAKOを生産する</button> <button id="mission-btn">出撃</button> <button id="dispose-btn">処分</button> </div> <div id="result"></div> </div> <script> const zakoTypes = [ { type: "A型", style: "カジュアル", face: "笑顔", hairstyle: "ボブカット", appearance: "スリム", personality: "明るい" }, { type: "B型", style: "クール", face: "無表情", hairstyle: "ショートヘア", appearance: "クール", personality: "クール" }, { type: "C型", style: "キュート", face: "ニコニコ", hairstyle: "ポニーテール", appearance: "かわいい", personality: "元気" }, { type: "D型", style: "セクシー", face: "セクシー", hairstyle: "ロングヘア", appearance: "セクシー", personality: "おしゃべり" } ]; const missions = [ { name: "情報収集", successRateModifier: 0.8 }, { name: "スリープ作戦", successRateModifier: 0.6 }, { name: "敵施設破壊", successRateModifier: 0.7 }, { name: "特殊任務", successRateModifier: 0.5 } ]; const emotionOptions = ["興奮", "安楽", "恐怖"]; let zakos = []; let currentZako = null; let strategyAchievement = 50; const zakoDataElement = document.getElementById("zako-data"); const missionDataElement = document.getElementById("mission-data"); const emotionElement = document.getElementById("emotion"); const statusDataElement = document.getElementById("status-data"); const outcomeDataElement = document.getElementById("outcome-data"); const produceBtn = document.getElementById("produce-btn"); const missionBtn = document.getElementById("mission-btn"); const disposeBtn = document.getElementById("dispose-btn"); const resultElement = document.getElementById("result"); produceBtn.addEventListener("click", produceZako); missionBtn.addEventListener("click", sendMission); disposeBtn.addEventListener("click", disposeZako); updateUI(); function getRandomZakoType() { return zakoTypes[Math.floor(Math.random() * zakoTypes.length)]; } function generateZakoData(zakoType) { return `型式: ${zakoType.type}<br/>名前: ${generateZakoName()}<br/>スタイル: ${zakoType.style}<br/>顔立: ${zakoType.face}<br/>髪型: ${zakoType.hairstyle}<br/>容姿: ${zakoType.appearance}<br/>性格: ${zakoType.personality}`; } function generateZakoName() { const names = ["アズサ", "カナエ", "ユカリ", "ミオ"]; return names[Math.floor(Math.random() * names.length)]; } function getRandomMission() { return missions[Math.floor(Math.random() * missions.length)]; } function generateMissionData(mission) { return `任務: ${mission.name}`; } function getRandomEmotion() { return emotionOptions[Math.floor(Math.random() * emotionOptions.length)]; } function produceZako() { const zakoType = getRandomZakoType(); const zakoData = generateZakoData(zakoType); const chu = Math.floor(Math.random() * 10) + 1; const newZako = { ...zakoType, chu }; zakos.push(newZako); currentZako = newZako; zakoDataElement.innerHTML = zakoData; missionBtn.disabled = false; updateStatusData(); } function sendMission() { const mission = getRandomMission(); const missionData = generateMissionData(mission); const emotion = getRandomEmotion(); const successRate = mission.successRateModifier * currentZako.chu; const maxHealth = 100; const minHealth = 0; let zakoHealth = maxHealth; missionDataElement.innerHTML = missionData; emotionElement.innerHTML = emotion; outcomeDataElement.innerHTML = ""; while (zakoHealth > minHealth) { if (Math.random() < successRate) { strategyAchievement += 10; zakoHealth -= 10; } else { strategyAchievement -= 5; zakoHealth -= 10; } if (Math.random() < 0.2) { zakoHealth += 10; } if (strategyAchievement <= 0) { strategyAchievement = 0; } updateStatusData(); if (strategyAchievement <= 0 || strategyAchievement >= 100) { break; } } if (strategyAchievement >= 100) { resultElement.innerHTML = "プレイヤーの勝利!"; missionBtn.disabled = true; disposeBtn.disabled = true; } else if (strategyAchievement <= 0) { resultElement.innerHTML = "プレイヤーの敗北..."; missionBtn.disabled = true; disposeBtn.disabled = true; } if (strategyAchievement > 0 && strategyAchievement < 100) { currentZako.chu = Math.max(currentZako.chu - 1, 0); updateStatusData(); } } function disposeZako() { strategyAchievement = 0; resultElement.innerHTML = "プレイヤーの敗北..."; updateStatusData(); missionBtn.disabled = true; disposeBtn.disabled = true; } function updateStatusData() { statusDataElement.innerHTML = `戦略達成度: ${strategyAchievement}%<br/>体力: ${currentZako ? currentZako.health : 0}<br/>Chu: ${currentZako ? currentZako.chu : 0}`; } function updateUI() { produceBtn.disabled = false; missionBtn.disabled = true; disposeBtn.disabled = true; } </script> </body> </html>