forked from pg132/universeCreatorIdle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
175 lines (142 loc) · 3.83 KB
/
main.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
var version = 0.0;
var user = {
gravicles: new Deicmal(10),
mk1:{
cost:new Decimal(10),
amount:new Decimal(0),
multiplier:new Decimal(1),
base:0,
previousTierCost:0,
costMult:1.15
},
mk2:{
cost:new Decimal(100),
amount:new Decimal(0),
multiplier:new Decimal(1),
base:0,
previousTierCost:10,
costMult:1.16
},
mk3:{
cost:new Decimal(10),
amount:new Decimal(0),
multiplier:new Decimal(1),
base:0,
previousTierCost:10,
costMult:1.17
},
mk4:{
cost:new Decimal(10),
amount:new Decimal(0),
multiplier:new Decimal(1),
base:0,
previousTierCost:10,
costMult:1.18
},
mk5:{
cost:new Decimal(10),
amount:new Decimal(0),
multiplier:new Decimal(1),
base:0,
previousTierCost:10,
previousTierCost:10,
costMult:1.19
},
mk6:{
cost:new Decimal(10),
amount:new Decimal(0),
multiplier:new Decimal(1),
base:0,
unlocked:false,
previousTierCost:10,
costMult:1.20
},
mk7:{
cost:new Decimal(10),
amount:new Decimal(0),
multiplier:new Decimal(1),
base:0,
unlocked:false,
previousTierCost:10,
costMult:1.21
},
mk8:{
cost:new Decimal(10),
amount:new Decimal(0),
multiplier:new Decimal(1),
base:0,
unlocked:false,
previousTierCost:10,
costMult:1.22
},
mk9:{
cost:new Decimal(10),
amount:new Decimal(0),
multiplier:new Decimal(1),
base:0,
unlocked:false,
previousTierCost:10,
costMult:1.23
},
wells:{
cost:20,
tiercost:5,
defaultMults:4,
totalMult:1,
amount:0,
costScale:20
},
pulse:{
cost:5,
amount:0
},
points:{
amount:new Decimal(0)
}
};
function getPulseReward(wells){
return 1+Decimal.sqrt(wells/2000)
}
function buyMK(tier) {
var tierCost = user["mk"+tier].previousTierCost
var gravCost = user["mk"+tier].cost
var costMult = user["mk"+tier].costMult
if (tier == 1){
if (gravCost <= user.gravicles){
user.gravicles = user.gravicles.minus(gravCost)
user.["mk"+tier].cost = user.["mk"+tier].cost.times(costMult)
//what should the multiplier formula be? rn im gonna make it 1% stronger
user["mk"+tier].multiplier = user["mk"+tier].multiplier.times(1.01)
}
}
if (gravCost <= user.gravicles && tierCost <= user["mk"+(tier-1)].base){
user.gravicles = user.gravicles.minus(gravCost)
user.["mk"+tier].cost = user.["mk"+tier].cost.times(costMult)
//what should the multiplier formula be? rn im gonna make it 1% stronger
user["mk"+tier].multiplier = user["mk"+tier].multiplier.times(1.01)
user["mk"+(tier-1)].base = user["mk"+(tier-1)].base.minus(tierCost)
}
}
function gravityWellBoost(tier){
var w = user.wells.amount
var d = user.wells.defaultMults
if (w<=d-1+tier) return Decimal.max(1,2**(w-tier+1))//fifth is worse
return Decimal.pow(2,(d-1)).times(w-d-tier+3)//just try it, it should work
}
function updateMKUnlocks(){
var w = user.wells.amount
user.mk6.unlocked = false
user.mk7.unlocked = false
user.mk8.unlocked = false
user.mk9.unlocked = false
if (w >= 1) user.mk6.unlocked = true
if (w >= 2) user.mk7.unlocked = true
if (w >= 3) user.mk8.unlocked = true
if (w >= 4) user.mk9.unlocked = true
}
function baseMKproduction(tier){
var amt = user["mk"+tier].amount
var mult = user["mk"+tier].multiplier
//put additional mults here
return amt.times(mult)
}