This repository was archived by the owner on Sep 20, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfunctions.js
More file actions
155 lines (141 loc) · 5.36 KB
/
functions.js
File metadata and controls
155 lines (141 loc) · 5.36 KB
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
$( document ).ready(function() {
function latent (a){
var latentList= `
<option>none</option>
<option value="images/3.png">hp</option>
<option value="images/4.png">atk</option>
<option value="images/5.png">rcv</option>
<option value="images/6.png">fire resist</option>
<option value="images/7.png">water resist</option>
<option value="images/8.png">wood resist</option>
<option value="images/9.png">light resist</option>
<option value="images/10.png">dark resist</option>
<option value="images/11.png">auto heal</option>
<option value="images/12.png">time extend</option>
<option value="images/killers/1.png">dragon killer</option>
<option value="images/killers/2.png">balance killer</option>
<option value="images/killers/3.png">physical killer</option>
<option value="images/killers/4.png">healer killer</option>
<option value="images/killers/5.png">attacker killer</option>
<option value="images/killers/6.png">god killer</option>
<option value="images/killers/9.png">devil killer</option>
<option value="images/killers/12.png">machine killer</option>
</select>`;
for(var i = 0; i<6; i++){
$("#"+a).append("<select name="+a+">" + latentList );
}
}
latent("p1_leader_latent");
latent("p1_sub1_latent");
latent("p1_sub2_latent");
latent("p1_sub3_latent");
latent("p1_sub4_latent");
latent("p2_leader_latent");
latent("p2_sub1_latent");
latent("p2_sub2_latent");
latent("p2_sub3_latent");
latent("p2_sub4_latent");
$(`select`).on("change",function () {
var array =[]
$(`select[name=`+this.name+`]`).each(function(){
if ($(this).val() != "none"){
var img = "<img src="+$(this).val()+">";
array.push(img);
}
});
$("#"+this.name+"s").html(array);
});
$(`#Team_selection input[type=number]`).on("input",function () {
if ($(this).val() > 0){
var img = "<img src=http://puzzledragonx.com/en/img/book/"+$(this).val()+".png>";
$("#"+this.name).html(img);}
else{
$("#"+this.name).html(" ");
}
});
$(`input[name=GuideDesc]`).on("input",function () {
var text = "**__Guide "+this.value+"__**" ;
$("#title").html(text);
});
$(`#leads input[type=checkbox]`).on("change",function () {
var leads = [];
$(`#leads input[name=`+this.name+`][type=checkbox]:checked`).each(function(){
leads.push(this.value+" ");
});
$("#"+this.name).html(leads);
});
$(`input[name=sbr][type=checkbox]`).on("change",function () {
if(this.checked){
$("#sbr").html("100% :SBR:<br>");
}else(
$("#sbr").html(" ")
);
});
$(`input[name=Line1_lead]`).on("change",function () {
if(this.checked){
$("#Line1_lead").html($(this).val());
}
});
$(`input[name=Line2_lead]`).on("change",function () {
if(this.checked){
$("#Line2_lead").html($(this).val());
}
});
$("#preemptives").on("change", "input ",function () {
var preEmptiveFloors = [];
var new_field = true;
$(`input[name=PreEmptive]`).each(function(){
if ($(this).val().length === 0) {
new_field = false;
}else{
preEmptiveFloors.push("F"+$(this).val());
}
});
$("#zap").html(":zap: " + preEmptiveFloors.join(", "));
if(new_field){
$("#preemptives").append(`FL: <input type=number name=PreEmptive size="2" min="0" max="99"><br>`);
}
});
$(`input[name=p1team]`).on("input",function () {
$("#P1_team").html(this.value);
});
$(`input[name=p2team]`).on("input",function () {
$("#P2_team").html(this.value);
});
$("#notes").on("input", "input ",function () {
var preEmptiveFloors = [];
var new_field = true;
$(`input[name=note]`).each(function(){
if ($(this).val().length === 0) {
new_field = false;
}else{
preEmptiveFloors.push("• "+$(this).val()+"<br>");
}
});
$("#note").html(preEmptiveFloors);
if(new_field){
$("#notes").append(`• <input type=text name=note><br>`);
}
});
var floor = 1;
$("#rundown_input").on("input", "input ",function () {
var rundown = [];
var new_field = true;
$(`input[name=rundown]`).each(function(){
if ($(this).val().length < 5) {
new_field = false;
}else{
rundown.push($(this).val()+"<br>");
}
});
$("#rundown").html(rundown);
if(new_field == true){
floor++;
$("#rundown_input").append(`<input type=text name=rundown value="F`+floor+`: "><br>`);
}
});
$(`input[name=GuideName]`).on("input",function () {
$("#name").html(this.value);
});
});
//hijason