-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscience.js
167 lines (161 loc) · 6.9 KB
/
science.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
if (!playerdata.unlocked.stage1) {
science[0].addEventListener("click", function stageOne() {
if (playerdata.unlocked.research) {
if (playerdata.research >= 10000 && playerdata.money >= 10000) {
let buyStage = confirm("Are you sure you would like to acquire the knowledge for stage 1 in exchange for 10000 research and 10000元?")
if (buyStage) {
playerdata.research -= 10000
playerdata.money -= 10000
playerdata.unlocked.stage1 = true
science[0].removeEventListener("click", stageOne)
science[0].style.display = "none"
science[1].style.display = "none"
alert("You have now completed stage 1. Congrats! This is your first step of many towards a better future for you. The stars acknowledge you courage and desire to continue. As a result, we have provided you with 1000 more research to keep your spirits high.")
playerdata.research += 1000
playerdata.stats.research += 1000
}
} else {
alert("Need 10000 research and 10000元.")
}
} else {
alert("Not unlocked yet!")
}
})
} else {
science[0].style.display = "none"
science[1].style.display = "none"
}
if (!playerdata.unlocked.stage2) {
science[2].addEventListener("click", function stageTwo() {
if (playerdata.unlocked.research && playerdata.unlocked.stage1) {
if (playerdata.research >= 100000 && playerdata.money >= 100000 && playerdata.selectSeeds >= 100000) {
let buyStage = confirm("Are you sure you would like to acquire the knowledge for stage 2 in exchange for 100000 research, 100000元, and 100000 select seeds?")
if (buyStage) {
playerdata.research -= 100000
playerdata.money -= 100000
playerdata.selectSeeds -= 100000
playerdata.unlocked.stage2 = true
science[2].removeEventListener("click", stageTwo)
science[2].style.display = "none"
science[3].style.display = "none"
alert("You have now completed stage 2. To keep you going, the stars have provided you with 500 brown seeds, which was the (non-toxic) radioactive byproduct as a result the experimentation of the select seeds.")
playerdata.brownSeeds += 500
playerdata.stats.brownSeeds += 500
}
} else {
alert("Need 100000 research, 100000元, 100000 select seeds.")
}
} else {
alert("Not unlocked yet!")
}
})
} else {
science[2].style.display = "none"
science[3].style.display = "none"
}
if (!playerdata.unlocked.stage3) {
science[4].addEventListener("click", function stageThree() {
if (playerdata.unlocked.research && playerdata.unlocked.stage2) {
if (playerdata.rice >= 1000000 && playerdata.research >= 1000000 && playerdata.money >= 1000000 && playerdata.brownSeeds >= 100000 && playerdata.goldSeeds >= 10) {
let buyStage = confirm("Are you sure you would like to acquire the knowledge for stage 3 in exchange for 1 million rice, 1 million research, 1 million 元, 10000 brown seeds, and 10 gold seeds?")
if (buyStage) {
playerdata.rice -= 1000000
playerdata.research -= 1000000
playerdata.money -= 1000000
playerdata.brownSeeds -= 100000
playerdata.goldSeeds -= 10
playerdata.unlocked.stage3 = true
science[4].removeEventListener("click", stageThree)
science[4].style.display = "none"
science[5].style.display = "none"
alert("You have now completed stage 3. Congratulations, you have completed all the stages! 100 gold seeds have been presented to you by the stars for your dedication and hard work. A message awaits you. Go forth!")
document.getElementById("ending").style.display = "block"
playerdata.goldSeeds += 100
playerdata.stats.goldSeeds += 100
}
} else {
alert("Need 1m rice, 1m research, 1m 元, 100000 brown seeds, and 10 gold seeds.")
}
} else {
alert("Not unlocked yet!")
}
})
} else {
science[4].style.display = "none"
science[5].style.display = "none"
}
if (!playerdata.unlocked.brownPlus) {
science[6].addEventListener("click", function scienceBrown() {
if (playerdata.unlocked.research && playerdata.unlocked.brown[0]) {
if (playerdata.research >= 5000 && playerdata.selectSeeds >= 5000) {
let yesno = confirm("Are you sure you would like to research brown mutations for 5000 research and 5000 select seeds?")
if (yesno) {
playerdata.unlocked.brownPlus = true
playerdata.research -= 5000
playerdata.selectSeeds -= 5000
science[6].removeEventListener("click", scienceBrown)
science[6].style.display = "none"
science[7].style.display = "none"
alert("You now know the ways of brown mutations and have thus improved your chances of one.")
}
} else {
alert("Need 5000 research and 5000 select seeds.")
}
} else {
alert("Not unlocked yet!")
}
})
} else {
science[6].style.display = "none"
science[7].style.display = "none"
}
if (!playerdata.unlocked.goldPlus) {
science[8].addEventListener("click", function scienceGold() {
if (playerdata.unlocked.research && playerdata.unlocked.gold[0]) {
if (playerdata.research >= 10000 && playerdata.brownSeeds >= 10000) {
let yesno = confirm("Are you sure you would like to research gold mutations for 10000 research and 10000 brown seeds?")
if (yesno) {
playerdata.unlocked.goldPlus = true
playerdata.research -= 10000
playerdata.brownSeeds -= 10000
science[8].removeEventListener("click", scienceGold)
science[8].style.display = "none"
science[9].style.display = "none"
alert("You now know the ways of gold mutations and have thus improved your chances of one.")
}
} else {
alert("Need 10000 research and 10000 brown seeds.")
}
} else {
alert("Not unlocked yet!")
}
})
} else {
science[8].style.display = "none"
science[9].style.display = "none"
}
if (!playerdata.unlocked.betterFert) {
science[10].addEventListener("click", function scienceFert() {
if (playerdata.unlocked.research) {
if (playerdata.research >= 20000 && playerdata.fertile >= 20000) {
let yesno = confirm("Are you sure you would like to research fertilizer for 20000 research and 20000 fertilizer?")
if (yesno) {
playerdata.unlocked.betterFert = true
playerdata.research -= 20000
playerdata.fertile -= 20000
science[10].removeEventListener("click", scienceFert)
science[10].style.display = "none"
science[11].style.display = "none"
alert("You have now acquired a more technologically advanced fertilizer.")
}
} else {
alert("Need 20000 research and 20000 fertilizer.")
}
} else {
alert("Not unlocked yet!")
}
})
} else {
science[10].style.display = "none"
science[11].style.display = "none"
}