~rabbits/donsol

36fc842c1dac59a6f1fd2301f152e33706aef635 — neauoire 1 year, 4 months ago 92eb8bd
Progress on death state
3 files changed, 55 insertions(+), 15 deletions(-)

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

M src/main.tal => src/main.tal +51 -12
@@ 2,11 2,6 @@
	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


@@ 111,6 106,11 @@ BRK
	( table timer )
	.table/timer LDZ #00 = ,&no-timer JCN
		.table/timer LDZ #01 - [ DUP ] .table/timer STZ
		( blink cursor )
		.cursor/x LDZ2 .Screen/x DEO2
		.cursor/y LDZ2 .Screen/y DEO2
		#41 .table/timer LDZ #02 AND + .Screen/sprite DEO
		( auto enter )
		#00 ! ,&no-timer-end JCN
			;enter-room JSR2
			&no-timer-end


@@ 166,12 166,17 @@ BRK

@on-mouse ( -> )

	( run button )
	.Mouse/state DEI #10 ! ,&no-mouse2 JCN
		;run JSR2
		&no-mouse2

	( hover card )
	.Mouse/y DEI2 .frame/y LDZ2 #0030 ++ -- #0048 <<
	.Mouse/x DEI2 .frame/x LDZ2 -- #00e0 <<
		#0101 !! ,&no-hover JCN
			.Mouse/x DEI2 .frame/x LDZ2 -- #0038 // TOB 
			.Mouse/state DEI #00 !
			.Mouse/state DEI #01 =
				;select JSR2
			( release ) #00 .Mouse/state DEO
			&no-hover


@@ 264,6 269,13 @@ RTN

RTN

@return-card ( card -- )

	.deck/length LDZ .deck/cards + STZ
	.deck/length LDZ INC .deck/length STZ

RTN

@pick-card ( id -- )

	DUP #36 < ,&not-flipped JCN


@@ 377,12 389,12 @@ RTN

RTN

@return-card ( -- )

RTN

@select ( id state -- )

	.player/hp LDZ #00 > ,&alive JCN
		POP2 RTN
		&alive

	SWP 
	( skip changed if has state )
	OVR ,&state JCN


@@ 453,11 465,18 @@ RTN

@can-run ( -- flag )

	( can always run in first room )
	.deck/length LDZ ;count-table JSR2 #3200 !! ,&started JCN
		#01 RTN
		&started

	.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
		;count-monsters JSR2 #00 = 
		.player/ran LDZ #00 = 
			#0000 !! NIP RTN
		&no-easy
	( When the player has not escaped the previous room. )
	[ #01 !~ ] ,&no-normal JCN


@@ 473,7 492,27 @@ RTN

@run ( -- )

	#aa DEBUG
	.player/hp LDZ #00 > ,&alive JCN
		;start-game JSR2
		;dialogs/easy ;draw-dialog JSR2
		RTN
		&alive

	;can-run JSR2 ,&continue JCN
		;dialogs/cannot_run ;draw-dialog JSR2
		RTN
		&continue

	( return cards )
	#0400
	&count
		DUP .table + LDZ #36 = ,&skip JCN
		DUP .table + LDZ ;return-card JSR2
		&skip
		INC GTHk ,&count JCN
	POP2
	#01 .player/ran STZ
	;enter-room JSR2

RTN


M src/strings.tal => src/strings.tal +3 -3
@@ 18,9 18,9 @@
	&run          2333 3900 3625 3200 253b 253d 4000 0000 0000 0000 0000 0000 
	&cannot_run   2333 3900 2725 3232 3338 0036 3932 0025 3b25 3d40 0000 0000 
	( modes )
	&easy_mode    0f25 373d 0017 3328 2900 6c00 1d29 3029 2738 0027 2536 2840 
	&normal_mode  1833 3631 2530 006c 001d 2930 2927 3800 2725 3628 4000 0000 
	&hard_mode    1225 3628 0017 3328 2900 6c00 1d29 3029 2738 0027 2536 2840 
	&easy         0f25 373d 0017 3328 2900 4100 1d29 3029 2738 0027 2536 2840 
	&normal       1833 3631 2530 0041 001d 2930 2927 3800 2725 3628 4000 0000 
	&hard         1225 3628 0017 3328 2900 4100 1d29 3029 2738 0027 2536 2840 
	( etc )
	&victory      202d 2738 3336 3d00 4100 1629 253a 2900 2839 322b 2933 3240 
	&sound:ON     1d33 3932 2837 0019 183f 0000 0000 0000 0000 0000 0000 0000