-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDamageCalculator.html
1329 lines (1326 loc) · 67 KB
/
DamageCalculator.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
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>伤害计算器</title>
<style>
body {
background : #555;
font-family:微软雅黑;
}
.content {
width: 1340px;
height : auto ;
margin: auto;
background: white;
padding: 10px;
font-size :18px;
line-height :200%;
float:none;
overflow:auto;
background-color:#F5F4F3;
}
.leftbox {
width:608px;
float:left;
padding: 4px;
position:relative;
}
.rightbox {
width:708px;
float:left;
padding: 4px;
}
.BATK{
width:110px;
float:left;
}
.BATK_input{
width:100px;
}
.cal_batk{
clear:left;
padding-top:10px;
}
.cal_I{
padding-top:6px;
padding-bottom:6px;
padding-left:6px;
border:solid 1px #D5DFE5;
border-radius:5px;
overflow:auto;
line-height:100%;
margin-bottom:6px;
box-shadow:inset 0 0 1px #FFF;
}
.cal_I_cover{
background-color:#f5f5f5;
position:absolute;
z-index:2;
filter:alpha(opacity=70);
opacity:0.7;
display: none;
width:50%;
}
.small_label{
font-size:14px;
}
.mini_label{
font-size:12px;
vertical-align:top;
}
.cal_I_formation_direction_div{
width:95px;
float:left;
margin-left:12px;
}
.cal_I_formation_direction_input{
width:80px;
text-align:center;
}
.other_I{
padding-top:6px;
padding-bottom:6px;
padding-left:6px;
border:solid 1px #D5DFE5;
border-radius:5px;
overflow:auto;
margin-bottom:6px;
box-shadow:inset 0 0 1px #FFF;
}
.button {
background-color: #4CAF50; /* Green */
border: 1px solid green;
color: white;
padding: 10px 22px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
cursor: pointer;
float: left;
}
.button:hover {
background-color: #3e8e41;
}
.h1 {
font-size: 32px;
color:#FAFAFA;
}
.h1_right {
text-align:right;
}
.titlebox {
width: 1340px;
height: 82px;
margin: auto;
padding: 5px 10px 5px 10px;
background-color:#81BEF7;
}
.titleboxleft {
width: 1000px;
float:left;
}
.titleboxright {
width: 340px;
float:left;
}
.a {
text-decoration:none;
color:#FAFAFA;
}
.a:visited {
color:#FAFAFA;
}
</style>
</head>
<body>
<form autocomplete="off">
<!--禁用自动填充-->
<div class="titlebox">
<div class="titleboxleft">
<h1 class="h1">Damage Calculator for WSGR v1.3-web</h1>
</div>
<div class="titleboxright">
<h1 class="h1 h1_right"><a class="a" href="index.html">返回首页</a></h1>
</div>
</div>
<div class="content">
<div class="leftbox" >
<label id="lbl_ATKTYPE">1.选择攻击类型:</label>
<select id="CMB_atktype" onchange="CMB_atktype_changed()">
</select>
<br/><hr/>
<label id="2">2.计算基础攻击力:</label>
<br/>
<div class="BATK">
<label id="lbl_BATK_V1" class="small_label">V1:</label>
<input id="TBox_BATK_V1" type="text" class="BATK_input" onpaste="return false;" onchange="check_set_BATK_Vn(1)" onkeypress="checkisnum()"/>
</div>
<div class="BATK">
<label id="lbl_BATK_V2" class="small_label">V2:</label>
<input id="TBox_BATK_V2" type="text" class="BATK_input" onpaste="return false;" onchange="check_set_BATK_Vn(2)" onkeypress="checkisnum()"/>
</div>
<div class="BATK">
<label id="lbl_BATK_V3" class="small_label">V3:</label>
<input id="TBox_BATK_V3" type="text" class="BATK_input" onpaste="return false;" onchange="check_set_BATK_Vn(3)" onkeypress="checkisnum()"/>
</div>
<div class="BATK">
<label id="lbl_BATK_V4" class="small_label">V4:</label>
<input id="TBox_BATK_V4" type="text" class="BATK_input" onpaste="return false;" onchange="check_set_BATK_Vn(4)" onkeypress="checkisnum()"/>
</div>
<div class="BATK">
<label id="lbl_BATK_V5" class="small_label">V5:</label>
<input id="TBox_BATK_V5" type="text" class="BATK_input" onpaste="return false;" onchange="check_set_BATK_Vn(5)" onkeypress="checkisnum2()"/>
</div>
<div class="cal_batk">
<label>计算公式:</label><label id="lbl_formula">aa</label>
<br/>
<label>计算结果:</label><label id="lbl_BATK_result">00</label>
</div>
<hr/>
<label>3.计算乘积系数:</label><br/>
<label id="lbl_I_title">计算公式:</label><br/>
<label id="lbl_I_formula" style="font-size:15px">xxx</label><br/>
<div class="cal_I">
<div class="cal_I_cover" id="Gpb_I_cover_0" style="width:580px; height:60px">
</div>
<label class="small_label">阵形系数:</label><br/>
<div class="cal_I_formation_direction_div">
<label class="small_label">单纵阵:</label>
<input id="TBox_I_formation_1" readonly="readonly" type="text" class="cal_I_formation_direction_input" />
</div>
<div class="cal_I_formation_direction_div">
<label class="small_label">复纵阵:</label>
<input id="TBox_I_formation_2" readonly="readonly" type="text" class="cal_I_formation_direction_input" />
</div>
<div class="cal_I_formation_direction_div">
<label class="small_label">轮形阵:</label>
<input id="TBox_I_formation_3" readonly="readonly" type="text" class="cal_I_formation_direction_input" />
</div>
<div class="cal_I_formation_direction_div">
<label class="small_label">梯形阵:</label>
<input id="TBox_I_formation_4" readonly="readonly" type="text" class="cal_I_formation_direction_input" />
</div>
<div class="cal_I_formation_direction_div">
<label class="small_label">单横阵:</label>
<input id="TBox_I_formation_5" readonly="readonly" type="text" class="cal_I_formation_direction_input" />
</div>
</div>
<div class="cal_I">
<div class="cal_I_cover" id="Gpb_I_cover_1" style="width:580px; height:60px">
</div>
<label class="small_label">航向系数:</label><br/>
<div class="cal_I_formation_direction_div">
<label class="small_label">T有利:</label>
<input id="TBox_I_direction_1" readonly="readonly" type="text" class="cal_I_formation_direction_input" />
</div>
<div class="cal_I_formation_direction_div">
<label class="small_label">同航战:</label>
<input id="TBox_I_direction_2" readonly="readonly" type="text" class="cal_I_formation_direction_input" />
</div>
<div class="cal_I_formation_direction_div">
<label class="small_label">反航战:</label>
<input id="TBox_I_direction_3" readonly="readonly" type="text" class="cal_I_formation_direction_input" />
</div>
<div class="cal_I_formation_direction_div">
<label class="small_label">T不利:</label>
<input id="TBox_I_direction_4" readonly="readonly" type="text" class="cal_I_formation_direction_input" />
</div>
</div>
<div class="cal_I">
<div class="cal_I_cover" id="Gpb_I_cover_2" style="width:580px; height:40px">
</div>
<label class="small_label">制空系数:</label><br/>
<label for="Rdb_I_airdomain1"class="mini_label"><input type="radio" id="Rdb_I_airdomain1" name="Rdb_I_airdomain_group" style="vertical-align: top" onchange="Rdb_I_airdomainN_CheckedChanged(0)"/>制空权占据:1.10</label>
<label for="Rdb_I_airdomain2"class="mini_label"><input type="radio" id="Rdb_I_airdomain2" name="Rdb_I_airdomain_group" style="vertical-align: top" onchange="Rdb_I_airdomainN_CheckedChanged(1)"/>制空权优势:1.05</label>
<label for="Rdb_I_airdomain3"class="mini_label"><input type="radio" id="Rdb_I_airdomain3" name="Rdb_I_airdomain_group" style="vertical-align: top" onchange="Rdb_I_airdomainN_CheckedChanged(2)"/>势均力敌:1.0</label>
<label for="Rdb_I_airdomain4"class="mini_label"><input type="radio" id="Rdb_I_airdomain4" name="Rdb_I_airdomain_group" style="vertical-align: top" onchange="Rdb_I_airdomainN_CheckedChanged(3)"/>制空权劣势:0.95</label>
<label for="Rdb_I_airdomain5"class="mini_label"><input type="radio" id="Rdb_I_airdomain5" name="Rdb_I_airdomain_group" style="vertical-align: top" onchange="Rdb_I_airdomainN_CheckedChanged(4)"/>制空权丧失:0.90</label>
<br/>
</div>
<div class="cal_I">
<div class="cal_I_cover" id="Gpb_I_cover_3" style="width:580px; height:44px">
</div>
<label class="small_label">声纳系数:</label><br/>
<label class="small_label">填入声纳装备的反潜值:</label>
<input id="TBox_I_sonar" type="text" style="width:137px;" onpaste="return false;" onchange="TBox_I_TextChanged('sonar')" onkeypress="checkisnum()" />
<label class="mini_label">计算公式和结果:</label>
<label id="lbl_I_sonar_result" class="mini_label">None</label><br/>
</div>
<div class="cal_I">
<div class="cal_I_cover" id="Gpb_I_cover_4" style="width:580px; height:44px">
</div>
<label class="small_label">弹药系数:</label><br/>
<label class="small_label">填入当前弹药百分数(0~120):</label>
<input id="TBox_I_ammo" type="text" style="width:56px" onchange="TBox_I_TextChanged('ammo')" onpaste="return false;" onkeypress="checkisnum()" />
<label class="mini_label">计算公式和结果:</label>
<label id="lbl_I_ammo_result" class="mini_label">None</label><br/>
</div>
<div class="cal_I" style="height:42px;width:262px;float:left" >
<div class="cal_I_cover" id="Gpb_I_cover_5" style="width:254px; height:44px;">
</div>
<label class="small_label">输入鱼雷机系数:</label><br/>
<label class="small_label">系数取值范围(0.5~1):</label>
<input id="TBox_I_tb" type="text" style="width:84px" onpaste="return false;" onchange="TBox_I_TextChanged('tb')" onkeypress="checkisnum2()"/>
</div>
<div class="cal_I" style="height:42px;width:324px; float:left;margin-left:6px" >
<div class="cal_I_cover" id="Gpb_I_cover_6" style="width:322px; height:44px;">
</div>
<label class="small_label">舰损系数:</label><br/>
<label for="Rdb_I_sufferdmg1"class="mini_label" style=" margin:10px;"><input type="radio" id="Rdb_I_sufferdmg1" name="Rdb_I_sufferdmg_group" style="vertical-align: top;" onchange="Rdb_I_sufferdmgN_CheckedChanged(0)"/>未中破:1.0</label>
<label for="Rdb_I_sufferdmg2"class="mini_label" style=" margin:5px;"><input type="radio" id="Rdb_I_sufferdmg2" name="Rdb_I_sufferdmg_group" style="vertical-align: top" onchange="Rdb_I_sufferdmgN_CheckedChanged(1)"/>中破:0.6</label>
<label for="Rdb_I_sufferdmg3"class="mini_label" style=" margin:5px;"><input type="radio" id="Rdb_I_sufferdmg3" name="Rdb_I_sufferdmg_group" style="vertical-align: top" onchange="Rdb_I_sufferdmgN_CheckedChanged(2)"/>大破/击沉:0.3</label>
</div>
<div class="cal_I" style="clear:left">
<div class="cal_I_cover" id="Gpb_I_cover_7" style="width:580px; height:44px">
</div>
<label class="small_label">技能攻击力系数:</label><br/>
<label class="small_label">填入技能加成百分数(如15%则填入15),若无则填入0:</label>
<input id="TBox_I_skill" type="text" style="width:44px" onpaste="return false;" onchange="TBox_I_TextChanged('skill')" onkeypress="checkisnum()"/>
<label class="small_label" style=" font-size:16px;font:'Times New Roman', Times, serif">=></label>
<label id="lbl_I_skill_result" class="small_label">0000</label>
<br/>
</div>
<div class="cal_I">
<div class="cal_I_cover" id="Gpb_I_cover_8" style="width:580px; height:44px">
</div>
<label class="small_label">暴击系数:</label><br/>
<label class="small_label">填入技能提供的额外暴击伤害的百分数,若无则填入0:</label>
<input id="TBox_I_crit" type="text" style="width:44px" onpaste="return false;" onchange="TBox_I_TextChanged('crit')" onkeypress="checkisnum()"/>
<label class="small_label" style=" font-size:16px;font:'Times New Roman', Times, serif">=></label>
<label id="lbl_I_crit_result" class="small_label">0000</label>
<br/>
</div>
<div class="cal_I">
<div class="cal_I_cover" id="Gpb_I_cover_9" style="width:580px; height:40px">
</div>
<label class="small_label">浮动系数:</label><br/>
<label class="small_label" style="float:left">当前攻击类型下的浮动系数:</label>
<label id="lbl_I_float_result" class="small_label" style="display:block;width:240px; float:left">0000</label>
<label for="ChkBox_usesuperhvyshell"class="mini_label" style=" margin:10px;"><input type="checkbox" id="ChkBox_usesuperhvyshell" name="ChkBox_usesuperhvyshell" style="vertical-align: top;" onclick="ChkBox_usesuperhvyshell_CheckedChanged()"/>装备了超重弹</label>
<br/>
</div>
</div>
<div class="rightbox">
<label>4.输入其它参数:</label><br/>
<div class="other_I">
<div>
<label class="small_label">(1)敌方装甲:</label><input id="TBox_armor" type="text" style="width:44px" onkeypress="checkisnum()" onpaste="return false;" onchange="TBox_Other_TextChanged('armor')"/>
<label class="small_label">(2)敌方血量:</label><input id="TBox_enemyhp" type="text" style="width:80px" onkeypress="checkisnum()" onpaste="return false;" onchange="TBox_Other_TextChanged('enemyhp')"/>
</div>
<div>
<label class="small_label">(3)输入技能伤害倍率百分数:</label><input id="TBox_skill" type="text" style="width:44px" onkeypress="checkisnum()" onpaste="return false;" onchange="TBox_Other_TextChanged('skill')"/>
<label class="small_label" style=" font-size:16px;font:'Times New Roman', Times, serif">=></label>
<label id="lbl_skill_result" class="small_label">0000</label>
</div>
<div>
<label class="small_label" style="float:left; position:relative; top:2px">(4)额外的穿甲系数百分数,当前值:</label><label id="lbl_pene" class="small_label" style="float:left;display:block;width:40px;text-align:center;position:relative; top:2px">0.6</label>
<input id="TBox_pene" type="text" style="width:44px" onpaste="return false;" onkeypress="checkisnum()" onchange="TBox_Other_TextChanged('pene')"/>
<label class="small_label" style=" font-size:16px;font:'Times New Roman', Times, serif;">=></label>
<label id="lbl_pene_result" class="small_label" >0000</label>
</div>
</div>
<hr />
</div>
<div class="rightbox" >
<button type="button" class="button" style="width:100%" onclick="btn_click()">开始计算</button>
</div>
<div class="rightbox">
<textarea id="RTBox_result" style="width:100%;height:675px;word-wrap:normal; font-family:宋体;font-size:14px;" readonly="readonly"></textarea>
</div>
</div>
</form>
<script type="text/javascript">
var VERSION="v1.3-web"; //版本号
//
var D_BATK = 0; //基础攻击力
var D_BATK_V1 = 0;
var D_BATK_V2 = 0;
var D_BATK_V3 = 0;
var D_BATK_V4 = 0;
var D_BATK_V5 = 0; //炮击(航母系)系数α
//各种系数
var D_I_tmp = 1; //临时存放的系数,是除了阵形、航向和浮动系数以外的系数的乘积
var D_I_formation = [0,0,0,0]; //阵形
var D_I_direction = [0,0,0]; //航向
var D_I_airdomain = 1; //制空
var D_I_sonar = 1; //声纳
var D_I_sonar_raw = 0; //声纳装备的反潜值
var D_I_tb = 1; //鱼雷机系数
var D_I_ammo = 1; //系数
var D_I_ammo_raw = 120; //弹药百分数
var D_I_sufferdmg = 1; //战损
var D_I_float = 1; //浮动系数
var D_I_crit = 1; //暴击系数
const C_I_is_crit = 1.5; //默认暴击为1.5
var D_I_crit_add = 0; //额外的暴击百分数
var D_I_skill = 1; //技能加成系数
var D_I_skill_add = 0; //技能加成系数的百分数
var D_I_pene = 1; //穿甲系数
var D_I_pene_add = 0; //额外的穿甲系数
var D_I_usesuperheavyshell = [0.89, 1.18, 1.47]; //使用了超重弹后的浮动系数
var D_I_enemyarmordecreasedamage = 0; //敌方装甲减伤系数:该系数只在导弹战(开幕)中生效。
//
var D_armor = 0; //装甲值
var D_skill = 1; //技能伤害倍率
var D_skill_add = 0; //额外的技能伤害倍率
var D_enemyhp = 0; //敌舰hp
//
var Dict_atktype= ["航空战(轰炸机)", "航空战(鱼雷机)", "昼战反潜(轻母航战)", "昼战反潜(驱逐巡洋)", "昼战炮击(航母系)", "昼战炮击(其他)", "昼战雷击", "夜战雷击", "夜战巡洋舰炮雷合击", "夜战巡洋舰炮击", "夜战其他炮击", "导弹战", "夜战导弹"]; //攻击类型
var Dict_I_sonar = [0.5, 1]; //声纳系数
var Dict_I_sufferdmg = [1, 0.6, 0.3]; //舰损系数:非中破,中破,大破/击沉
var Dict_I_airdomain = [1.1, 1.05, 1, 0.95, 0.9]; //制空系数:空占,空优,势均力敌,空劣,空丧
var Dict_I_formation = [ //阵形系数:分别[导弹战(开幕)、炮击(非航母)],[雷击],[夜战]和[无影响]
[1.0, 0.8, 0.75, 1.0, 0.8],
[1.0, 0.9, 0.8, 1.0, 0.8],
[1.1, 0.9, 1.0, 1.0, 1.0],
[1.0, 1.0, 1.0, 1.0, 1.0]
];
var Dict_I_direction = [ //航向系数:第一组为通常情况,T有利,同航战,反航战,T不利;第二组为无影响的情况
[1.15, 1.0, 0.8, 0.65],
[1.0, 1.0, 1.0, 1.0]
];
var Dict_name_direction = ["T有利", "同航战", "反航战", "T不利"];
var Dict_name_condition = ["未暴击下限", "未暴击平均", "未暴击上限", "暴击下限", "暴击平均", "暴击上限", "未暴击", "暴击"];
//
var Dict_atktype_enable_BATK = [ //决定要启用哪些变量来计算基础攻击力
[1, 1, 0, 0, 0], //航空战(轰炸机)
[1, 1, 0, 0, 0], //航空战(鱼雷机)
[1, 0, 0, 0, 0], //昼战反潜(轻母航战)
[1, 1, 0, 0, 0], //昼战反潜(驱逐巡洋)
[1, 1, 1, 1, 1], //昼战炮击(航母系)
[1, 0, 0, 0, 0], //昼战炮击(其他)
[1, 0, 0, 0, 0], //昼战雷击
[1, 0, 0, 0, 0], //夜战雷击
[1, 1, 0, 0, 0], //夜战巡洋舰炮雷合击
[1, 0, 0, 0, 0], //夜战巡洋舰炮击
[1, 0, 0, 0, 0], //夜战其他炮击
[1, 1, 1, 0, 0], //导弹战
[1, 1, 1, 0, 0] //夜战导弹
];
var Dict_atktype_label = [ //基础攻击力的标签说明
["放飞机数:", "该格轰炸:", "不可用", "不可用", "不可用"], //航空战(轰炸机)
["放飞机数:", "该格鱼雷:", "不可用", "不可用", "不可用"], //航空战(鱼雷机)
["舰船对潜:", "不可用", "不可用", "不可用", "不可用"], //昼战反潜(轻母航战)
["舰船对潜:", "深弹对潜:", "不可用", "不可用", "不可用"], //昼战反潜(驱逐巡洋)
["火力:", "轰炸:", "鱼雷:", "对方总对空值:", "系数α(0~1):"], //昼战炮击(航母系)
["火力:", "不可用", "不可用", "不可用", "不可用"], //昼战炮击(其他)
["鱼雷:", "不可用", "不可用", "不可用", "不可用"], //昼战雷击
["鱼雷:", "不可用", "不可用", "不可用", "不可用"], //夜战雷击
["火力:", "鱼雷:", "不可用", "不可用", "不可用"], //夜战巡洋舰炮雷合击
["火力:", "不可用", "不可用", "不可用", "不可用"], //夜战巡洋舰炮击
["火力:", "不可用", "不可用", "不可用", "不可用"], //夜战其他炮击
["舰船火力:", "发射器火力:", "单格导弹火力:", "不可用", "不可用"], //导弹战
["舰船火力:", "发射器火力:", "单格导弹火力:", "不可用", "不可用"] //夜战导弹
];
//决定要启用哪些系数
//1阵形 2航向 3制空 4声纳 5弹药 6鱼雷机 7舰损 8技能攻击力 9暴击 10浮动
// 1 2 3 4 5 6 7 8 9 10
var Dict_atktype_enable_I = [
[0, 0, 1, 0, 1, 0, 1, 1, 1, 1], //航空战(轰炸机)
[0, 0, 1, 0, 1, 1, 1, 1, 1, 1], //航空战(鱼雷机)
[0, 0, 0, 1, 1, 0, 0, 1, 1, 1], //昼战反潜(轻母航战
[0, 0, 0, 1, 1, 0, 1, 1, 1, 1], //昼战反潜(驱逐巡洋)
[0, 0, 1, 0, 1, 0, 0, 1, 1, 1], //昼战炮击(航母系)
[1, 1, 0, 0, 1, 0, 1, 1, 1, 1], //昼战炮击(其他)
[1, 1, 0, 0, 1, 0, 1, 1, 1, 1], //昼战雷击
[1, 0, 0, 0, 1, 0, 1, 1, 1, 1], //夜战雷击
[1, 0, 0, 0, 1, 0, 1, 1, 1, 1], //夜战巡洋舰炮雷合击
[1, 0, 0, 0, 1, 0, 1, 1, 1, 1], //夜战巡洋舰炮击
[1, 0, 0, 0, 1, 0, 1, 1, 1, 1], //夜战其他炮击
[1, 0, 0, 0, 0, 0, 1, 1, 1, 1], //导弹战
[1, 0, 0, 0, 0, 0, 1, 1, 1, 1] //夜战导弹
];
//系数的结果表,分别是:未暴击下限,未暴击平均,未暴击上限;暴击下限,暴击平均,暴击上限;横向为阵形,纵向为航向
var Dict_I_result = [
[ //未暴击下限
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0]
],
[ //未暴击平均
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0]
],
[ //未暴击上限
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0]
],
[ //暴击下限
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0]
],
[ //暴击平均
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0]
],
[ //暴击上限
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0]
]
];
var Dict_I_result_tmp = [0, 0, 0, 0, 0, 0]; //存放临时系数,是浮动值的上下限和平均值与暴击系数的乘积
var Dict_ATK_result = [ //实际攻击力
[ //未暴击下限
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0]
],
[ //未暴击平均
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0]
],
[ //未暴击上限
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0]
],
[ //暴击下限
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0]
],
[ //暴击平均
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0]
],
[ //暴击上限
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0]
]
];
var Dict_penedmg_result = [ //穿甲伤害
[ //未暴击下限
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0]
],
[ //未暴击平均
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0]
],
[ //未暴击上限
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0]
],
[ //暴击下限
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0]
],
[ //暴击平均
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0]
],
[ //暴击上限
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0]
]
];
var Dict_I_pene = [ //不同攻击类型的穿甲系数表
1.0, //航空战(轰炸机)
2.0, //航空战(鱼雷机)
2.0, //昼战反潜(轻母航战)
2.0, //昼战反潜(驱逐巡洋)
1.0, //昼战炮击(航母系)
0.6, //昼战炮击(其他)
1.0, //昼战雷击
1.0, //夜战雷击
1.0, //夜战巡洋舰炮雷合击
0.6, //夜战巡洋舰炮击
0.6, //夜战其他炮击
0.9, //导弹战
0.9 //夜战导弹
];
var Dict_Percent_cansunk = [ //击沉率结果表
[ //未暴击
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0]
],
[ //暴击
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0]
]
];
var Dict_Percent_middmg = [ //中破率结果表
[ //未暴击
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0]
],
[ //暴击
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0]
]
];
var Dict_Percent_hvydmg = [ //大破率结果表
[ //未暴击
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0]
],
[ //暴击
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0]
]
];
var Dict_I_float;
//页面加载时运行
Load_floattable();
for (var i=0;i<Dict_atktype.length;i++){ //加载攻击类型下拉框
var getData = Dict_atktype[i];
document.getElementById("CMB_atktype").options.add(new Option(getData,i));
};
CMB_atktype_changed();
TBox_I_TextChanged('ammo');
TBox_I_TextChanged('skill');
TBox_I_TextChanged('crit');
document.getElementById("TBox_armor").value="0";
document.getElementById("TBox_skill").value="0";
document.getElementById("TBox_enemyhp").value="10";
TBox_Other_TextChanged('armor');
TBox_Other_TextChanged('enemyhp');
TBox_Other_TextChanged('skill');
TBox_Other_TextChanged('pene');
//
function Load_floattable(){ //加载浮动系数表
Dict_I_float = [ //浮动系数表
//下限, 平均, 上限
[0.89, 1.055, 1.22], //航空战(轰炸机)
[0.89, 1.055, 1.22], //航空战(鱼雷机)
[0.89, 1.055, 1.22], //昼战反潜(轻母航战)
[0.89, 1.055, 1.22], //昼战反潜(驱逐巡洋)
[0.89, 1.055, 1.22], //昼战炮击(航母系)
[0.89, 1.055, 1.22], //昼战炮击(其他)
[0.89, 1.055, 1.22], //昼战雷击
[2.4, 2.7, 3.0], //夜战雷击
[1.2, 1.5, 1.8], //夜战巡洋舰炮雷合击
[2.4, 3.0, 3.6], //夜战巡洋舰炮击
[1.2, 1.5, 1.8], //夜战其他炮击
[0.89, 1.055, 1.22], //导弹战
[1.2, 1.35, 1.5] //夜战导弹
];
}
//
function CMB_atktype_changed(){ //下拉列表选择项改变后
var index=document.getElementById("CMB_atktype").selectedIndex;
select_val_to_cal_BATK(index); //根据攻击类型来设置要输入的变量V1~V5
show_BATK_formula_and_calculate(index);//显示基础攻击力计算公式并计算
show_I_formula(index);//显示系数计算公式
show_I_float(index);//显示浮动系数
show_I_pene(index);//显示穿甲系数
select_I_val(index);//根据攻击类型来设置要使用的系数,并初始化系数的值
};
//
////////////////////////////////////////////////////////////////////////////
function check_set_BATK_Vn(index){ //处理基础攻击力输入
var tboxid = "TBox_BATK_V" + index;
if ( document.getElementById(tboxid).value != "" ) {
switch (index)
{
case 1:
D_BATK_V1 = document.getElementById(tboxid).value;
break;
case 2:
D_BATK_V2 = document.getElementById(tboxid).value;
break;
case 3:
D_BATK_V3 = document.getElementById(tboxid).value;
break;
case 4:
D_BATK_V4 = document.getElementById(tboxid).value;
break;
case 5:
var num = Number(document.getElementById(tboxid).value); //限制系数α的范围为0~1
if (num > 1) {
document.getElementById(tboxid).value = "1";
}
if (num < 0) {
document.getElementById(tboxid).value = "0";
}
D_BATK_V5 = document.getElementById(tboxid).value;
break;
}
show_BATK_formula_and_calculate(document.getElementById("CMB_atktype").selectedIndex); //计算基础攻击力
}
};
function TBox_I_TextChanged(name){ //处理乘积系数的输入
var tboxid = "TBox_I_" + name;
if ( document.getElementById(tboxid).value != "" ) {
switch (name)
{
case "sonar":
D_I_sonar_raw = document.getElementById(tboxid).value;
break;
case "ammo":
D_I_ammo_raw = document.getElementById(tboxid).value;
I_ammo_cal();
break;
case "tb":
var num = Number(document.getElementById(tboxid).value); //限制鱼雷机系数的范围为0.5~1
if (num > 1) {
document.getElementById(tboxid).value = "1";
};
if (num < 0.5) {
document.getElementById(tboxid).value = "0.5";
};
D_I_tb = document.getElementById(tboxid).value;
break;
case "skill":
D_I_skill_add = document.getElementById(tboxid).value;
I_skill_cal();
break;
case "crit":
D_I_crit_add = document.getElementById(tboxid).value;
I_crit_cal();
break;
}
show_I_formula(document.getElementById("CMB_atktype").selectedIndex);
}
};
function Rdb_I_airdomainN_CheckedChanged(index){ //根据所选radio来设置制空系数变量
D_I_airdomain = Dict_I_airdomain[index];
show_I_formula(document.getElementById("CMB_atktype").selectedIndex);
};
function Rdb_I_sufferdmgN_CheckedChanged(index){ //根据所选radio来设置舰损系数
D_I_sufferdmg = Dict_I_sufferdmg[index];
show_I_formula(document.getElementById("CMB_atktype").selectedIndex);
};
function ChkBox_usesuperhvyshell_CheckedChanged(){ //使用超重弹后更改浮动系数
var index = document.getElementById("CMB_atktype").selectedIndex;
if (document.getElementById("ChkBox_usesuperhvyshell").checked==true) {
Dict_I_float[index][0] = D_I_usesuperheavyshell[0];
Dict_I_float[index][1] = D_I_usesuperheavyshell[1];
Dict_I_float[index][2] = D_I_usesuperheavyshell[2];
show_I_float(index);
}
else {
Load_floattable();
show_I_float(index);
}
};
function TBox_Other_TextChanged(name){ //处理其他参数的输入
var tboxid = "TBox_" + name;
if ( document.getElementById(tboxid).value != "" ) {
switch (name)
{
case "armor":
D_armor = document.getElementById(tboxid).value;
break;
case "enemyhp":
D_enemyhp = document.getElementById(tboxid).value;
break;
case "skill":
D_skill_add = document.getElementById(tboxid).value;
skill_cal();
break;
case "pene":
D_I_pene_add = document.getElementById(tboxid).value;
pene_cal(document.getElementById("CMB_atktype").selectedIndex);
break;
}
}
};
function checkisnum() { //检查是否为数字,只允许输入数字
if (event.keyCode < 47 || event.keyCode > 57) {
event.returnValue = false;
}
};
function checkisnum2() { //只允许输入数字和小数点
if (event.keyCode < 46 || event.keyCode > 57) {
event.returnValue = false;
}
};
////////////////////////////////////////////////////////////////////////////
//
function select_val_to_cal_BATK(CMB_atktype_i){ //根据攻击类型来设置要输入的变量
for (var i =0;i<Dict_atktype_enable_BATK[0].length;i++){
var id = i + 1;
var tboxid = "TBox_BATK_V" + id;
var labelid = "lbl_BATK_V" + id;
if (Dict_atktype_enable_BATK[CMB_atktype_i][i] == 0) {
document.getElementById(tboxid).disabled=true; //禁用用不到的input
}
else if (Dict_atktype_enable_BATK[CMB_atktype_i][i] == 1) {
document.getElementById(tboxid).disabled=false; //启用相关的input
}
//设置label的文字
document.getElementById(labelid).innerText = Dict_atktype_label[CMB_atktype_i][i];
}
clear_val_BATK();//每更换一次攻击类型,就清空变量的值
// alert(CMB_atktype_i);
};
function clear_val_BATK(){ //清空变量的值
document.getElementById("lbl_BATK_result").innerText = "";
D_BATK = 0;
D_BATK_V1 = 0;
D_BATK_V2 = 0;
D_BATK_V3 = 0;
D_BATK_V4 = 0;
D_BATK_V5 = 0;
document.getElementById("TBox_BATK_V1").value = "0";
document.getElementById("TBox_BATK_V2").value = "0";
document.getElementById("TBox_BATK_V3").value = "0";
document.getElementById("TBox_BATK_V4").value = "0";
document.getElementById("TBox_BATK_V5").value = "0";
};
function show_BATK_formula_and_calculate(CMB_atktype_i){ //计算公式可视化
document.getElementById("lbl_formula").innerText = "";
switch (CMB_atktype_i)
{
case 0: //航空战(轰炸机):LN(剩余机数 + 1) * 2 * 该格轰炸 + 25
document.getElementById("lbl_formula").innerText = "ln( " + D_BATK_V1 + " + 1 ) × 2 × " + D_BATK_V2 + " + 25";
BATK_Cal(0);
break;
case 1: //航空战(鱼雷机):LN(剩余机数 + 1) * 2 * 该格鱼雷 + 25
document.getElementById("lbl_formula").innerText = "ln( " + D_BATK_V1 + " + 1 ) × 2 × " + D_BATK_V2 + " + 25";
BATK_Cal(1);
break;
case 2: //反潜(轻母航战): 舰船对潜 / 3 + 30
document.getElementById("lbl_formula").innerText = D_BATK_V1 + " ÷ 3 + 30";
BATK_Cal(2);
break;
case 3: //反潜(驱逐巡洋):舰船对潜 / 3 + 深弹对潜 * 1.3 + 30 (有深弹); 舰船对潜 / 3 (无深弹)
if (parseInt(document.getElementById("TBox_BATK_V2").value)==0){ //自动区分有无深弹
document.getElementById("lbl_formula").innerText = D_BATK_V1 + " ÷ 3";
BATK_Cal(30);
}
else {
document.getElementById("lbl_formula").innerText = D_BATK_V1 + " ÷ 3 + " + D_BATK_V2 + " × 1.3 + 30";
BATK_Cal(31);
}
break;
case 4: //炮击(航母系):(火力 + 轰炸 * 2 + 鱼雷) * MAX(0, 1 - 对方总对空值 * α / 150) + 35
document.getElementById("lbl_formula").innerText = "( " + D_BATK_V1 + " + " + D_BATK_V2 + " × 2 + " + D_BATK_V3 + " ) × MAX( 0 , 1 - " + D_BATK_V4 + " × " + D_BATK_V5 + " ÷ 150 ) + 35";
BATK_Cal(4);
break;
case 5: //炮击(其他):火力 + 5
document.getElementById("lbl_formula").innerText = D_BATK_V1 + " + 5";
BATK_Cal(5);
break;
case 6: //雷击:鱼雷 + 5
document.getElementById("lbl_formula").innerText = D_BATK_V1 + " + 5";
BATK_Cal(6);
break;
case 7: //夜战雷击:鱼雷 + 10
document.getElementById("lbl_formula").innerText = D_BATK_V1 + " + 10";
BATK_Cal(7);
break;
case 8: //夜战巡洋舰炮雷合击:火力 + 鱼雷 + 10
document.getElementById("lbl_formula").innerText = D_BATK_V1 + " + " + D_BATK_V2 + " + 10";
BATK_Cal(8);
break;
case 9: //夜战巡洋舰炮击:火力 + 10
document.getElementById("lbl_formula").innerText = D_BATK_V1 + " + 10";
BATK_Cal(9);
break;
case 10: //夜战其他炮击:火力 + 10
document.getElementById("lbl_formula").innerText = D_BATK_V1 + " + 10";
BATK_Cal(10);
break;
case 11: //导弹战:舰船裸火力 + 发射器火力 + 导弹火力 * 3 每格导弹单独计算不叠加
document.getElementById("lbl_formula").innerText = D_BATK_V1 + " + " + D_BATK_V2 + " + " + D_BATK_V3 + " × 3"
BATK_Cal(11);
break;
case 12: //夜战导弹:舰船裸火力 + 发射器火力 + 导弹火力 * 3 每格导弹单独计算不叠加
document.getElementById("lbl_formula").innerText
BATK_Cal(12);
break;
}
};
function BATK_Cal(CMB_atktype_i){ //计算基础攻击力
document.getElementById("lbl_BATK_result").innerText = "";
switch (CMB_atktype_i)
{
case 0: //航空战(轰炸机)
D_BATK = Math.log(Number(D_BATK_V1) + 1) * 2 * Number(D_BATK_V2) + 25;
break;
case 1: //航空战(鱼雷机)
D_BATK = Math.log(Number(D_BATK_V1) + 1) * 2 * Number(D_BATK_V2) + 25;
break;
case 2: //反潜(轻母航战)
D_BATK = Number(D_BATK_V1) / 3 + 30;
break;
case 30: //反潜(驱逐巡洋)无深弹
D_BATK = Number(D_BATK_V1) / 3;
break;
case 31: //反潜(驱逐巡洋)有深弹
D_BATK = Number(D_BATK_V1) / 3 + Number(D_BATK_V2) * 1.3 + 30;
break;
case 4: //炮击(航母系)
D_BATK = (Number(D_BATK_V1) + Number(D_BATK_V2) * 2 + Number(D_BATK_V3)) * Math.max(0, (1 - Number(D_BATK_V4) * Number(D_BATK_V5) / 150)) + 35
break;
case 5: //炮击(其他)
D_BATK = Number(D_BATK_V1) + 5;
break;
case 6: //雷击
D_BATK = Number(D_BATK_V1) + 5;
break;
case 7: //夜战雷击
D_BATK = Number(D_BATK_V1) + 10;
break;
case 8: //夜战巡洋舰炮雷合击
D_BATK = Number(D_BATK_V1) + Number(D_BATK_V2) + 10;
break;
case 9: //夜战巡洋舰炮击
D_BATK = Number(D_BATK_V1) + 10;
break;
case 10: //夜战其他炮击
D_BATK = Number(D_BATK_V1) + 10;
break;
case 11: //导弹战
D_BATK = Number(D_BATK_V1) + Number(D_BATK_V2) + Number(D_BATK_V3) * 3;
break;
case 12: //夜战导弹
D_BATK = Number(D_BATK_V1) + Number(D_BATK_V2) + Number(D_BATK_V3) * 3;
break;
}
document.getElementById("lbl_BATK_result").innerText = D_BATK;
};
//////////////////////////////////////////////////////////////////////////////////
function show_I_formula(CMB_atktype_i){ //显示系数计算公式,并计算部分系数
document.getElementById("lbl_I_formula").innerText = "";
switch (CMB_atktype_i)
{
case 0: //航空战(轰炸机)
document.getElementById("lbl_I_formula").innerText = "制空系数 × 弹药系数 × 舰损系数 × 浮动系数 × 暴击系数 × 技能攻击力系数";
D_I_tmp = Number(D_I_airdomain) * Number(D_I_ammo) * Number(D_I_sufferdmg) * Number(D_I_skill);
break;
case 1: //航空战(鱼雷机)
document.getElementById("lbl_I_formula").innerText = "鱼雷机系数 × 制空系数 × 弹药系数 × 舰损系数 × 浮动系数 × 暴击系数 × 技能攻击力系数";
D_I_tmp = Number(D_I_tb) * Number(D_I_airdomain) * Number(D_I_ammo) * Number(D_I_sufferdmg) * Number(D_I_skill);
break;
case 2: //反潜(轻母航战)
document.getElementById("lbl_I_formula").innerText = "声呐系数 × 弹药系数 × 浮动系数 × 暴击系数 × 技能攻击力系数";
I_sonar_cal(0);
document.getElementById("lbl_I_sonar_result").innerText = "1 + 声呐反潜值 ÷ 15 = " + D_I_sonar.toFixed(3);
D_I_tmp = Number(D_I_sonar) * Number(D_I_ammo) * Number(D_I_skill);
break;
case 3: //反潜(驱逐巡洋)
document.getElementById("lbl_I_formula").innerText = "声呐系数 × 弹药系数 × 舰损系数 × 浮动系数 × 暴击系数 × 技能攻击力系数";
I_sonar_cal(1);
document.getElementById("lbl_I_sonar_result").innerText = "1 + 声呐反潜值 ÷ 10 = " + D_I_sonar.toFixed(3);
D_I_tmp = Number(D_I_sonar) * Number(D_I_ammo) * Number(D_I_sufferdmg) * Number(D_I_skill);
break;
case 4: //炮击(航母系)
document.getElementById("lbl_I_formula").innerText = "制空系数 × 弹药系数 × 浮动系数 × 暴击系数 × 技能攻击力系数";
D_I_tmp = Number(D_I_airdomain) * Number(D_I_ammo) * Number(D_I_skill);
break;
case 5: //炮击(其他)
document.getElementById("lbl_I_formula").innerText = "阵型系数 × 航向系数 × 弹药系数 × 舰损系数 × 浮动系数 × 暴击系数 × 技能攻击力系数";
D_I_tmp = Number(D_I_ammo) * Number(D_I_sufferdmg) * Number(D_I_skill);
break;
case 6: //雷击
document.getElementById("lbl_I_formula").innerText = "阵型系数 × 航向系数 × 弹药系数 × 舰损系数 × 浮动系数 × 暴击系数 × 技能攻击力系数";
D_I_tmp = Number(D_I_ammo) * Number(D_I_sufferdmg) * Number(D_I_skill);
break;
case 7:
case 8:
case 9:
case 10: //7,8,9,10,夜战
document.getElementById("lbl_I_formula").innerText = "阵型系数 × 弹药系数 × 舰损系数 × 浮动系数 × 暴击系数 × 技能攻击力系数";
D_I_tmp = Number(D_I_ammo) * Number(D_I_sufferdmg) * Number(D_I_skill);
break;
case 11: //导弹战
document.getElementById("lbl_I_formula").innerText = "阵型系数 × 舰损系数 × 浮动系数 × 暴击系数 × 敌方装甲减伤系数 × 技能攻击力系数";
D_I_tmp = Number(D_I_sufferdmg) * Number(D_I_skill);
break;
case 12: //夜战导弹
document.getElementById("lbl_I_formula").innerText = "阵型系数 × 舰损系数 × 浮动系数 × 暴击系数 × 技能攻击力系数";
D_I_tmp = Number(D_I_sufferdmg) * Number(D_I_skill);
break;
}
};
function I_sonar_cal(TYPE) { //声纳系数的计算
switch (TYPE)
{
case 0: //反潜(轻母航战)的声纳系数的计算
D_I_sonar = 1 + Number(D_I_sonar_raw) / 15;
break;
case 1: //反潜(驱逐巡洋)的声纳系数的计算
D_I_sonar = 1 + Number(D_I_sonar_raw) / 10;
break;
}
};
function show_I_float(CMB_atktype_i) { //显示浮动系数
document.getElementById("lbl_I_float_result").innerText = Dict_I_float[CMB_atktype_i][0] + " ~ " + Dict_I_float[CMB_atktype_i][2] + " , 平均值为: " + Dict_I_float[CMB_atktype_i][1];
};
function show_I_pene(CMB_atktype_i) { //显示基础穿甲系数
document.getElementById("lbl_pene").innerText = Dict_I_pene[CMB_atktype_i];
pene_cal(CMB_atktype_i);
};
function I_ammo_cal(){ //计算弹药系数
D_I_ammo = Math.min(1, (Number(D_I_ammo_raw) / 100 * 2));
document.getElementById("lbl_I_ammo_result").innerText = "MIN(1, 当前弹药比例 × 2) = " + D_I_ammo.toFixed(3);
};
function I_crit_cal(){ //计算暴击伤害系数