home *** CD-ROM | disk | FTP | other *** search
- global gHand, gDeck, gCardSprites, gStockCard, gButton, gMessageBox, gPlayerUI
-
- on dealCardsOut
- tempCardSprites = []
- repeat with who in [#player, #dealer]
- repeat with cardIndex = 1 to gCardSprites[who].count
- tempCardSprites.add(gCardSprites[who][cardIndex])
- end repeat
- end repeat
- repeat while gHand[#player].returnCardCount() < 5
- repeat while gStockCard.loc <> gStockCard.pOriginalLoc
- updateStage()
- end repeat
- gHand[#player].addCard(gDeck._DrawCard())
- puppetSound(4, "deal card")
- repeat while not gHand[#player].throwComplete(gStockCard, tempCardSprites[gHand[#player].returnCardCount()])
- gHand[#player].throwCard(gStockCard, tempCardSprites[gHand[#player].returnCardCount()])
- updateStage()
- end repeat
- gStockCard.visible = 0
- tempCardSprites[gHand[#player].returnCardCount()].member = member(gHand[#player]._cards[gHand[#player].returnCardCount()].mGetImage())
- gStockCard.loc = gStockCard.pOriginalLoc
- gStockCard.visible = 1
- updateStage()
- end repeat
- repeat while gHand[#dealer].returnCardCount() < 5
- repeat while gStockCard.loc <> gStockCard.pOriginalLoc
- updateStage()
- end repeat
- gHand[#dealer].addCard(gDeck._DrawCard())
- puppetSound(4, "deal card")
- repeat while not gHand[#dealer].throwComplete(gStockCard, tempCardSprites[gHand[#player].returnCardCount() + gHand[#dealer].returnCardCount()])
- gHand[#player].throwCard(gStockCard, tempCardSprites[gHand[#player].returnCardCount() + gHand[#dealer].returnCardCount()])
- updateStage()
- end repeat
- gStockCard.visible = 0
- if gHand[#dealer].returnCardCount() < 5 then
- tempCardSprites[gHand[#player].returnCardCount() + gHand[#dealer].returnCardCount()].member = member("backofcard")
- else
- tempCardSprites[gHand[#player].returnCardCount() + gHand[#dealer].returnCardCount()].member = member(gHand[#dealer]._cards[gHand[#dealer].returnCardCount()].mGetImage())
- end if
- gStockCard.loc = gStockCard.pOriginalLoc
- gStockCard.visible = 1
- updateStage()
- end repeat
- gPlayerUI[#callbet].toggleActive(#on)
- gPlayerUI[#fold].toggleActive(#on)
- gMessageBox.text = "Please call the bet or fold"
- end
-