@@ -180,7 +180,7 @@ function menu_menu () {
180180 Notification . notify ( "Saved progress!" , assets . image `floppy_disc` )
181181 } )
182182 } else if ( blockMenu . selectedMenuOption ( ) . includes ( "Wipe" ) ) {
183- if ( game . ask ( "Are you sure you" , " want to wipe save?") ) {
183+ if ( game . ask ( "Are you sure you want to" , " wipe your save?") ) {
184184 wipe_save ( )
185185 timer . background ( function ( ) {
186186 Notification . waitForNotificationFinish ( )
@@ -334,9 +334,9 @@ spriteutils.createRenderable(0, function (screen2) {
334334 screen2 . fillRect ( 0 , 0 , 160 , 20 , 15 )
335335 images . print ( screen2 , "MakeCoins: " + score , 2 , 2 , 1 )
336336 if ( difficulty_halving ) {
337- images . print ( screen2 , "Target: " + magic_number + "/" + max_height + " (" + difficulty_halve_time_left + ")" , 2 , 10 , 1 )
337+ images . print ( screen2 , "Target: " + magic_number + " (" + difficulty_halve_time_left + ")" , 2 , 10 , 1 )
338338 } else {
339- images . print ( screen2 , "Target: " + magic_number + "/" + max_height , 2 , 10 , 1 )
339+ images . print ( screen2 , "Target: " + magic_number , 2 , 10 , 1 )
340340 }
341341 screen2 . drawLine ( 0 , 20 , 160 , 20 , 1 )
342342} )
@@ -424,7 +424,7 @@ function set_default_save () {
424424 old_difficulty = max_height
425425 difficulty_halve_time_left = 0
426426 difficulty_halve_max_time = 30
427- difficulty_halve_chance = 1
427+ difficulty_halve_chance = 2
428428 difficulty_halving = false
429429}
430430function wipe_save ( ) {
@@ -553,6 +553,15 @@ function get_upgrades_menu () {
553553 }
554554 move_till_not_touching ( sprite_cursor_pointer , sprite_upgrades_button , 0 , - 1 )
555555}
556+ function make_difficulty_halving_status ( ) {
557+ sprite_difficulty_halving_status_bar = statusbars . create ( 52 , 2 , StatusBarKind . Energy )
558+ sprite_difficulty_halving_status_bar . top = 22
559+ sprite_difficulty_halving_status_bar . left = 2
560+ sprite_difficulty_halving_status_bar . z = 0
561+ sprite_difficulty_halving_status_bar . setColor ( 7 , 2 , 5 )
562+ sprite_difficulty_halving_status_bar . max = difficulty_halve_max_time
563+ sprite_difficulty_halving_status_bar . value = 0
564+ }
556565function make_main_computer ( ) {
557566 sprite_computer = sprites . create ( assets . image `computer_monitor` , SpriteKind . Thing )
558567 sprite_computer . left = 16
@@ -566,6 +575,7 @@ function pretty_hashes_per_sec (hashes_per_sec: number) {
566575 return "" + number_to_si_prefix ( hashes_per_sec ) + "H/S: " + spriteutils . roundWithPrecision ( hashes_per_sec / number_to_si_divider ( hashes_per_sec ) , 2 )
567576}
568577let sprite_difficulty_halver : Sprite = null
578+ let sprite_difficulty_halving_status_bar : StatusBarSprite = null
569579let local_upgrade_got : blockObject . BlockObject = null
570580let local_upgrades_shown = 0
571581let local_available_upgrades : blockObject . BlockObject [ ] = [ ]
@@ -609,7 +619,7 @@ let average_hash_per_sec = 0
609619let ticks_per_second = 0
610620let max_ticks_per_second = 0
611621let debug = false
612- debug = true
622+ debug = false
613623max_ticks_per_second = 20
614624let raw_tick_count = 0
615625ticks_per_second = 0
@@ -624,6 +634,7 @@ define_upgrades()
624634scene . setBackgroundColor ( 11 )
625635blockMenu . setColors ( 1 , 15 )
626636load_progress ( )
637+ make_difficulty_halving_status ( )
627638game . onUpdate ( function ( ) {
628639 sprite_cursor . top = sprite_cursor_pointer . top
629640 sprite_cursor . left = sprite_cursor_pointer . left
@@ -694,13 +705,14 @@ forever(function () {
694705} )
695706forever ( function ( ) {
696707 if ( ( Math . percentChance ( difficulty_halve_chance ) || false ) && ! ( difficulty_halving ) ) {
697- sprite_difficulty_halver = sprites . create ( assets . image `difficulty_halver` , SpriteKind . Thing )
698- sprite_difficulty_halver . z = 30
699- sprite_difficulty_halver . setPosition ( randint ( 0 , scene . screenWidth ( ) ) , randint ( 0 , scene . screenHeight ( ) ) )
700- sprite_difficulty_halver . setStayInScreen ( true )
701- sprite_difficulty_halver . startEffect ( effects . halo , 1750 )
702- sprite_difficulty_halver . lifespan = 10000
703- pause ( 10000 )
708+ timer . throttle ( "summon_difficulty_halver" , 10000 , function ( ) {
709+ sprite_difficulty_halver = sprites . create ( assets . image `difficulty_halver` , SpriteKind . Thing )
710+ sprite_difficulty_halver . z = 30
711+ sprite_difficulty_halver . setPosition ( randint ( 0 , scene . screenWidth ( ) ) , randint ( 0 , scene . screenHeight ( ) ) )
712+ sprite_difficulty_halver . setStayInScreen ( true )
713+ sprite_difficulty_halver . startEffect ( effects . halo , 1750 )
714+ sprite_difficulty_halver . lifespan = 10000
715+ } )
704716 }
705717 if ( difficulty_halving && difficulty_halve_time_left == 0 ) {
706718 Notification . waitForNotificationFinish ( )
@@ -720,3 +732,7 @@ forever(function () {
720732 }
721733 pause ( 1000 )
722734} )
735+ forever ( function ( ) {
736+ sprite_difficulty_halving_status_bar . setFlag ( SpriteFlag . Invisible , ! ( difficulty_halving ) )
737+ sprite_difficulty_halving_status_bar . value = difficulty_halve_time_left
738+ } )
0 commit comments