neuttower/cheat.jor
Jeremy Penner 3de0b6fb83 Bugfixes + cheat support
* hide footer before re-enabling player movement
* close boss key file once loaded!
2020-09-06 11:11:36 -04:00

35 lines
1.1 KiB
Plaintext
Executable file

: current-cheatchar ( p -- c )
dup @ swap cell + @ + b@ ;
: cheat create 0 , latest wordname , ,
does> ( c p -- )
>r r@ current-cheatchar = if
1 r@ +!
r@ current-cheatchar 0 = if
0 r@ !
r@ 2 cells + @ execute
then
else
0 r@ !
then rdrop ;
:noname :|
disk :|
s" I don't wanna cheat" ' noop yield
s" Jump to level 1" :| hide-footer 1 queue-level |; yield
s" Jump to level 2" :| hide-footer 2 queue-level |; yield
s" Jump to level 3" :| hide-footer 3 queue-level |; yield
s" Jump to level 4" :| hide-footer 4 queue-level |; yield
s" Jump to level 5" :| hide-footer 5 queue-level |; yield
s" Jump to level 6" :| hide-footer 6 queue-level |; yield
done |; choose
|; sched ; cheat NTCHEAT
array letterkeys
30 b, 48 b, 46 b, 32 b, 18 b, 33 b, 34 b, 35 b, 23 b, 36 b, 37 b, 38 b, 50 b,
49 b, 24 b, 25 b, 16 b, 19 b, 31 b, 20 b, 22 b, 47 b, 17 b, 45 b, 21 b, 44 b,
: letter-typed
0 0 26 for letterkeys i + b@ key-released if drop i 65 + then next ;
:noname letter-typed dup if NTCHEAT else drop then ; ' cheat-tick redefine