Bugfixes + cheat support

* hide footer before re-enabling player movement
* close boss key file once loaded!
This commit is contained in:
Jeremy Penner 2020-09-06 11:11:36 -04:00
parent f86798a26d
commit 3de0b6fb83
29 changed files with 45 additions and 1 deletions

BIN
boot.jim

Binary file not shown.

BIN
cheat.jim Executable file

Binary file not shown.

34
cheat.jor Executable file
View file

@ -0,0 +1,34 @@
: 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

BIN
debug.jim

Binary file not shown.

BIN
defs.jim

Binary file not shown.

BIN
end.jim

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
game.jim

Binary file not shown.

View file

@ -1,4 +1,5 @@
( T I C K )
defer cheat-tick
defer party
defer entities
var objects
@ -248,6 +249,7 @@ defer reset-level userword
player-tick
boss-tick
quit-tick
cheat-tick
ticking-objects @ if
ticking-objects @ links
@ -513,5 +515,5 @@ Gord @ const gord-listener
gord-follow? if Gord yield then
done |; ' party redefine
:| ' mode-wait ' tick redefine |; ' any-job-started redefine
:| ' mode-move ' tick redefine hide-footer |; ' all-jobs-complete redefine
:| hide-footer ' mode-move ' tick redefine |; ' all-jobs-complete redefine
; ' onload redefine

BIN
input.jim

Binary file not shown.

BIN
jiles.jim

Binary file not shown.

BIN
job.jim

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
level.jim

Binary file not shown.

BIN
map.jim

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
sound.jim

Binary file not shown.

View file

@ -6,6 +6,7 @@
s" job.jor" loadfile
s" level.jor" loadfile
s" game.jor" loadfile
s" cheat.jor" loadfile
; execute
task :noname activate blah begin draw suspend again ; execute

BIN
state.jim

Binary file not shown.

View file

@ -241,6 +241,7 @@ void showtextscreen(char* filename) {
f = fopen(filename, "rb");
freadfar(f, MK_FP(0xb800, 0), 4000);
gotoxy(1, 24);
fclose(f);
}
void shownag() {
vid_cleanup();
@ -318,6 +319,11 @@ void f_keyWasPressed() {
consumeKey(k);
}
void f_keyWasReleased() {
int k = TOP().i;
TOP().i = keyWasReleased(k);
}
void f_keyIsDown() {
TOP().i = keyIsDown(TOP().i);
}
@ -823,6 +829,7 @@ void game_f_init(char *exe, char *bootjor) {
CDEF("seremit", f_seremit);
CDEF("key-pressed", f_keyWasPressed);
CDEF("key-down", f_keyIsDown);
CDEF("key-released", f_keyWasReleased);
CDEF("key-start", kbd_init);
CDEF("key-end", kbd_cleanup);
CDEF("draw-sprite", f_drawSprite);

BIN
timer.jim

Binary file not shown.

BIN
title.jim

Binary file not shown.