-
Notifications
You must be signed in to change notification settings - Fork 0
/
hitsim.html
372 lines (349 loc) · 12.6 KB
/
hitsim.html
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
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
<html><head>
<!-- Standard Meta -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<!-- start of scripts section -->
<script src="https://cdn.jsdelivr.net/npm/jquery@3.3.1/dist/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/fomantic-ui@2.8.7/dist/semantic.min.css">
<script src="https://cdn.jsdelivr.net/npm/fomantic-ui@2.8.7/dist/semantic.min.js"></script>
<script>
$(function(){
$("#header").load("https://raw.githubusercontent.com/iKrazy/OvalSite/main/assets/html/header.html");
$("#footer").load("https://raw.githubusercontent.com/iKrazy/OvalSite/main/assets/html/footer.html");
});
$(document).ready(function(){
$("#MILFSTYLEDIV").hide();
milfname = "Jaime Goliver";
milftype = "Ranging";
milfacc = "155";
milfstat = "250";
ovaldef = "99";
ovalstat = "99";
////////////////////////////////////////////
//shitty way of grabbing input box text and replacing in
//e acc
MILFACCURACY.addEventListener("change", function (e) {
milfacc = this.value
doitupmini();
});
//shitty way of grabbing input box text and replacing in
//e style custom
MILFSTYLE.addEventListener("change", function (e) {
if (this.value === "0") {
var milftype = "Melee"
} else if (this.value === "1") {
var milftype = "Ranging"
} else if (this.value === "2") {
var milftype = "Psychic"
}
captureovalstat = document.getElementById('OVALSTYLESTAT').value
var milfstattext = document.getElementById('milfstattext').innerText
var ovalstattext = document.getElementById('ovalstattext').innerText
document.getElementById('milfstattext').innerText= milfstattext.replace(/.*/, 'Enemy ' + milftype + ' Level');
document.getElementById('ovalstattext').innerText= ovalstattext.replace(/.*/, 'Player ' + milftype + ' Level');
if (captureovalstat != 'undefined') {
document.getElementById('OVALSTYLESTAT').value= captureovalstat;
ovalstat = captureovalstat
}
doitupmini();
});
//shitty way of grabbing input box text and replacing in
//e style stat
MILFSTYLESTAT.addEventListener("change", function (e) {
milfstat = this.value
doitupmini();
});
//shitty way of grabbing input box text and replacing in sheet
//defense
OVALDEFENSE.addEventListener("change", function (e) {
ovaldef = this.value
doitupmini();
});
//shitty way of grabbing input box text and replacing in sheet
//style stat
OVALSTYLESTAT.addEventListener("change", function (e) {
ovalstat = this.value
doitupmini();
});
////////////////////////////////////////////
//shitty way of grabbing input box text and replacing in
//boss preset
MILFMYPRESET.addEventListener("change", function (e) {
if (MILFMYPRESET.value === "3") {
$("#MILFSTYLEDIV").hide();
milftype = "Psychic"
milfname = "Jealous Witch"
milfacc = "225"
milfstat = "310"
} else if (MILFMYPRESET.value === "4") {
$("#MILFSTYLEDIV").hide();
milftype = "Ranging"
milfname = "Dead Eye Jones"
milfacc = "205"
milfstat = "340"
} else if (MILFMYPRESET.value === "0") {
$("#MILFSTYLEDIV").hide();
milftype = "Psychic"
milfname = "Tikitama"
milfacc = "150"
milfstat = "270"
} else if (MILFMYPRESET.value === "1") {
$("#MILFSTYLEDIV").hide();
milfname = "Jaime Goliver"
milftype = "Ranging"
milfacc = "155"
milfstat = "250"
} else if (MILFMYPRESET.value === "2") {
$("#MILFSTYLEDIV").hide();
milftype = "Melee"
milfname = "Zenitsu"
milfacc = "190"
milfstat = "240"
} else if (MILFMYPRESET.value === "6") {
$("#MILFSTYLEDIV").hide();
milftype = "Psychic"
milfname = "Cursed Yeti"
milfacc = "160"
milfstat = "280"
} else if (MILFMYPRESET.value === "5") {
$("#MILFSTYLEDIV").hide();
milftype = "Melee"
milfname = "Demon Prince"
milfacc = "280"
milfstat = "550"
} else if (MILFMYPRESET.value === "7") {
//custom inputs
$("#MILFSTYLEDIV").show();
milftype = "Melee"
milfname = "Custom"
milfacc = "0"
milfstat = "0"
};
captureovalstat = document.getElementById('OVALSTYLESTAT').value
console.log(captureovalstat);
var milfstattext = document.getElementById('milfstattext').innerHTML
var ovalstattext = document.getElementById('ovalstattext').innerHTML
document.getElementById('milfstattext').innerHTML= milfstattext.replace(/.*/, 'Enemy ' + milftype + ' Level');
document.getElementById('ovalstattext').innerHTML= ovalstattext.replace(/.*/, 'Player ' + milftype + ' Level');
document.getElementById('MILFACCURACY').value= milfacc;
document.getElementById('MILFSTYLESTAT').value= milfstat;
if (captureovalstat != '' && captureovalstat != 'undefined') {
document.getElementById('OVALSTYLESTAT').value= captureovalstat;
ovalstat = captureovalstat
}
doitupmini();
});
});
function setInputFilter(textbox, inputFilter) {
["input", "keydown", "keyup", "mousedown", "mouseup", "select", "contextmenu"].forEach(function(event) {
textbox.addEventListener(event, function() {
if (inputFilter(this.value)) {
this.oldValue = this.value;
this.oldSelectionStart = this.selectionStart;
this.oldSelectionEnd = this.selectionEnd;
} else if (this.hasOwnProperty("oldValue")) {
this.value = this.oldValue;
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
} else {
this.value = "";
}
});
});
}
function doitupmini() {
var tophalf = +milfacc + +milfstat * 0.25
var bottomhalf = (+ovaldef + +ovalstat * 0.25) + tophalf
var hitchance = tophalf / bottomhalf //num9
var adjhitchance = Math.round((hitchance * 100) * 100) / 100; //num10
document.getElementById('MILFHITCHANCE').value= adjhitchance + '%';
var basedmg = ((+milfstat * 1.25) / 10) //num11
document.getElementById('MILFMAXHIT').value= Math.floor(basedmg)
}
function doitup() {
var goober = Math.floor(Math.random() * 101); //num8
var tophalf = +milfacc + +milfstat * 0.25
var bottomhalf = (+ovaldef + +ovalstat * 0.25) + tophalf
var hitchance = tophalf / bottomhalf //num9
var adjhitchance = Math.round((hitchance * 100) * 100) / 100; //num10
document.getElementById('MILFHITCHANCE').value= adjhitchance + '%';
document.getElementById('MILFRNG').value= goober;
var poober = Math.ceil(100 - adjhitchance) //if num8 >= 100-num10
if (goober >= poober) {
//color hitchance green
var basedmg = ((+milfstat * 1.25) / 10) //num11
document.getElementById('MILFMAXHIT').value= Math.floor(basedmg);
var modperc = (goober - (100 - adjhitchance)) / adjhitchance //num12
var basedmgredo = basedmg * modperc
//placeholder, does nothing right now
var ewepmax = 0
var ewepmin = 0
var eweprange = ewepmax - ewepmin //num13
var ewepdamage = eweprange * modperc + ewepmin //num14
var efinaldamage = Math.ceil(basedmgredo + ewepdamage) //num15
document.getElementById('MILFFINAL').value= milfname + ' rolls a ' + goober + ' and hits you for ' + efinaldamage + '!';
} else {
//color that shit red cause ya missed
document.getElementById('MILFFINAL').value= milfname + ' rolls a ' + goober + ' and misses you!';
}
}
</script>
<!-- end of scripts section -->
<!-- start of extra style section -->
<link rel="stylesheet" type="text/css" href="assets/css/allpages.css">
<style type="text/css">
<!-- start of page specific styling -->
.main.container {
min-height: 100%;
}
.ui.input>input {
width: 100%;
padding: 0 0 0 0;
height: 30px;
text-align:center;
}
select.ui.dropdown {
height: 30px;
border-radius: .28571429rem;
padding: 0 0 0 0;
width: 37px;
}
.one.wide.column {
min-width: min-content;
align-self: flex-end;
white-space: pre-line;
}
.ui.centered.grid>.column:not(.aligned):not(.justified):not(.row), .ui.centered.grid>.row>.column:not(.aligned):not(.justified), .ui.grid .centered.row>.column:not(.aligned):not(.justified) {
text-align: center;
}
.ui.transparent.inverted.input {
border: 1px solid rgba(255,255,255,.15);
border-radius: .28571429rem;
}
.ui.selection.dropdown {
min-width: min-content;
padding: 0 .4em 0 .4em;
min-height: 32;
}
a {
color: rgb(208 251 255 / 90%);
transition: 0.3s;
}
a:hover {
color: rgb(134 238 249);
transition: 0.3s;
}
<!-- end of page specific styling -->
</style>
<!-- end of extra style section -->
<title>DTS - Enemy Hit Sim</title>
</head>
<body>
<!-- start of navbar header section -->
<div id="header"></div>
<!-- end of navbar header section -->
<!-- start of main body section -->
<div class="flex-wrapper">
<div class="ui inverted segment">
<div class="ui main text container" style="text-align:center; vertical-align:middle; min-height: 0;margin-bottom:-80px;">
<h1 class="ui inverted header">Enemy Hit Simulator (WIP)</h1>
<p>Simulate an enemy hitting you once with more or less ±1 min/max damage</p>
<p>All information can be found on your Character Skills Page, and on <a href="https://damascus.fandom.com/wiki/Enemies" target="_blank">the Wiki</a> </p>
<div class="ui inverted horizontal section divider"><button class="ui inverted basic button" id="run" onclick="doitup()" style="width: 100px;">ROLL</button></div>
<div class="ui centered grid">
<div class="one wide column">
<div style="margin-bottom:-22px;margin-top:-22px;margin-left:-3px;">Final Result</div>
<div class="ui inverted transparent input" style="border:0;margin-left:-3px;">
<input type="text" placeholder="roll it up boi" id="MILFFINAL" style="min-width:500px;font-weight:bolder;">
</div>
</div>
</div>
</div>
<div class="ui centered grid" style="padding-left:50px;padding-right:50px;">
<div class="ui main text container" style="text-align:center; vertical-align:middle; min-height: 0;">
<div class="one wide column">
Enemy Preset
<select class="ui inverted selection dropdown" id="MILFMYPRESET">
<option hidden>Default (Jaime Goliver)</option>
<option value="0">Tikitama</option>
<option value="1">Jaime Goliver</option>
<option value="2">Zenitsu</option>
<option value="3">Jealous Witch</option>
<option value="4">Dead Eye Jones</option>
<option value="5">Demon Prince</option>
<option value="6">Cursed Yeti</option>
<option value="7">Custom</option>
</select>
</div>
<div class="one wide column" id="MILFSTYLEDIV">
Enemy Combat Style
<select class="ui inverted selection dropdown" id="MILFSTYLE">
<option value="0">Melee</option>
<option value="1">Ranging</option>
<option value="2">Psychic</option>
</select>
</div>
<div class="one wide column">
<div style="margin-bottom:-22px;">Enemy Accuracy Level</div>
<div class="ui inverted transparent input">
<input type="text" placeholder="155" id="MILFACCURACY">
</div>
</div>
<div class="one wide column" id="estyle">
<div id="milfstattext" style="margin-bottom:-22px;">Enemy Ranging Level</div>
<div class="ui inverted transparent input">
<input type="text" placeholder="250" id="MILFSTYLESTAT">
</div>
</div>
<div class="one wide column">
<div style="margin-bottom:-22px;">Player Defense Level</div>
<div class="ui inverted transparent input">
<input type="text" placeholder="99" id="OVALDEFENSE">
</div>
</div>
<div class="one wide column" id="pstyle">
<div id="ovalstattext" style="margin-bottom:-22px;">Player Ranging Level</div>
<div class="ui inverted transparent input">
<input type="text" placeholder="99" id="OVALSTYLESTAT">
</div>
</div>
</div>
<div class="ui main text container" style="text-align:center; vertical-align:middle; min-height: 0;">
<div class="one wide column">
<div id="ovalstattext" style="margin-bottom:-22px;">Enemy Hit Chance</div>
<div class="ui inverted transparent input">
<input type="text" placeholder="63.74%" id="MILFHITCHANCE">
</div>
</div>
<div class="one wide column">
<div style="margin-bottom:-22px;">Enemy Max Hit</div>
<div class="ui inverted transparent input">
<input type="text" placeholder="32" id="MILFMAXHIT">
</div>
</div>
<div class="one wide column">
<div style="margin-bottom:-22px;">Your RNG Roll</div>
<div class="ui inverted transparent input">
<input type="text" placeholder="0" id="MILFRNG">
</div>
</div>
</div>
</div>
</div>
</div>
<!-- end of main body section -->
<!-- start of end footer section -->
<div id="footer"></div>
<!-- end of end footer section -->
</body>
<script>
setInputFilter(document.getElementById("OVALDEFENSE"), function(value) {
return /^-?\d*$/.test(value); });
setInputFilter(document.getElementById("OVALSTYLESTAT"), function(value) {
return /^-?\d*$/.test(value); });
setInputFilter(document.getElementById("MILFACCURACY"), function(value) {
return /^-?\d*$/.test(value); });
setInputFilter(document.getElementById("MILFSTYLESTAT"), function(value) {
return /^-?\d*$/.test(value); });
</script>
</html>