-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcoop.html
More file actions
303 lines (278 loc) · 14.8 KB
/
Copy pathcoop.html
File metadata and controls
303 lines (278 loc) · 14.8 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<!-- Bootstrap CSS -->
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css"
integrity="sha384-xOolHFLEh07PJGoPkLv1IbcEPTNtaed2xpHsD9ESMhqIYd0nLMwNLD69Npy4HI+N"
crossorigin="anonymous"
/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" />
<link rel="stylesheet" href="https://unpkg.com/bootstrap-table@1.21.0/dist/bootstrap-table.min.css" />
<script
src="https://cdn.jsdelivr.net/npm/jquery@3.6.0/dist/jquery.min.js"
integrity="sha384-vtXRMe3mGCbOeY7l30aIg8H9p3GdeSe4IFlP6G8JMa7o7lXvnz3GFKzPxzJdPfGK"
crossorigin="anonymous"
></script>
<script
src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.bundle.min.js"
integrity="sha384-Fy6S3B9q64WdZWQUiU+q4/2Lc9npb8tCaSX9FK7E8HnRr0Jz8D6OP9dO5Vg3Q9ct"
crossorigin="anonymous"
></script>
<script defer src="js/dist/json-formatter.umd.js" charset="UTF-8"></script>
<script src="https://unpkg.com/bootstrap-table@1.21.0/dist/bootstrap-table.min.js"></script>
<title>Splatoon 3 - Salmon Run Database</title>
<style>
body {
background-color: #e9ecef;
}
footer {
border-top: 1px solid rgba(86, 61, 124, 0.2);
}
.bd-placeholder-img {
font-size: 1.125rem;
text-anchor: middle;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
@media (min-width: 768px) {
.bd-placeholder-img-lg {
font-size: 3.5rem;
}
}
.themed-grid-col {
padding-top: 15px;
padding-bottom: 15px;
background-color: rgba(86, 61, 124, 0.15);
border: 1px solid rgba(86, 61, 124, 0.2);
}
.parameterContent {
margin-top: 1em;
border: 1px solid rgba(54, 38, 78, 0.2);
background-color: rgba(34, 19, 56, 0.2);
}
.contentWrapper {
background-color: #fff;
border: 1px solid #dee2e6;
border-radius: 1rem;
margin-top: 10px;
padding: 15px;
}
h2 {
margin: 1rem;
}
h3 {
margin: 1rem;
}
/* The slider itself */
.slider {
width: 100%;
}
</style>
</head>
<body>
<nav class="navbar navbar-expand-md navbar-dark bg-dark">
<a class="navbar-brand" href="#">Salmon Run Database</a>
<button
class="navbar-toggler"
type="button"
data-toggle="collapse"
data-target="#navbarCollapse"
aria-controls="navbarCollapse"
aria-expanded="false"
aria-label="Toggle navigation"
>
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarCollapse"></div>
</nav>
<main role="main">
<div class="jumbotron">
<div class="col-sm-8 mx-auto">
<h1>Splatoon 3 - Salmon Run Database</h1>
<select class="form-control" id="version"></select>
<ul class="nav nav-tabs" id="modes" role="tablist"></ul>
<div class="tab-content" id="modeTabControl"></div>
</div>
</div>
<script type="module">
import { generateHeader, get_prefix, localize, get_image_tag, format_img, add_tab, add_table } from "./js/Utility.js"
generateHeader($("#navbarCollapse"))
const prefix = get_prefix()
var version = "100"
var lang_dict = {}
$.getJSON(prefix + "versions.json", vers => {
let last = 0
vers.forEach(ver => {
if (ver === "099") {
$("#version").append(new Option("Testfire", ver))
} else {
$("#version").append(
new Option(
ver.length === 3 ? ver[0] + "." + ver[1] + "." + ver[2] : ver[0] + ver[1] + "." + ver[2] + "." + ver[3],
ver
)
)
}
last = ver
})
$("#version").val(last)
version = last
load_data()
})
function load_parameters(elem, filename) {
$.getJSON(`${prefix}/data/parameter/${version}/${filename}.json`, data => {
const formatter = new JSONFormatter(data)
elem.children().remove()
elem.append(formatter.render())
formatter.openAtDepth(5)
})
}
function load_data() {
$.getJSON(prefix + "data/language/EUen.json", d => {
for (const [key, value] of Object.entries(d)) {
lang_dict[key] = value
}
$.getJSON(`${prefix}/data/mush/${version}/CoopEnemyInfo.json`, data_dict => {
$(`#coop-enemy-table`).bootstrapTable("refreshOptions", {
data: data_dict,
})
})
$.getJSON(`${prefix}/data/mush/${version}/CoopSkinInfo.json`, data_dict => {
$(`#coop-skins-table`).bootstrapTable("refreshOptions", {
data: data_dict,
})
})
load_parameters($(`#levelContent`), "misc/spl__CoopLevelsConfig.spl__CoopLevelsConfig")
load_parameters($(`#rewardContent`), "misc/spl__CoopRewardConfig.spl__CoopRewardConfig")
})
const rows = []
for (let i = 0; i < 21; i++) {
rows.push({
smell: i,
value: `${(Math.max(i - 4, 0) * i) / 3.2}%`,
})
}
$("#coop-smell-table").bootstrapTable("refreshOptions", {
data: rows,
})
}
function enemy_name_formatter(value) {
return localize("CommonMsg/Coop/CoopEnemy", value)
}
function enemy_image_formatter(value) {
return `<center>${format_img(prefix + "images/coopEnemy/", value, 96)}</center>`
}
function coop_skin_name_formatter(value) {
return localize("CommonMsg/Coop/CoopSkinName", value)
}
function coop_skin_image_formatter(value) {
return `<center>${format_img(prefix + "images/coopSkin/", value, 96)}</center>`
}
function urokoFormatter(value) {
return `<p>Bronze: ${value.BronzeUrokoNum}<br />Silver: ${value.SilverUrokoNum}<br />Gold ${value.GoldUrokoNum}`
}
window.enemy_name_formatter = enemy_name_formatter
window.enemy_image_formatter = enemy_image_formatter
window.coop_skin_name_formatter = coop_skin_name_formatter
window.coop_skin_image_formatter = coop_skin_image_formatter
window.urokoFormatter = urokoFormatter
window.lang_dict = lang_dict
function showBossHP() {
var output = document.getElementById("bossHP")
output.innerHTML = `${document.getElementById("bossHPrange").value / 10}%`
caclulateScaleProbability()
}
function caclulateScaleProbability() {
let HPLeft = parseInt(document.getElementById("bossHPrange").value)
let scalesGained = Math.floor((1000 - HPLeft) / 125) + 2
if (HPLeft === 0.0) {
scalesGained += Math.min(3, Math.floor(parseInt($("#timeval").val()) / 10))
}
const ratio = parseInt($("#hazardlevel").val()) / 333.0
const gold_chance = ratio * 0.03 * 100
const silver_chance = 100 * (ratio * 0.15 + 0.05)
document.getElementById("expectedScale").innerHTML = `${scalesGained}`
document.getElementById("goldProbability").innerHTML = `${gold_chance.toFixed(4)}%`
document.getElementById("silverProbability").innerHTML = `${silver_chance.toFixed(4)}%`
}
window.showBossHP = showBossHP
window.caclulateScaleProbability = caclulateScaleProbability
$(function () {
$("#version").change(function () {
version = $(this).val()
load_data()
})
add_tab("coop-enemy", "Enemies")
add_tab("coop-skins", "Skins")
add_tab("coop-rewards", "Shift Rewards")
$("#coop-rewards").append('<div id="rewardContent" class="parameterContent"></div>')
add_tab("coop-level-config", "Level Configuration")
$("#coop-level-config").append('<div id="levelContent" class="parameterContent"></div>')
add_tab("coop-smell", "Boss Encounter Probability")
$("#coop-smell").append(
`<div class="contentWrapper"><p>Every player has a "smell". The smell bar increases after every match where you did not encounter a Boss Salmonid.
The sum of the smell of all four team members decides how likely it is to encounter it.</p>${format_img(
`${get_prefix()}images/misc/`,
"smell",
64
)}</div>`
)
add_tab("coop-scale", "Scale Reward Calculator")
$("#coop-scale").append(
`<div class="contentWrapper"><p>After fighting a Boss Salmonid, you are rewarded with scales. The amount of scales you get depend on your time left, as well as how much damage you dealt to the Boss Salmonid. The probability for each scale is dependent on the hazard level only.</p></div>`
)
$("#coop-scale").append(`<div class="contentWrapper">
<div><strong>Time left (s):</strong> <input id="timeval" type="number" min="0" max="100" value="0" onchange="caclulateScaleProbability()" /></div>
<div><strong>Hazard Level:</strong> <input id="hazardlevel" type="number" min="0" max="333" value="0" onchange="caclulateScaleProbability()" /></div>
<div><strong>Boss HP Left (%):</strong> <span id="bossHP">100%</span><input type="range" min="0" max="1000" value="1000" class="slider" id="bossHPrange" oninput={showBossHP()}></div>
<div>
<div><strong>Expected Number of Scales:</strong> <span id="expectedScale">2</span></div>
<div><strong>Gold Scale Probability:</strong> <span id="goldProbability">0%</span></div>
<div><strong>Silver Scale Probability:</strong> <span id="silverProbability">5%</span></div>
</div>
</div>`)
add_table("coop-enemy", "coop-enemy-table", [
{ Field: "Type", Label: "Image", formatter: "enemy_image_formatter" },
{ Field: "Type", Label: "Name", sortable: "true", formatter: "enemy_name_formatter" },
{ Field: "ActorMax", Label: "Maximum On Field", sortable: "true" },
{
Field: "CalcAppearPriority",
Label: "Calc Appear Priority",
sortable: "true",
visible: "false",
},
{ Field: "Category", Label: "Category", sortable: "true" },
{ Field: "HitIkuraNum", Label: "Power Eggs Per Hit", sortable: "true" },
{ Field: "KillIkuraNum", Label: "Power Eggs Per Kill", sortable: "true" },
])
add_table("coop-skins", "coop-skins-table", [
{ Field: "Id", Label: "ID", sortable: "true", visible: "false" },
{ Field: "__RowId", Label: "Image", formatter: "coop_skin_image_formatter" },
{ Field: "__RowId", Label: "Name", sortable: "true", formatter: "coop_skin_name_formatter" },
{ Field: "Season", Label: "Season", sortable: "true" },
{ Field: "UrokoPrice", Label: "Fish Scale Price", formatter: "urokoFormatter" },
{ Field: "UrokoUnlockLevel", Label: "Fish Scale Unlock Level", sortable: "true" },
])
add_table("coop-smell", "coop-smell-table", [
{ Field: "smell", Label: "Team Smell", sortable: "true" },
{ Field: "value", Label: "Value", sortable: "true" },
])
//load_data()
})
</script>
</main>
<footer class="footer" id="footer">
<script type="module">
import { generateFooter } from "./js/Utility.js"
generateFooter($("#footer"))
</script>
</footer>
</body>
</html>