-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPhysics_Magic_Resistance_Calculator.html
178 lines (164 loc) · 5.01 KB
/
Physics_Magic_Resistance_Calculator.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
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>トーラムオンライン 物理/魔法 耐性計算ツール</title>
<script type="text/javascript" src="brython/www/src/brython.js">
</script>
<script type="text/javascript" src="brython/www/src/brython_stdlib.js">
</script>
<style type="text/css">
body{
background-color: #2b2b2b;
color: #e4cfcf;
font-size: 23px;
}
input{
font: sans-serif;
font-size: 25px;
width: 80px;
height: 50px;
padding: 0.3em;
transition: 0.3s;
color: #d3d3d3;
border: none;
border-bottom: 2px solid #1b2538;
background-color: #463939;
outline-color: #343434;
outline-style: groove;
outline-width: 4.1px;
}
div{
font-size: 25px;
}
i{
display:inline;
font-size: 25px;
}
button{
background-color: #4f4f4f;
color: #e4cfcf;
font-size: 35px;
width: 280px;
height: 60px;
outline: 0;
}
div#RESULTs{
border: 2px groove;
color: #4f4f4f;
width: 950px;
height: 60px;
}
h2#RESULT{
font-size: 30px;
display:inline;
width: 750px;
height: 80px;
color: red;
line-height: 2;
letter-spacing: 0.114em;
padding-left: 20px;
}
a:link { color: #e4d7a6; }
a:visited { color: #e4d7a6; }
a:hover { color: #e4d7a6; }
a:active { color: #e4d7a6; }
a{
font-family: sans-serif;
font-size: 23px;
}
div#text_field{
font-size: 35px;
}
h3#H3relase_Data{
display:inline;
}
textarea#ReleaseData{
resize: none;
width: 970px;
height: 240px;
color: #e4cfcf;
background-color: #2b2b2b;
outline-style: groove;
outline: 0;
outline-width: 2.1px;
font-size: 25px;
}
</style>
</head>
<body onload="brython()">
<script type="text/python">
from browser import document, html, bind
from math import floor
document["TITLE"] <= "物理/魔法 耐性計算ツール"
CalculationField = document["Calculation_Field"]
document["ReleaseData"] <= """2022/01/14 - ページ作成と微調整、計算式作成。
2022/01/14 - 入力がない時は0を自動的に入力するように調整。
2022/01/15 - 出力値が100%を超えないように調整。
2022/01/15 - 出力値がマイナスにならないように調整。
2022/01/15 - 変更履歴の追加。
2022/01/16 - 出力結果の文字列を調整。
2022/01/16 - 出力結果の位置を調整。
"""
def Resistance_input():
physics_Title = html.I('物理耐性の合計値(%):')
physics_Input = html.INPUT()
magics_Title = html.I('魔法耐性の合計値(%):')
magics_Input = html.INPUT()
Calculation_BTN = html.BUTTON("計算する")
CalculationField <= physics_Title + html.I(" ") + physics_Input + html.BR() + magics_Title + html.I(" ") + magics_Input + html.BR() + html.BR() + Calculation_BTN
physics_Input.focus()
magics_Input.focus()
return physics_Input, magics_Input, Calculation_BTN
def ScreenClear():
document["RESULT"].clear()
def main():
PI, MI, Calc_BTN = Resistance_input()
@bind(Calc_BTN,"click")
def CalculationClick(CC):
ScreenClear()
if PI.value == '':
PI.value = '0'
if MI.value == '':
MI.value = '0'
physical_resistance = int(PI.value)
if 51 <= physical_resistance <= 99:
Physcal_ADD_Resistance = floor(((50 / 100) + (((physical_resistance - 50) / 2) / 100)) * 100)
elif 100 <= physical_resistance:
Physcal_ADD_Resistance = floor(((50 / 100) + ((50 / 100) * (50 / 100)) + ((50 / 100) * (50 / 100) * ((physical_resistance - 100) / 100))) * 100)
elif physical_resistance <= 50:
Physcal_ADD_Resistance = physical_resistance + 0
if 101 <= Physcal_ADD_Resistance:
Physcal_ADD_Resistance = 'NaN'
elif Physcal_ADD_Resistance <= -1:
Physcal_ADD_Resistance = 'NaN'
magic_resistance = int(MI.value)
if 51 <= magic_resistance <= 99:
Magic_ADD_Resistance = floor(((50 / 100) + (((magic_resistance - 50) / 2) / 100)) * 100)
elif 100 <= magic_resistance:
Magic_ADD_Resistance = floor(((50 / 100) + ((50 / 100) * (50 / 100)) + ((50 / 100) * (50 / 100) * ((magic_resistance - 100) / 100))) * 100)
elif magic_resistance <= 50:
Magic_ADD_Resistance = magic_resistance + 0
if 101 <= Magic_ADD_Resistance:
Magic_ADD_Resistance = 'NaN'
elif Magic_ADD_Resistance <= -1:
Magic_ADD_Resistance = 'NaN'
document["RESULT"] <= '実際の物理耐性は{}%、実際の魔法耐性は{}%です。'.format(Physcal_ADD_Resistance, Magic_ADD_Resistance)
main()
</script>
<h4 style="display: inline;"><a href="https://crossdarkrix.github.io/ToramHTMLTools/" style="display: inline;">トップページに戻る</a></h4>
<h2 id="TITLE"></h2>
<div>
作った経緯:<br>
「物理耐性」と「魔法耐性」には50%から盛った分の値が半減する仕様なので作りました。<br><br>
注意事項:<br>
「物理耐性の合計値」には装備等で盛った物理耐性の値(%)を入れてください。<br>
「魔法耐性の合計値」には装備等で盛った魔法耐性の値(%)を入れてください。<br><br>
</div>
<div id="Calculation_Field"></div><br>
<div id="RESULTs"><h2 id="RESULT"></h2></div><br>
<h3 id="H3relase_Data">変更履歴</h3><br>
<textarea readonly id="ReleaseData"></textarea>
<h3><br><br><br>
</h3>
</body>
</html>