You may recongnize this from a game you already know. I based alot of this on a game I played on newsground once. Don't know the name anymore though. I played it twice I believe, and than started programming.
So yeah, the game is pretty based on this. I am trying to add more things to it, and change some essential things for the strategy.
That game also just took a TCG and changed some essential things, resulting in a new TCG. That's the way it goes
;==========================================================
; Shuffle Routine
; ---------------
; Shuffles an array of any length (max. 255).
; Thanks to tr1p1ea and Jim E! :D
; Use hl as input for the Array you want to sort
; !!! Use 255 as end marker in the array !!!
;==========================================================
lblShuffle:
ld d,h
ld e,l
;-- Count the cards in the array --
ld b,$00
lblShuffleCountCardsLoop:
ld a,(hl)
inc b
inc hl
cp 255
jr nz,lblShuffleCountCardsLoop
dec b
ld a,b
ld (CardsInArray),a
ld h,d
ld l,e
;------------------------------------------
lblShuffleLoop:
;-- Copy current card position to de --
push hl
push de
ld d,h
ld e,l
;------------------------------------------
;--Search random position to shuffle with--
ld a,(CardsInArray)
ld b,a
call ionrandom
ld b,$00
ld c,a
pop hl
push hl
add hl,bc
;------------------------------------------
;-- Shuffle values of both positions --
ld b,(hl)
ld a,(de)
ex de,hl
ld (de),a
ld (hl),b
;------------------------------------------
;-- Go to next position --
pop de
pop hl
inc hl
ld a,(hl)
cp 255
ret z
jr lblShuffleLoop
;------------------------------------------
Here you go. The game won't be open source due security reasons when trading and stuff...
It would be cool to include money and buying booster packs and decks (and trading of course). It could be like an RPG. I remember how fun it was to get a new booster pack, so don't forget to include that element. Maybe you could have randomly generated cards too.
It wasn't nearly as good as the mother of all tgc... magic... furthermore is this game not based on summoning creature's... so it's impossible to implement pokemon