~rabbits/donsol

92eb8bdb07bc07de80feccd2b9983543bc31585b — neauoire 1 year, 4 months ago e18ac64
Started implementing difficulty
3 files changed, 69 insertions(+), 8 deletions(-)

M src/assets.tal
M src/main.tal
M src/strings.tal
M src/assets.tal => src/assets.tal +1 -0
@@ 96,6 96,7 @@
	0000 0000 0030 3000
@buttons-icns
	3c66 dbdb c3db 5a3c
	&b
	3c46 dbc7 dbdb 463c

@glyphs-icns

M src/main.tal => src/main.tal +67 -8
@@ 1,5 1,15 @@
( 
 ( 
	Donsol
	TODO
		- Scale progress bar for values
		- Reshuffle if first hand is impossible
		- Blink cursor when changing room
		- Run mecanics
		- Run UI
		- Restart UX
		- Win state
		- Death state
		- Difficulty settings
 )

%+  { ADD }  %-  { SUB }  %*  { MUL }  %/  { NEQ }


@@ 34,18 44,19 @@

( devices )

|00 @System     [ &vector $2 &pad     $6 &r      $2 &g     $2 &b     $2 ]
|10 @Console    [ &vector $2 &read    $1 &pad    $5 &write $1 ]
|00 @System     &vector $2 &pad     $6 &r      $2 &g     $2 &b     $2
|10 @Console    &vector $2 &read    $1 &pad    $5 &write $1
|20 @Screen     &vector $2 &width   $2 &height $2 &auto  $1 &pad   $1 &x     $2 &y $2 &addr $2 &pixel $1 &sprite $1
|80 @Controller [ &vector $2 &button  $1 &key    $1 ]
|90 @Mouse      [ &vector $2 &x       $2 &y      $2 &state $1 &chord $1 ]
|a0 @File       [ &vector $2 &success $2 &offset $2 &pad   $2 &name  $2 &length $2 &load $2 &save $2 ]
|b0 @DateTime   [ &year   $2 &month    $1 &day    $1 &hour  $1 &minute $1 &second $1 &dotw $1 &doty   $2 &isdst $1 ]
|80 @Controller &vector $2 &button  $1 &key    $1
|90 @Mouse      &vector $2 &x       $2 &y      $2 &state $1 &chord $1
|a0 @File       &vector $2 &success $2 &offset $2 &pad   $2 &name  $2 &length $2 &load $2 &save $2
|b0 @DateTime   &year   $2 &month   $1 &day    $1 &hour  $1 &minute $1 &second $1 &dotw $1 &doty   $2 &isdst $1

( variables )

|0000

@mode $1
@deck
	&length $1
	&cards $36


@@ 53,7 64,7 @@
	&hp $1 &hp-tween $1
	&sp $1 &sp-tween $1
	&dp $1 &xp $1 
	&run $1 &sick $1
	&ran $1 &sick $1
@table
	&a $1 &b $1 &c $1 &d $1 &selection $1 &timer $1
@cursor


@@ 425,8 436,45 @@ RTN

RTN

@count-monsters ( -- count )

	( create counter ) LITr 00
	#0400
	&count
		DUP .table + LDZ #36 = ,&continue JCN
		DUP .table + LDZ TOS ;card-types ++ LDA #02 < ,&continue JCN
			INCr
			&continue
		INC GTHk ,&count JCN
	POP2
	STHr

RTN

@can-run ( -- flag )

	.mode LDZ
	( When all monsters in the room have been dealt with, 
		or when the player has not escaped the previous room. )
	[ #00 !~ ] ,&no-easy JCN
		;count-monsters JSR2 .player/ran LDZ #0000 !! NIP RTN
		&no-easy
	( When the player has not escaped the previous room. )
	[ #01 !~ ] ,&no-normal JCN
		.player/ran LDZ #00 = NIP RTN
		&no-normal
	( When all monsters in the room have been dealt )
	[ #02 !~ ] ,&no-hard JCN
		;count-monsters JSR2 #00 = NIP RTN
		&no-hard
	POP

RTN

@run ( -- )

	#aa DEBUG

RTN

@play-error ( -- )


@@ 611,6 659,17 @@ RTN
		OVR2 #0020 ++ OVR2 #0010 ++ .player/xp LDZ #02 ;draw-value JSR2
		.player/xp LDZ #0a ;draw-ui-progress JSR2

	( run )
	;can-run JSR2 STH
	.frame/x LDZ2 #00a8 ++ .Screen/x DEO2
	.frame/y LDZ2 #0010 ++ .Screen/y DEO2
	;buttons-icns/b .Screen/addr DEO2
	STHkr .Screen/sprite DEO

	.frame/x LDZ2 #00b8 ++
	.frame/y LDZ2 #0010 ++
	;run-txt STHr #03 * ;draw-label JSR2

RTN

@draw-ui-progress ( x* y* value color -- )

M src/strings.tal => src/strings.tal +1 -0
@@ 29,6 29,7 @@
@hp-txt "HP $1
@sp-txt "SP $1
@xp-txt "XP $1
@run-txt "RUN $1

@card-types
	00 00 00 00 00 00 00 00 00 00 00 00 00 ( hearts )