-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
98 lines (76 loc) · 2.38 KB
/
index.html
File metadata and controls
98 lines (76 loc) · 2.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>TDMap Test</title>
<script type="text/javascript" src="Balance.eps"></script>
<script type="text/javascript">floor = Math.floor</script>
<style type="text/css">
*,* {
font-family: Arial;
text-align: left;
}
body {
margin: 25px;
}
body, input {
background: #111;
color: #fff;
text-align: center;
}
table {
margin: 10px auto;
}
table, th, td, input {
border: 1px solid #ccc;
border-collapse: collapse;
padding: 10px 5px;
}
input {
padding: 5px 0;
}
th {
width: 300px;
}
td {
text-align: right;
width: 200px;
}
</style>
</head>
<body>
<label for="wave">Wave</label>
<input type="number" min="1" max="10000" id="waveInput" value="100">
<table>
<tr><th>Difficulty</th><td><span id="TargetDifficultyOutput"></span></td></tr>
<tr><th>Tier 1 Spawn Count:</th><td><span id="CalculateTier1SpawnCountOutput"></span></td></tr>
<tr><th>Tier 2 Spawn Count:</th><td><span id="CalculateTier2SpawnCountOutput"></span></td></tr>
<tr><th>Tier 3 Spawn Count:</th><td><span id="CalculateTier3SpawnCountOutput"></span></td></tr>
<tr><th>Tier 4 Spawn Count:</th><td><span id="CalculateTier4SpawnCountOutput"></span></td></tr>
<tr><th>Tier 5 Spawn Count:</th><td><span id="CalculateTier5SpawnCountOutput"></span></td></tr>
<tr><th>Tier 6 Spawn Count:</th><td><span id="CalculateTier6SpawnCountOutput"></span></td></tr>
<tr><th>Total:</th><td><span id="TotalCount"></span></td></tr>
</table>
<script type="text/javascript">
function calculate() {
const wave = parseInt(document.getElementById("waveInput").value);
const data = CalculateMobsForWave(wave);
// document.getElementById("TargetDifficultyOutput").innerText = CalculateTargetDifficulty(wave);
var totalCount = 0;
for (var tier=1; tier<7; tier++) {
const count = parseInt(Math.floor(data[tier]));
document.getElementById("CalculateTier"+tier+"SpawnCountOutput").innerText = count;
totalCount += count;
}
document.getElementById("TotalCount").innerText = totalCount;
}
document.getElementById("waveInput").addEventListener("change", calculate);
document.getElementById("waveInput").addEventListener("keyup", calculate);
const params = new URLSearchParams(window.location.search);
if (params.has("wave")) {
document.getElementById("waveInput").value = params.get("wave");
}
calculate();
</script>
</body>
</html>