forked from fedorablewill/ptu-toolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
host.php
1066 lines (935 loc) · 49.8 KB
/
host.php
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>
<html>
<head>
<!--
$.getJSON("/api/v1/generate", {"habitat": "Grassland", "min_level": 12, "max_level": 14}, function (data){gm_data["Pokémon"][generatePmonId()] = data});
-->
<title>PTU Battle Viewer</title>
<link href='http://fonts.googleapis.com/css?family=Roboto:500,900italic,900,400italic,100,700italic,300,700,500italic,100italic,300italic,400' rel='stylesheet' type='text/css'>
<link href="https://fonts.googleapis.com/css?family=Roboto+Mono:300,400,500,700" rel="stylesheet">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css" rel="stylesheet">
<!-- Bootstrap Material Design -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="dist/snackbar.min.css" rel="stylesheet">
<link href="css/material-kit.css" rel="stylesheet">
<style>
/* TODO: move to single css file */
body {
background:
url('img/pixel-art-pokemon-wallpaper-2.jpg')
no-repeat fixed center bottom;
background-size: cover !important;
color: white;
padding-bottom: 500px;
}
nav .btn {
margin: 0;
}
.navbar-gmid {
margin-top: 10px;
}
.content-init input {
color: white;
}
#battle-message {
text-shadow: #444 0px 0px 8px;
}
#battle-actions h3 {
font-family: "Roboto Mono", "Roboto", "Helvetica", "Arial", sans-serif;
font-weight: 500;
text-shadow: #444 1px 1px 6px;
}
#battle-actions .battle-dialog {
font-family: "Roboto Mono", "Roboto", "Helvetica", "Arial", sans-serif;
color: #333;
margin-top: 15px;
padding: 10px 10px 5px 10px;
background-color: rgba(0, 0, 0, 0);
background-image: linear-gradient(60deg, rgb(248, 248, 248), rgb(239, 239, 239));
border-radius: 4px;
border: #888 solid 3px;
text-shadow: none;
}
#battle-actions .battle-dialog p:not(:first-child){
text-align: left;
}
#battle-actions h2, #battle-actions h3, #battle-actions h4, #battle-actions h5, #battle-actions h6 {
margin-top: 5px;
}
#battle-help {
background: linear-gradient(60deg, #ef5350, #d32f2f);
font-weight: 400;
color: #FFF;
padding: 10px;
}
.battle-slider {
width: 300px;
max-width: calc(100% - 45px);
}
.battle-slider label {
color: #f44336;
}
.battle-slider .slider, .battle-slider .noUi-origin {
background: #f0f0f0;
}
.progress-bar-injuries {
background-color: #9a9595;
}
.card-battle .content {
padding: 15px 45px;
}
.grid-row {
display: flex;
}
.grid-piece {
position: relative;
}
.grid{
display: none;
background-color: #fcfcfc;
border: 1px solid rgb(142, 142, 142);
}
.pokemon {
color: #4f4f4f;
}
.pokemon .progress {
height: 8px;
background: #bababa;
}
.char-name {
vertical-align: middle;
display: inline-block;
height: fit-content;
}
.char-entry {
margin: 5px 0;
}
.char-entry .btn-group-vertical {
margin: 5px 1px;
}
.effects {
padding-bottom: 10px;
min-height: 20px;
}
#data1, #data2, #data3, #data4 {
display: none;
}
.btn-move {
text-align: left;
width: 100%;
background-color: #FFFFFF;
white-space: normal;
}
#stages input {
width: 50px;
}
.togglebutton input {
width: 10px !important;
}
.togglebutton label {
color: inherit;
font-weight: 300;
}
input, select, button:not(.btn) {
color: #000000;
}
.content-generator {
margin-top: 300px;
}
.edit-pokemon {
text-align: left;
}
.edit-pokemon img {
height: 50px;
}
footer.footer-gm {
position: fixed;
bottom: 0;
width: 100%;
background-color: #f44336;
color: rgba(255,255,255,.84);
text-align: center;
padding: 0;
}
.footer-gm .btn-default {
color: #FFFFFF !important;
}
.modal-body {
color: #0f0f0f;
}
.ui-autocomplete {
z-index: 1500 !important;
}
.input-group {
width: 100%;
}
.has-btn-sm {
width: calc(100% - 50px);
}
.input-enable .checkbox {
display: inline-block;
margin-right: 15px;
}
.input-enable .form-group {
display: inline-block;
width: calc(100% - 50px);
}
.collapse-form {
margin-left: 5px;
padding-left: 10px;
border-left: solid rgb(238, 238, 238) 1px;
}
.help {
font-size: 15px;
margin-right: 5px;
}
.form-genmon {
text-align: left;
}
.form-genmon h3,h4 {
text-align: center;
}
.togglebutton label input[type=checkbox]:checked + .toggle {
background-color: rgba(244, 67, 54, 0.7);
}
.togglebutton label input[type=checkbox]:checked + .toggle:after {
border-color: #f44336;
}
.checkbox input[type=checkbox]:checked + .checkbox-material .check {
background: #f44336;
}
.form-group.is-focused .form-control {
outline: none;
background-image: linear-gradient(#f44336, #f44336), linear-gradient(#D2D2D2, #D2D2D2);
}
.form-group.is-focused label, .form-group.is-focused label.control-label {
color: #f44336;
}
.snackbar {
background-color: #0ab1fc;
color: #ffffff;
border: 0;
border-radius: 0;
padding: 20px 15px;
line-height: 20px;
}
.snackbar-container {
padding-bottom: 65px;
}
.snackbar:not(.snackbar-opened) {
z-index: -200;
display: none;
}
.ui-autocomplete {
height: 150px;
overflow-y: scroll;
}
</style>
</head>
<body>
<nav class="navbar navbar-danger">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" href="javascript:void(0)">PTU GM's Tools</a>
</div>
<div>
<div class="navbar-right navbar-gmid">
<strong>GM ID:</strong> <span id="display-gmid"></span>
<button class="btn btn-sm btn-white btn-simple btn-just-icon" data-toggle="modal" data-target="#modalShare">
<i class="material-icons">share</i>
</button>
</div>
</div>
</div>
</nav>
<input id = "uploadAnchor" type="file" style="display: none"/>
<a id="downloadAnchor" style="display:none"></a>
<div class="container">
<div id="view-holder">
<div class="col-md-6 col-md-offset-3 content-select">
<h2>Create or Import a GM File</h2>
<button class="btn btn-danger btn-raised" onclick="newCampaign();">Create Blank GM File</button>
<br>
<button class="btn btn-danger btn-raised" onclick="uploadCampaign();">Upload Existing GM File</button>
</div>
<div class="col-md-6 col-md-offset-3 pokemon"></div>
</div>
<div class="hidden" id="body-prebattle">
<button class="btn btn-danger btn-lg" data-toggle="modal" data-target="#modalNewBattle">New Battle</button>
</div>
<div class="hidden" id="body-battle">
<div class="row">
<div class="col-sm-3" id="battle-actions">
<div id="battle-message" class="text-center">
<img src="img/eevee_waving_by_kittycateevee-d9ex8gh.png" height="100" />
<h3 class="text-danger">WELCOME</h3>
<h4>We're glad you're here!</h4>
</div>
<hr/>
<div id="battle-help" class="text-center card">
<h6>NEED HELP?</h6>
<a class="text-info" href="https://github.com/absorr/ptu-toolkit/wiki/Tutorial-&-FAQ" target="_blank">Tutorial & FAQs</a>
<br/>
<a class="text-info" href="https://github.com/absorr/ptu-toolkit/issues" target="_blank">Bug/Issue Reporting</a>
</div>
</div>
<div class="col-sm-9">
<div class="card card-battle card-nav-tabs">
<div class="header header-danger">
<div class="nav-tabs-navigation">
<div class="nav-tabs-wrapper">
<ul class="nav nav-tabs" data-tabs="tabs">
<li class="active">
<a href="#tab-battle-list" data-toggle="tab">
<i class="material-icons">list</i>
Health
</a>
</li>
<li>
<a href="#tab-battle-grid" data-toggle="tab" onclick="alert('Grid/Range features are coming soon!')">
<i class="material-icons">view_module</i>
Battle Grid
</a>
</li>
</ul>
</div>
</div>
</div>
<div class="content">
<div class="tab-content">
<div class="tab-pane active" id="tab-battle-list">
<h3 class="text-muted">No one's here yet 😟</h3>
<h4 class="text-muted">Send your <a data-toggle="modal" data-target="#modalShare">customized link</a> to your players.
Then, have them hit "Join Battle" when they're ready.</h4>
</div>
<div class="tab-pane" id="tab-battle-grid">
<div class="row">
<button class="btn btn-danger btn-raised pull-right" onclick="endBattle()">End Battle</button>
<div class="battle-slider">
<label class="control-label" for="zoom-slider">Zoom Level</label>
<div class="slider slider-danger" id="zoom-slider"></div>
</div>
</div>
<div class="row">
<div class="battle-grid"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="hidden" id="body-pokemon">
<div class="card card-nav-tabs">
<div class="header header-danger">
<div class="nav-tabs-navigation">
<div class="nav-tabs-wrapper">
<ul class="nav nav-tabs" data-tabs="tabs">
<li class="active">
<a href="#tab-manage" data-toggle="tab">
<i class="material-icons">view_module</i>
Manage
</a>
</li>
<li class="hidden">
<a href="#tab-char-io" data-toggle="tab">
<i class="material-icons">view_module</i>
Manage
</a>
</li>
<li>
<a href="#tab-add" data-toggle="tab">
<i class="material-icons">add</i>
Create
</a>
</li>
<li>
<a href="#tab-generate" data-toggle="tab">
<i class="material-icons">brush</i>
Generate
</a>
</li>
<li>
<a href="#" data-toggle="modal" data-target="#modalImpPokemon">
<i class="material-icons">file_download</i>
Import
</a>
</li>
<li>
<a href="#" data-toggle="modal" data-target="#modalExpPokemon" onclick="fetchExistingPokemon();">
<i class="material-icons">file_upload</i>
Export
</a>
</li>
</ul>
</div>
</div>
</div>
<div class="content">
<div class="tab-content text-center">
<div class="tab-pane active" id="tab-manage">
<div class="list-pokemon"></div>
</div>
<div class="tab-pane" id="tab-char-io">
</div>
<div class="tab-pane" id="tab-add">
<small class="text-muted"><i>MORE CHARACTER/POKEMON SHEET FEATURES ARE COMING</i></small>
<h4>POKEMON</h4>
<button class="btn btn-danger" onclick="onClickAddPokemon('SIMPLE','POKEMON')">Simple Sheet</button>
<button class="btn" disabled>Full Sheet</button>
<h4>TRAINER</h4>
<button class="btn btn-danger" onclick="onClickAddPokemon('SIMPLE','OTHER')">Simple Sheet</button>
<button class="btn" disabled>Full Sheet</button>
</div>
<div class="tab-pane" id="tab-generate">
<div class="col-md-8 col-md-offset-2 form-genmon">
<h4>Step 1: Select Categories</h4>
<div class="row">
<div class="col-sm-6">
<div class="input-group input-enable">
<div class="checkbox">
<label>
<input type="checkbox" class="form-control-enabler" id="enable-species">
</label>
</div>
<div class="form-group label-floating">
<label class="control-label" for="genmon-species" style="opacity: 0.6">Species</label>
<input class="form-control" type="text" id="genmon-species" disabled data-populate="dex" />
</div>
</div>
</div>
<div class="col-sm-6">
<div class="input-group input-enable">
<div class="checkbox">
<label>
<input type="checkbox" class="form-control-enabler" id="enable-type">
</label>
</div>
<div class="form-group label-floating">
<label class="control-label" for="genmon-type" style="opacity: 0.6">Type</label>
<select class="form-control" id="genmon-type" disabled data-populate="type">
<option></option>
</select>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="input-group input-enable">
<div class="checkbox">
<label>
<input type="checkbox" class="form-control-enabler" id="enable-habitat">
</label>
</div>
<div class="form-group label-floating">
<label class="control-label" for="genmon-habitat" style="opacity: 0.6">Habitat</label>
<select class="form-control" id="genmon-habitat" disabled>
<option></option>
<option>Arctic</option>
<option>Beach</option>
<option>Cave</option>
<option>Desert</option>
<option>Forest</option>
<option>Freshwater</option>
<option>Grassland</option>
<option>Marsh</option>
<option>Mountain</option>
<option>Ocean</option>
<option>Rainforest</option>
<option>Taiga</option>
<option>Tundra</option>
<option>Urban</option>
</select>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="input-group input-enable">
<div class="checkbox">
<label>
<input type="checkbox" class="form-control-enabler" id="enable-gen">
</label>
</div>
<div class="form-group label-floating">
<label class="control-label" for="genmon-gen" style="opacity: 0.6">Generation</label>
<select class="form-control" id="genmon-gen" disabled>
<option></option>
<option value="1">Gen I</option>
<option value="2">Gen II</option>
<option value="3">Gen III</option>
<option value="4">Gen IV</option>
<option value="5">Gen V</option>
<option value="6">Gen VI</option>
</select>
</div>
</div>
</div>
</div>
<h4>Step 2: Owner Information</h4>
<div class="togglebutton">
<label>
<input type="checkbox" id="genmon-is-wild" checked> Wild Pokémon
</label>
</div>
<div class="collapse" id="group-owner-settings">
Owner Specifications
<div class="collapse-form">
<div class="checkbox">
<label>
<input type="checkbox" id="genmon-tp"> Top Percentage Class
<i class="material-icons help" data-toggle="tooltip" data-placement="top"
title="Pokémon from an owner with Top Percentage gain extra Tutor Points and boosted Base Stats on Levels divisible by 5">help</i>
</label>
<label>
<input type="checkbox" id="genmon-soul"> Enduring Soul Class
<i class="material-icons help" data-toggle="tooltip" data-placement="top"
title="Pokémon from an owner with Enduring Soul can have their HP stat raised outside of the Base Relations Rule">help</i>
</label>
<label>
<input type="checkbox" id="genmon-horiz"> Expand Horizons Feature
<i class="material-icons help" data-toggle="tooltip" data-placement="top"
title="Pokémon from an owner with Expand Horizons gain 3 extra Tutor Points">help</i>
</label>
<label>
<input type="checkbox" id="genmon-guide"> Guidance Feature
<i class="material-icons help" data-toggle="tooltip" data-placement="top"
title="Pokémon from an owner with Guidance have an extra move">help</i>
</label>
<label>
<input type="checkbox" id="genmon-ace-atk"> Stat Ace (ATK)
<i class="material-icons help" data-toggle="tooltip" data-placement="top"
title="Pokémon from an owner with Stat Ace gain an extra point to the bound stat with a bonus +1 per 10 levels. The stat can also ignore the Base Relations Rule.">help</i>
</label>
<label>
<input type="checkbox" id="genmon-ace-def"> Stat Ace (DEF)
</label>
<label>
<input type="checkbox" id="genmon-ace-spatk"> Stat Ace (SPATK)
</label>
<label>
<input type="checkbox" id="genmon-ace-spdef"> Stat Ace (SPDEF)
</label>
<label>
<input type="checkbox" id="genmon-ace-spd"> Stat Ace (SPD)
</label>
</div>
<div class="form-group label-floating">
<label class="control-label" for="addmon-lvl-caught">Level Caught</label>
<input class="form-control" type="number" id="genmon-lvl-caught" min="1" max="100" value="1" />
<p class="help-block">Only required if they have Top Percentage</p>
</div>
<div class="form-group label-floating">
<label class="control-label" for="addmon-lvl-caught">Unused Tutor Points</label>
<input class="form-control" type="number" id="genmon-tutor-unused" min="0" value="0" />
<p class="help-block">If you don't want all of the tutor points used, specify here</p>
</div>
</div>
</div>
<div class="form-group label-floating">
<label class="control-label" for="addmon-discover">Discovered at</label>
<input class="form-control" type="text" id="genmon-discover" />
<p class="help-block">Keep track of where the Pokémon was found</p>
</div>
<h4>Step 3: Pokémon Settings</h4>
<div class="row">
<div class="col-sm-2">
<div class="form-group label-floating">
<label class="control-label" for="genmon-lvlmin">Min Level</label>
<input class="form-control" type="number" id="genmon-lvlmin" min="1" max="100" value="1" required />
</div>
</div>
<div class="col-sm-8">
<label class="control-label" for="genmon-lvl-slider">Level Range</label>
<div class="slider slider-danger" id="genmon-lvl-slider"></div>
</div>
<div class="col-sm-2">
<div class="form-group label-floating">
<label class="control-label" for="genmon-lvlmax">Max Level</label>
<input class="form-control" type="number" id="genmon-lvlmax" min="1" max="100" value="100" required />
</div>
</div>
</div>
<div class="form-group label-floating">
<label class="control-label" for="genmon-gender">Specific Gender</label>
<select class="form-control" id="genmon-gender" data-field="gender">
<option></option>
<option>Genderless</option>
<option>Male</option>
<option>Female</option>
</select>
</div>
<div class="row">
<div class="col-xs-6">
<div class="form-group label-floating">
<label class="control-label" for="genmon-tmmin">Min Leanred TMs</label>
<input class="form-control" type="number" id="genmon-tmmin" min="0" max="9" value="0" required />
<p class="help-block">Includes TMs, HMs, and Tutor Moves</p>
</div>
</div>
<div class="col-xs-6">
<div class="form-group label-floating">
<label class="control-label" for="genmon-tmmax">Max Learned TMs</label>
<input class="form-control" type="number" id="genmon-tmmax" min="0" max="9" value="0" required />
<p class="help-block">Includes TMs, HMs, and Tutor Moves</p>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-6">
<div class="form-group label-floating">
<label class="control-label" for="genmon-emmin">Min Egg Moves</label>
<input class="form-control" type="number" id="genmon-emmin" min="0" max="9" value="0" required />
</div>
</div>
<div class="col-xs-6">
<div class="form-group label-floating">
<label class="control-label" for="genmon-emmax">Max Egg Moves</label>
<input class="form-control" type="number" id="genmon-emmax" min="0" max="9" value="0" required />
</div>
</div>
</div>
<div class="togglebutton">
<label>
<input type="checkbox" id="genmon-legend" checked> Include Legendaries
</label>
</div>
<div class="togglebutton">
<label>
<input type="checkbox" id="genmon-weight-stats" onclick="$('#group-stat-weights').collapse('toggle')"> Weighted Stats
<i class="material-icons help" data-toggle="tooltip" data-placement="top"
title="Set certain stats to have priority over others by raising the number next to it. Set to all 1's to equally distribute stat points.">help</i>
</label>
</div>
<div class="collapse" id="group-stat-weights">
<div class="collapse-form">
<div class="form-group label-floating">
<label class="control-label" for="genmon-hp">HP (Stat)</label>
<input class="form-control" type="number" id="genmon-hp" value="1" />
</div>
<div class="form-group label-floating">
<label class="control-label" for="genmon-atk">Attack</label>
<input class="form-control" type="number" id="genmon-atk" value="1" />
</div>
<div class="form-group label-floating">
<label class="control-label" for="genmon-def">Defense</label>
<input class="form-control" type="number" id="genmon-def" value="1" />
</div>
<div class="form-group label-floating">
<label class="control-label" for="genmon-spatk">Special Attack</label>
<input class="form-control" type="number" id="genmon-spatk" value="1" />
</div>
<div class="form-group label-floating">
<label class="control-label" for="genmon-spdef">Special Defense</label>
<input class="form-control" type="number" id="genmon-spdef" value="1" />
</div>
<div class="form-group label-floating">
<label class="control-label" for="genmon-speed">Speed</label>
<input class="form-control" type="number" id="genmon-speed" value="1" />
</div>
</div>
</div>
<div class="row">
<button class="btn btn-success pull-right" id="btn-genmon">Generate</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="hidden" id="body-settings">
<div class="card">
<div class="card-body">
<h2>Settings</h2>
<button class="btn btn-danger" onclick="reconnect()">Reconnect to Peer.JS</button>
</div>
</div>
</div>
</div>
<div class="bottom">
<div class="container">
<div class="row">
</div>
</div>
</div>
<footer class="footer-gm hidden">
<div class="container">
<div class="col-xs-3">
<button class="btn btn-white btn-simple" onclick="changeGMView(0)">
Battler
</button>
</div>
<div class="col-xs-3">
<button class="btn btn-white btn-simple" onclick="changeGMView(1)">
Pokémon
</button>
</div>
<div class="col-xs-3">
<button class="btn btn-white btn-simple" onclick="changeGMView(2)">
Settings
</button>
</div>
<div class="col-xs-3">
<button class="btn btn-white btn-simple" onclick="saveGM();">
Save
</button>
</div>
</div>
</footer>
<!-- Modal dialog for starting battles -->
<div class="modal fade" id="modalNewBattle" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h3 class="modal-title text-danger" id="myModalLabel">New Battle</h3>
</div>
<div class="modal-body form-impmon">
<small><i>Grid/range system is work in progress</i></small>
<h4>Grid Size</h4>
<div class="form-group label-floating col-xs-6">
<label class="control-label" for="grid-w">Width</label>
<input class="form-control" type="number" id="grid-w" min="4" value="12" required/>
</div>
<div class="form-group label-floating col-xs-6">
<label class="control-label" for="grid-h">Height</label>
<input class="form-control" type="number" id="grid-h" min="4" value="7" required/>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-success" id="btn-newbattle" onclick="startBattle()">Start</button>
</div>
</div>
</div>
</div>
<!-- Modal dialog for exporting Pokémon -->
<div class="modal fade" id="modalExpPokemon" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h3 class="modal-title text-danger" id="expMonLabel">Export a Pokémon</h3>
</div>
<input type="hidden" id="expmon-id" value="" />
<div class="modal-body form-expmon">
<small><i>Feature is work in progress</i></small>
<h4>Basic Info</h4>
<div class="form-group label-floating">
<label class="control-label" for="expmon-mon">Select Pokémon</label>
<select class="form-control" id="expmon-mon" required><option></option></select>
</div>
<div class="form-group label-floating">
<label class="control-label" for="expmon-name">Click in the text field below and use ctrl-A to copy JSON:</label>
<textarea class="form-control" rows="5" cols="20" data-field="json" id="expmon-JSON" required></textarea>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-success" data-dismiss="modal">Done</button>
</div>
</div>
</div>
</div>
</div>
<!-- Modal dialog for importing Pokémon -->
<div class="modal fade" id="modalImpPokemon" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h3 class="modal-title text-danger" id="impMonLabel">Import a Pokémon</h3>
</div>
<input type="hidden" id="impmon-id" value="" />
<div class="modal-body form-impmon">
<small><i>Feature is work in progress</i></small>
<h4>Basic Info</h4>
<div class="form-group label-floating">
<label class="control-label" for="impmon-name">Put Fancy Sheet JSON below:</label>
<textarea class="form-control" rows="5" cols="20" data-field="json" id="impmon-JSON" required></textarea>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-success" id="btn-impmon">Save</button>
</div>
</div>
</div>
</div>
</div>
<!-- Modal dialog for adding/editing Pokémon -->
<div class="modal fade" id="modalSimpleSheet" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h3 class="modal-title text-danger" id="myModalLabel">Add/Edit Pokémon</h3>
</div>
<input type="hidden" id="addmon-id" value="" />
<div class="modal-body form-addmon">
<small><i>Feature is work in progress</i></small>
<h4>Basic Info</h4>
<div class="form-group label-floating">
<label class="control-label" for="addmon-name">Name</label>
<input class="form-control" type="text" id="addmon-name" data-field="name" required />
</div>
<div class="form-group label-floating">
<label class="control-label" for="addmon-dex">Pokédex ID</label>
<input class="form-control" type="text" id="addmon-dex" data-field="dex" data-show="POKEMON"
data-required="POKEMON" data-populate="dex" />
</div>
<div class="form-group label-floating">
<label class="control-label" for="addmon-type1">Type 1</label>
<select class="form-control" id="addmon-type1" data-required="POKEMON" data-populate="type"><option></option></select>
</div>
<div class="form-group label-floating">
<label class="control-label" for="addmon-type2">Type 2</label>
<select class="form-control" id="addmon-type2" data-populate="type"><option></option></select>
</div>
<div class="form-group label-floating">
<label class="control-label" for="addmon-level">Level</label>
<input class="form-control" type="number" id="addmon-level" data-field="level" required />
</div>
<div class="form-group label-floating">
<label class="control-label" for="addmon-exp">EXP</label>
<input class="form-control" type="number" id="addmon-exp" data-field="EXP" value="0" />
</div>
<div class="form-group label-floating">
<label class="control-label" for="addmon-nature">Nature</label>
<select class="form-control" id="addmon-nature" data-field="nature" data-populate="nature"
data-show="POKEMON" data-required="POKEMON">
<option></option>
</select>
</div>
<div class="form-group label-floating">
<label class="control-label" for="addmon-gender">Gender</label>
<select class="form-control" id="addmon-gender" data-field="gender" required>
<option>Genderless</option>
<option>Male</option>
<option>Female</option>
</select>
</div>
<div class="form-group label-floating">
<label class="control-label" for="addmon-discover">Discovered at</label>
<input class="form-control" type="text" id="addmon-discover" data-field="discovery" data-show="POKEMON" />
<p class="help-block">Where was the Pokémon found</p>
</div>
<div class="form-group label-floating">
<label class="control-label" for="addmon-item">Held Item</label>
<input class="form-control" type="text" id="addmon-item" data-field="held-item" />
</div>
<hr/>
<h4>Health <small class="text-warning" id="warn-health"></small></h4>
<div class="form-group label-floating">
<label class="control-label" for="addmon-health">Current Health</label>
<input class="form-control" type="number" id="addmon-health" data-field="health" />
</div>
<div class="form-group label-floating">
<label class="control-label" for="addmon-injure">Injuries</label>
<input class="form-control" type="number" id="addmon-injure" data-field="injuries" value="0" />
</div>
<hr/>
<h4>Stats <small class="text-warning" id="warn-stats"></small></h4>
<div class="form-group label-floating">
<label class="control-label" for="addmon-hp">HP (Stat)</label>
<input class="form-control" type="number" id="addmon-hp" data-field="hp" required />
</div>
<div class="form-group label-floating">
<label class="control-label" for="addmon-atk">Attack</label>
<input class="form-control" type="number" id="addmon-atk" data-field="atk" required />
</div>
<div class="form-group label-floating">
<label class="control-label" for="addmon-def">Defense</label>
<input class="form-control" type="number" id="addmon-def" data-field="def" required />
</div>
<div class="form-group label-floating">
<label class="control-label" for="addmon-spatk">Special Attack</label>
<input class="form-control" type="number" id="addmon-spatk" data-field="spatk" required />
</div>
<div class="form-group label-floating">
<label class="control-label" for="addmon-spdef">Special Defense</label>
<input class="form-control" type="number" id="addmon-spdef" data-field="spdef" required />
</div>
<div class="form-group label-floating">
<label class="control-label" for="addmon-speed">Speed</label>
<input class="form-control" type="number" id="addmon-speed" data-field="speed" required />
</div>
<hr/>
<h4>Moves & Abilities</h4>
<!-- TODO: make moves add/remove -->
<label for="addmon-moves">Moves</label>
<div id="addmon-moves">
<select class="form-control" title="Move 1" required data-populate="move"><option></option></select>
<select class="form-control" title="Move 2" data-populate="move"><option></option></select>
<select class="form-control" title="Move 3" data-populate="move"><option></option></select>
<select class="form-control" title="Move 4" data-populate="move"><option></option></select>
<select class="form-control" title="Move 5" data-populate="move"><option></option></select>
<select class="form-control" title="Move 6" data-populate="move"><option></option></select>
<select class="form-control" title="Move 7" data-populate="move"><option></option></select>
<select class="form-control" title="Move 8" data-populate="move"><option></option></select>
<select class="form-control" title="Move 9" data-populate="move"><option></option></select>
</div>
<label for="addmon-moves">Abilities</label>
<div id="addmon-abilities">
<select class="form-control" title="Ability 1" data-required="POKEMON" data-populate="ability"><option></option></select>
<select class="form-control" title="Ability 2" data-populate="ability"><option></option></select>