-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathtest.html
136 lines (126 loc) · 5.84 KB
/
test.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
<body>
<table>
<tr><th>レベル</th><td><input id="eid" type="number" value="50"/></td></tr>
<tr><th>スキレベ</th><td><input id="eslv" type="number" value="6"/></td></tr>
<tr><th>性格</th>
<td>
<select id="enature_up">
<option value="">---</option>
<option value="hs">おてつだいスピード▲▲</option>
<option value="ip">食材確率▲▲</option>
<option value="sp">スキル確率▲▲</option>
</select>
<select id="enature_down">
<option value="">---</option>
<option value="hs">おてつだいスピード▼▼</option>
<option value="ip" selected>食材確率▼▼</option>
<option value="sp">スキル確率▼▼</option>
</select>
</tr>
</tr>
<tr><th>サブスキル</th>
<td>
<select id="es10">
<option value=""></option>
<option value="hb">おてつだいボーナス</option>
<option value="iul">最大所持数L</option>
<option value="ium">最大所持数M</option>
<option value="ius">最大所持数S</option>
<option value="stm">スキル確率M</option>
<option value="sts">スキル確率S</option>
</select><br>
<select id="es25">
<option value=""></option>
<option value="hb">おてつだいボーナス</option>
<option value="iul">最大所持数L</option>
<option value="ium">最大所持数M</option>
<option value="ius">最大所持数S</option>
<option value="stm">スキル確率M</option>
<option value="sts">スキル確率S</option>
</select><br>
<select id="es50">
<option value=""></option>
<option value="hb">おてつだいボーナス</option>
<option value="iul">最大所持数L</option>
<option value="ium">最大所持数M</option>
<option value="ius">最大所持数S</option>
<option value="stm">スキル確率M</option>
<option value="hsm">おてつだいスピードM</option>
</select><br>
</td>
</tr>
</table>
<input type="button" onclick="update()" value="更新">
<div id="output" style="white-space: pre;"></div>
<script>
function trunc(v, n) {
const N = Math.pow(10, n);
return Math.floor(v * N) / N;
}
function subskill_factor(subskills, key, contains, notContains) {
return subskills.includes(key) ? contains : notContains;
}
function update() {
const level = parseInt(document.getElementById("eid").value, 10);
const skillLevel = parseInt(document.getElementById("eslv").value, 10);
const subskill10 = document.getElementById("es10").value;
const subskill25 = document.getElementById("es25").value;
const subskill50 = document.getElementById("es50").value;
const subskills = [subskill10, subskill25, subskill50];
if (level < 50) { subskills.pop(); }
if (level < 25) { subskills.pop(); }
if (level < 10) { subskills.pop(); }
const nature_up = document.getElementById("enature_up").value;
const nature_down = document.getElementById("enature_down").value;
const elm_output = document.getElementById("output");
let output_text = "";
// おてつだい時間
const h_0 = 2900;
const N_h = 1;
const hsm = subskill_factor(subskills, 'hsm', 0.14, 0);
const m_h = trunc((501 - level) / 500 * N_h * (1 - hsm), 4);
const h = h_0 * m_h;
output_text += `おてつだい時間: ${Math.floor(h / 60)}分${Math.floor(h % 60)}秒\n`;
// 1時間おてつだい回数
const H = trunc(3600 / h, 2);
output_text += `毎時おてつだい回数: ${H}\n`;
// 食材
const r_0I = 0.172; // 基礎食材確率
const N_I = 1 + (nature_up === "ip" ? 0.2 : 0) + (nature_down === "ip" ? -0.2 : 0); // 性格食材補正
const m_I = N_I * (1);
const r_I = trunc(r_0I * m_I, 4);
const v_I = Math.floor((101+242)/2); // TODO
const g = [1.000,1.003,1.007,1.011,1.016,1.021,1.027,1.033,1.039,1.046,1.053,
1.061,1.069,1.077,1.085,1.094,1.104,1.114,1.124,1.134,1.145,1.156,
1.168,1.180,1.192,1.205,1.218,1.231,1.245,1.259,1.274,1.288,1.303,
1.319,1.335,1.351,1.368,1.385,1.402,1.420,1.439,1.457,1.477,1.496,
1.517,1.537,1.558,1.580,1.602,1.625,1.648,1.671,1.696,1.720,1.745][level - 1];
const P_I = trunc(5 * H * r_I * v_I * g, 2);
output_text += `食材SP: ${P_I} (=5 * ${H} * ${r_I} * ${v_I} * ${g})\n`;
// きのみ
const r_B = (1 - r_I);
const b_0 = 26; // モモン
const e_B = Math.max(b_0 + level - 1, Math.pow(1.025, level - 1) * b_0);
const n_B = 1; // きのみの数
const P_B = trunc(5 * H * r_B * e_B * n_B, 2);
output_text += `きのみSP: ${P_B} (=5 * ${H} * ${r_B} * ${e_B} * ${n_B})\n`;
// スキルSP
const r_0s = 0.04;
const N_s = 1 + (nature_up === "sp" ? 0.2 : 0) + (nature_down === "sp" ? -0.2 : 0); // 性格スキル補正
const m_s = 1 + subskill_factor(subskills, 'sts', 0.18, 0) +
subskill_factor(subskills, 'stm', 0.36, 0);
const r_s = trunc(r_0s * N_s * m_s, 4);
const v_s = [1120, 1593, 2197, 3033, 4187, 5785][skillLevel - 1];
const P_S = trunc(5 * H * r_s * v_s, 2);
output_text += `スキルSP: ${P_S} (=5 * ${H} * (${r_0s} * ${N_s} * ${m_s}) * ${v_s})\n`;
const s_m = 1 +
subskill_factor(subskills, "ius", 0.071, 0) +
subskill_factor(subskills, "ium", 0.139, 0) +
subskill_factor(subskills, "iul", 0.181, 0) +
subskill_factor(subskills, "hb", 0.221, 0);
const RP = Math.round((P_I + P_B + P_S) * s_m);
output_text += `SP: ${RP} (factor=${s_m})\n`;
elm_output.innerText = output_text;
}
</script>
</body>