You've already forked pokecrystal-board
mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2025-04-09 05:44:44 -07:00
give/take coins action of blue/red space (#22)
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
GiveCoins::
|
||||
ld a, 3
|
||||
call AddCoins
|
||||
ld bc, MaxCoins
|
||||
call LoadMaxCoins_bc
|
||||
ld a, 3
|
||||
call CompareCoins
|
||||
jr z, .not_maxed_out
|
||||
jr c, .not_maxed_out
|
||||
ld hl, MaxCoins
|
||||
call LoadMaxCoins_hl
|
||||
ld a, [hli]
|
||||
ld [de], a
|
||||
inc de
|
||||
@@ -22,9 +22,26 @@ GiveCoins::
|
||||
and a
|
||||
ret
|
||||
|
||||
LoadMaxCoins_bc:
|
||||
ld a, d
|
||||
cp HIGH(wCurLevelCoins)
|
||||
ld bc, MaxCurLevelCoins ; CUR_LEVEL_COINS
|
||||
ret z
|
||||
ld bc, MaxCoins ; YOUR_COINS or MOMS_COINS
|
||||
ret
|
||||
|
||||
LoadMaxCoins_hl:
|
||||
call LoadMaxCoins_bc
|
||||
ld h, b
|
||||
ld l, c
|
||||
ret
|
||||
|
||||
MaxCoins:
|
||||
dt MAX_COINS
|
||||
|
||||
MaxCurLevelCoins:
|
||||
dt MAX_LEVEL_COINS
|
||||
|
||||
TakeCoins::
|
||||
ld a, 3
|
||||
call SubtractCoins
|
||||
|
Reference in New Issue
Block a user