generated from github/codespaces-blank
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
242 lines (241 loc) · 6.89 KB
/
index.js
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
let scores = document.getElementById("score");
let counter = 0;
let prestige2;
let prestige = parseInt(window.localStorage.getItem('prestige'));
let addedvalue = 1;
let fakeloulouvalue = 1;
let timer = 1
let newaddedvalue = addedvalue * prestige * 2;
let autovalue = 0;
let newautovalue = autovalue * prestige * 2;
let func1 = add_autovalue;
let cookietime = 1000;
let run1 = setInterval("func1()", cookietime);
let func2 = enoughcookies;
let run2 = setInterval("func2()", 10);
let func3 = notenoughcookies;
let run3 = setInterval("func3()", 10);
let func4 = currentclicks;
let run4 = setInterval("func4()", 10);
let func5;
let run5 = setInterval("func5()", 1000);
let func6 = loulouenough;
let run6 = setInterval("func6()", 10)
function addprestige(){
//has to be defined before prestige can only be defined once because else it gets back to zero after loulouboss
prestige2 = window.localStorage.setItem("prestige", 0)
prestige += 1
window.localStorage.setItem('prestige', prestige)
}
function currentclicks() {
if (prestige <= 0) {
document.getElementById("currentperclick").innerHTML = "Current Cookies per click: " + addedvalue;
if (autovalue > 0) {
document.getElementById("currentpersec").innerHTML = "Current Cookies per second: " + autovalue;
}
}
else if (prestige > 0) {
document.getElementById("currentperclick").innerHTML = "Current Cookies per click: " + newaddedvalue
if (autovalue > 0) {
document.getElementById("currentpersec").innerHTML = "Current Cookies per second: " + newautovalue;
}
}
}
function loulouenough(){
if (counter >= 1) {
document.getElementById("LouLoutext2").style.visibility = "visible";
}
if (counter >= 2) {
document.getElementById("LouLoutext3").style.visibility = "visible";
}
if (counter >= 10) {
document.getElementById("LouLoutext2").innerHTML = "";
document.getElementById("LouLoutext3").innerHTML = "Hängebauch!";
document.getElementById("clickto").innerHTML = "Click 100 times!";
func5 = timerdown;
if (timer <= 0 && counter < 110) {
document.getElementById("del").innerHTML = "";
document.getElementById("del2").style.visibility = "visible";
}
else if (timer <= 0 && counter >= 110) {
document.getElementById("del2").innerHTML = ""
document.getElementById("timer").innerHTML = ""
clearInterval(run5)
document.getElementById("LouLoutext2").innerHTML = "Hänge-...";
document.getElementById("LouLoutext3").innerHTML = "bauch";
document.getElementById("clickto").innerHTML = "";
document.getElementById("butwon").style.visibility = "visible";
}
}
}
function enoughcookies(){
if (counter >= 10) {
document.getElementById("butup1").style.backgroundColor = "green";
}
if (counter >= 100) {
document.getElementById("butup2").style.backgroundColor = "green";
}
if (counter >= 100) {
document.getElementById("butup3").style.backgroundColor = "green";
}
if (counter >= 1000) {
document.getElementById("butup4").style.backgroundColor = "green";
}
if (counter >= 1000) {
document.getElementById("butup5").style.backgroundColor = "green";
}
if (counter >= 10000) {
document.getElementById("butup6").style.backgroundColor = "green";
}
if (counter >= 10000) {
document.getElementById("butup7").style.backgroundColor = "green";
}
if (counter >= 100000) {
document.getElementById("butup8").style.backgroundColor = "green";
}
if (counter >= 100000) {
document.getElementById("butspec1").style.backgroundColor = "green";
}
if (counter >= 1000000) {
document.getElementById("loulouboss").style.visibility = "visible"
}
};
function timerdown() {
timer -= 1
document.getElementById("timer").style.visibility = "visible"
document.getElementById("timer").innerHTML = timer;
}
function notenoughcookies(){
if (counter < 10) {
document.getElementById("butup1").style.backgroundColor = "red";
}
if (counter < 100) {
document.getElementById("butup2").style.backgroundColor = "red";
}
if (counter < 100) {
document.getElementById("butup3").style.backgroundColor = "red";
}
if (counter < 1000) {
document.getElementById("butup4").style.backgroundColor = "red";
}
if (counter < 1000) {
document.getElementById("butup5").style.backgroundColor = "red";
}
if (counter < 10000) {
document.getElementById("butup6").style.backgroundColor = "red";
}
if (counter < 10000) {
document.getElementById("butup7").style.backgroundColor = "red";
}
if (counter < 100000) {
document.getElementById("butup8").style.backgroundColor = "red";
}
if (counter < 100000) {
document.getElementById("butspec1").style.backgroundColor = "blueviolet";
}
if (counter < 1000000) {
document.getElementById("loulouboss").style.visibility = "hidden"
}
}
function add_autovalue(){
if (prestige <= 0) {
counter += autovalue
score.innerHTML = counter;
}
else if (prestige > 0) {
counter += newautovalue
score.innerHTML = counter;
}
}
function harvest() {
if (prestige <= 0){
counter += addedvalue;
score.innerHTML = counter;
}
else if (prestige > 0) {
counter += newaddedvalue;
score.innerHTML = counter;
}
}
function harvestloulou(){
counter += fakeloulouvalue;
}
function buyspec1(){
if (counter >= 100000){
counter -= 100000
cookietime = 1000 / 2
clearInterval(run1);
run1 = setInterval("func1()", cookietime);
document.getElementById("butspec1").style.visibility = "hidden"
score.innerHTML = counter;
}
}
function buyupgrade1(){
if (counter >= 10) {
counter -= 10
addedvalue += 1
newaddedvalue = addedvalue * prestige * 2;
score.innerHTML = counter;
}
};
function buyupgrade2(){
if (counter >= 100) {
counter -= 100
addedvalue += 10
newaddedvalue = addedvalue * prestige * 2;
score.innerHTML = counter;
}
}
function buyupgrade3(){
if (counter >= 100) {
counter -= 100
autovalue += 1
newautovalue = autovalue * prestige * 2;
score.innerHTML = counter;
}
};
function buyupgrade4(){
if (counter >= 1000) {
counter -= 1000
autovalue += 10
newautovalue = autovalue * prestige * 2;
score.innerHTML = counter;
}
};
function buyupgrade5(){
if (counter >= 1000) {
counter -= 1000
addedvalue += 100
newaddedvalue = addedvalue * prestige * 2;
score.innerHTML = counter;
}
};
function buyupgrade6(){
if (counter >= 10000) {
counter -= 10000
addedvalue += 1000
newaddedvalue = addedvalue * prestige * 2;
score.innerHTML = counter;
}
};
function buyupgrade7(){
if (counter >= 10000) {
counter -= 10000
autovalue += 100
newautovalue = autovalue * prestige * 2;
score.innerHTML = counter;
}
};
function buyupgrade8(){
if (counter >= 100000) {
counter -= 100000
autovalue += 1000
newautovalue = autovalue * prestige * 2;
score.innerHTML = counter;
}
};
function loulouboss(){
if (counter >= 1000000) {
counter -= counter
}
}