Skip to content

Commit 6ff742f

Browse files
Add upgrades for difficulty halver
1 parent ffa56bf commit 6ff742f

File tree

4 files changed

+18
-3
lines changed

4 files changed

+18
-3
lines changed

.github/makecode/blocks.png

11.1 KB
Loading

.github/makecode/blocksdiff.png

97.9 KB
Loading

main.blocks

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

main.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,13 +259,22 @@ function do_upgrade (id: number) {
259259
asic_speed = asic_speed * 0.5
260260
} else if (id == 14) {
261261
asic_price = asic_price * 0.5
262+
} else if (id == 15) {
263+
difficulty_halver_popup_time = difficulty_halver_popup_time * 2
264+
} else if (id == 16) {
265+
difficulty_halve_chance = difficulty_halve_chance * 2
266+
} else if (id == 17) {
267+
difficulty_halve_max_time = difficulty_halve_max_time * 2
262268
}
263269
autoclicker_speed = Math.floor(autoclicker_speed)
264270
computer_speed = Math.floor(computer_speed)
265271
asic_speed = Math.floor(asic_speed)
266272
autoclicker_price = Math.floor(autoclicker_price)
267273
computer_price = Math.floor(computer_price)
268274
asic_price = Math.floor(asic_price)
275+
difficulty_halver_popup_time = Math.floor(difficulty_halver_popup_time)
276+
difficulty_halve_chance = Math.floor(difficulty_halve_chance)
277+
difficulty_halve_max_time = Math.floor(difficulty_halve_max_time)
269278
}
270279
function move_till_not_touching (sprite: Sprite, other_sprite: Sprite, dx: number, dy: number) {
271280
while (sprite.overlapsWith(other_sprite)) {
@@ -328,7 +337,7 @@ function buy_autoclicker_menu () {
328337
score += autoclicker_price * -1
329338
autoclicker_price = autoclicker_price * 1.1
330339
}
331-
autoclicker_price = Math.round(autoclicker_price)
340+
autoclicker_price = Math.ceil(autoclicker_price)
332341
move_till_not_touching(sprite_cursor_pointer, sprite_buy_autoclicker, -1, 0)
333342
}
334343
spriteutils.createRenderable(0, function (screen2) {
@@ -401,16 +410,22 @@ function define_upgrades () {
401410
make_upgrade_obj("Hardware Autoclickers", "Triple the speed of cursors.", 15, 2, 10, 3, 0, 0, 0)
402411
make_upgrade_obj("Discounted Cursors", "Halves the price of cursors.", 15, 3, 10, 5, 0, 0, 0)
403412
make_upgrade_obj("USB 3.0 Cursors", "Quadruples the speed of cursors.", 20, 4, 10, 5, 0, 0, 0)
413+
info.stopCountdown()
404414
make_upgrade_obj("Faster Mining Software", "Doubles the speed of computers.", 20, 5, 15, 0, 2, 0, 0)
405415
make_upgrade_obj("Switch to Linux", "Triples the speed of computers.", 30, 6, 20, 0, 5, 0, 0)
406416
make_upgrade_obj("Direct from the Factory", "Halves the price of computers.", 30, 7, 25, 0, 5, 0, 0)
407417
make_upgrade_obj("External GPUs", "Sextuples (x6!) the speed of computers.", 60, 8, 30, 0, 10, 0, 0)
408418
make_upgrade_obj("PCI Express buses", "Triples the speed of computers.", 40, 9, 30, 0, 10, 0, 0)
419+
info.stopCountdown()
409420
make_upgrade_obj("Water cooling", "Doubles the speed of ASICs.", 75, 10, 50, 0, 0, 3, 0)
410421
make_upgrade_obj("Bulk buying", "Halves the price of ASICs.", 50, 11, 50, 0, 0, 5, 0)
411422
make_upgrade_obj("Firmware updates", "Triples the speed of ASICs.", 100, 12, 80, 0, 0, 5, 0)
412423
make_upgrade_obj("Improved ventilation", "Doubles the speed of ASICs.", 80, 13, 80, 0, 0, 5, 0)
413424
make_upgrade_obj("FPGAs are cheaper", "Halves the price of ASICs.", 100, 14, 80, 0, 0, 10, 0)
425+
info.stopCountdown()
426+
make_upgrade_obj("Longer Popups", "The Difficulty Halver pops up for twice as long.", 10, 15, 8, 0, 0, 0, 0)
427+
make_upgrade_obj("Luckier", "The chance of the Difficulty Halver popping up is doubled.", 20, 16, 10, 0, 0, 0, 0)
428+
make_upgrade_obj("Lengthier", "The Difficulty Halver effect length is doubled", 50, 17, 25, 0, 0, 0, 0)
414429
}
415430
function set_default_save () {
416431
show_particles = true

0 commit comments

Comments
 (0)