~rabbits/donsol

667a607adaae1a794aaccc552663ebc9a14d13de — neauoire 1 year, 4 months ago b48fc69
Added victory state
2 files changed, 19 insertions(+), 23 deletions(-)

M src/main.tal
M src/strings.tal
M src/main.tal => src/main.tal +18 -22
@@ 229,6 229,9 @@ RTN
		#00 ! ,&no-timer-end JCN
			;enter-room JSR2
			&no-timer-end
		.player/xp LDZ #36 < ,&no-end JCN
			;dialogs/victory ;draw-dialog JSR2
			&no-end
		&no-timer

	( tween )


@@ 378,8 381,11 @@ RTN

@pull-card ( -- card )

	.deck/cards LDZ
	.deck/length LDZ #01 - .deck/length STZ
	.deck/length LDZ ,&continue JCN
		#36 RTN
		&continue
	( pull ) .deck/cards LDZ
	( decr ) .deck/length LDZ #01 - .deck/length STZ
	( shift left )
	#3600
	&loop


@@ 410,6 416,7 @@ RTN
	DUP #36 < ,&not-flipped JCN
		POP RTN
		&not-flipped
	( set xp ) .player/xp LDZ INC .player/xp STZ
	DUP TOS ;card-types ++ LDA
	( route card type )
	DUP #00 = ;pick-potion JCN2


@@ 432,8 439,6 @@ RTN
	( get ) TOS ;card-values ++ LDA .player/hp LDZ +
	( set ) #15 LTHk SWP? POP .player/hp STZ
	( set sick ) #01 .player/sick STZ
	( set xp ) .player/xp LDZ INC .player/xp STZ
	;draw-status JSR2
	;dialogs/potion ;draw-dialog JSR2
	;play-potion JSR2



@@ 446,8 451,6 @@ RTN
	( set ) .player/sp STZ 
	( set max durability ) #16 .player/dp STZ
	( set sick ) #00 .player/sick STZ
	( set xp ) .player/xp LDZ INC .player/xp STZ
	;draw-status JSR2
	;dialogs/shield ;draw-dialog JSR2
	;play-shield JSR2



@@ 457,14 460,12 @@ RTN

	POP
	( set sick ) #00 .player/sick STZ
	( set xp ) .player/xp LDZ INC .player/xp STZ
	( get ) TOS ;card-values ++ LDA
	.player/sp LDZ ,&shielding JCN

	&unshielded
		( damages ) ;take-damages JSR2
		( test death ) .player/hp LDZ #00 = ;&death JCN2
		;draw-status JSR2
		;dialogs/unshielded ;draw-dialog JSR2
		;play-attack JSR2
		RTN


@@ 475,7 476,6 @@ RTN
		( durability ) DUP .player/dp STZ
		( damages ) .player/sp LDZ - ;take-damages JSR2
		( test death ) .player/hp LDZ #00 = ,&death JCN
		;draw-status JSR2
		;dialogs/damages ;draw-dialog JSR2
		;play-shielding JSR2
		RTN


@@ 484,14 484,12 @@ RTN
		( break shield ) #00 DUP .player/sp STZ .player/dp STZ
		( damages ) ;take-damages JSR2
		( test death ) .player/hp LDZ #00 = ,&death JCN
		;draw-status JSR2
		;dialogs/breaking ;draw-dialog JSR2
		;play-breaking JSR2
		RTN

	&blocking ( value -- )
		( durability ) .player/dp STZ
		;draw-status JSR2
		;dialogs/blocking ;draw-dialog JSR2
		;play-blocking JSR2
		RTN


@@ 537,6 535,7 @@ RTN
	OVR #00 = ,&no-use JCN
		DUP .table + LDZ ;pick-card JSR2
		DUP ;flip-card JSR2
		;draw-status JSR2
		&no-use

	4MOD .table/selection STZ


@@ 549,7 548,6 @@ RTN

	( already flipped )
	DUP .table + LDZ #36 ! ,&continue JCN
		#bb DEBUG
		POP RTN
		&continue



@@ 625,23 623,21 @@ RTN

	( in lobby )
	.deck/length LDZ ;count-table JSR2 #3200 !! ,&started JCN
		;start-game JSR2
		;dialogs/easy ;draw-dialog JSR2
		RTN
		;start-game JSR2 RTN
		&started

	( when dead )
	.player/hp LDZ #00 > ,&alive JCN
		;start-game JSR2
		;dialogs/easy ;draw-dialog JSR2
		RTN
		;start-game JSR2 RTN
		&alive

	( when finished )
	.player/xp LDZ #36 < ,&incomplete JCN
		;start-game JSR2 RTN
		&incomplete
	( cannot run )
	;can-run JSR2 ,&continue JCN
		;dialogs/cannot_run ;draw-dialog JSR2
		RTN
		&continue

	( return cards )
	#0400
	&count


@@ 836,7 832,7 @@ RTN
	.frame/y LDZ2 
		OVR2 OVR2 #0010 ++ ;xp-txt #02 ;draw-label JSR2
		OVR2 #0020 ++ OVR2 #0010 ++ .player/xp LDZ #02 ;draw-value JSR2
		.player/xp LDZ [ TOS ;hp-ratios ++ LDA ] #0a ;draw-ui-progress JSR2
		.player/xp LDZ [ TOS ;xp-ratios ++ LDA ] #0a ;draw-ui-progress JSR2

	( run )
	;can-run JSR2 STH

M src/strings.tal => src/strings.tal +1 -1
@@ 68,7 68,7 @@
	09 10 10 11 12 12 13 14 14 15 16 16 17
	18 19 19 1a 1a 1b 1b 1c 1c 1d 1d 1e 1e
	21 22 22 23 23 24 24 25 25 26 26 27 27
	28 28 29
	28 28 29 29

@cards
	&h01 "White_Mage_11 $1   &d01 "Red_Mage_11 $1     &s01 "Empress_17 $1  &c01 "Empress_17 $1