<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>后室死区生存难度计算器</title>
<style>
body {
font-family: Arial, sans-serif;
max-width: 800px;
margin: auto;
padding: 20px;
}
h1 {
color: #333;
text-align: center;
}
label {
display: block;
margin-bottom: 5px;
}
input[type="number"] {
width: 50%;
}
button {
display: block;
margin: 15px auto;
}
</style>
</head>
<body>
<h1>后室死区生存难度计算器</h1>
<form id="difficulty-form">
<label for="entrance">入口难度(0-5): </label>
<input type="number" id="entrance" name="entrance" min="0" max="5"><br><br>
<label for="exit">出口难度(0-5): </label>
<input type="number" id="exit" name="exit" min="0" max="5"><br><br>
<label for="environment">环境危害(0-5): </label>
<input type="number" id="environment" name="environment" min="0" max="5"><br><br>
<label for="entity">实体危害(0-5): </label>
<input type="number" id="entity" name="entity" min="0" max="5"><br><br>
<label for="psychological">精神危害(0-5): </label>
<input type="number" id="psychological" name="psychological" min="0" max="5"><br><br>
<label for="resistance">切行抗性(0-5): </label>
<input type="number" id="resistance" name="resistance" min="0" max="5"><br><br>
<label for="deception">文档欺骗性(0-5): </label>
<input type="number" id="deception" name="deception" min="0" max="5"><br><br>
<label for="specific">特定危害(0-5): </label>
<input type="number" id="specific" name="specific" min="0" max="5"><br><br>
<button type="button" onclick="calculateDifficulty()">计算难度指数</button>
</form>
<p id="result"></p>
<script>
function calculateDifficulty() {
const entrance = document.getElementById('entrance').value;
const exit = document.getElementById('exit').value;
const environment = document.getElementById('environment').value;
const entity = document.getElementById('entity').value;
const psychological = document.getElementById('psychological').value;
const resistance = document.getElementById('resistance').value;
const deception = document.getElementById('deception').value;
const specific = document.getElementById('specific').value;
const result = (
parseFloat(entrance) * 0.3 +
parseFloat(exit) * 0.5 +
parseFloat(environment) * 0.4 +
parseFloat(entity) * 0.5 +
parseFloat(psychological) * 0.6 -
parseFloat(resistance) * 0.5 +
parseFloat(deception) * 0.2 +
parseFloat(specific) * 0.2
);
document.getElementById('result').innerHTML = `生存难度指数: ${result.toFixed(2)}`;
}
</script>
</body>
</html>