diff --git a/GameCode.dm b/GameCode.dm index 4afa3fa3a13b61827770ca7be42373b88ebbcc5c..345cea33f8341811a042dc5a292992aa08210e9d 100644 --- a/GameCode.dm +++ b/GameCode.dm @@ -1,4 +1,4 @@ -Components +Components Players: { @@ -20,14 +20,13 @@ Cards: i = 2 while i <= 14 { MainDeck.add(newCard(suit:"diamonds", value: i, name:cardNames[i]+" of diamonds", image: i+"D.png")) - MainDeck.add(newCard(suit:"clubs", value: i, name:cardNames[i]+" of clubs", image: i+"C.png")) - MainDeck.add(newCard(suit:"hearts", value: i, name:cardNames[i]+" of hearts", image: i+"H.png")) - MainDeck.add(newCard(suit:"spades", value: i, name:cardNames[i]+" of spades", image: i+"S.png")) + MainDeck.add(newCard(suit:"clubs", value: i, name:cardNames[i]+" of clubs", image: i+"C.png")) + MainDeck.add(newCard(suit:"hearts", value: i, name:cardNames[i]+" of hearts", image: i+"H.png")) + MainDeck.add(newCard(suit:"spades", value: i, name:cardNames[i]+" of spades", image: i+"S.png")) i = i + 1 } } - Rules GameStart { @@ -63,4 +62,4 @@ Game { foreach player in players { turn(player) } -} +} \ No newline at end of file diff --git a/Uno.dm b/Uno.dm index d9eccabae9f7c4caf0ebeae9a9031d6df99b2f10..638edb2057517184cd0e78d4d62a5175dffc82fc 100644 --- a/Uno.dm +++ b/Uno.dm @@ -1,3 +1,5 @@ +# Our implementation of the cardgame Uno, written in the Deckmaster language. +# Components Decks: @@ -10,27 +12,27 @@ Cards: { i = 1 while i < 10 { - drawPile.add(newCard(color:"Red", value: i, special: "none", image: "red"+i+".png")) repeat 2 - drawPile.add(newCard(color:"Green", value: i, special: "none", image: "green"+i+".png")) repeat 2 - drawPile.add(newCard(color:"Blue", value: i, special: "none", image: "blue"+i+".png")) repeat 2 + drawPile.add(newCard(color:"Red", value: i, special: "none", image: "red"+i+".png")) repeat 2 + drawPile.add(newCard(color:"Green", value: i, special: "none", image: "green"+i+".png")) repeat 2 + drawPile.add(newCard(color:"Blue", value: i, special: "none", image: "blue"+i+".png")) repeat 2 drawPile.add(newCard(color:"Yellow", value: i, special: "none", image: "yellow"+i+".png")) repeat 2 i = i + 1 } - drawPile.add(newCard(color: "Red", value: 0, special: "Reverse", image: "redreverse.png")) repeat 2 - drawPile.add(newCard(color: "Green", value: 0, special: "Reverse", image: "greenreverse.png")) repeat 2 - drawPile.add(newCard(color: "Blue", value: 0, special: "Reverse", image: "bluereverse.png")) repeat 2 + drawPile.add(newCard(color: "Red", value: 0, special: "Reverse", image: "redreverse.png")) repeat 2 + drawPile.add(newCard(color: "Green", value: 0, special: "Reverse", image: "greenreverse.png")) repeat 2 + drawPile.add(newCard(color: "Blue", value: 0, special: "Reverse", image: "bluereverse.png")) repeat 2 drawPile.add(newCard(color: "Yellow", value: 0, special: "Reverse", image: "yellowreverse.png")) repeat 2 - drawPile.add(newCard(color: "Red", value: 0, special: "Draw +2", image: "reddraw.png")) repeat 2 - drawPile.add(newCard(color: "Green", value: 0, special: "Draw +2", image: "greendraw.png")) repeat 2 - drawPile.add(newCard(color: "Blue", value: 0, special: "Draw +2", image: "bluedraw.png")) repeat 2 - drawPile.add(newCard(color: "Yellow", value: 0, special: "Draw +2", image: "yellowdraw.png")) repeat 2 - drawPile.add(newCard(color: "Red", value: 0, special: "Skip", image: "redskip.png")) repeat 2 - drawPile.add(newCard(color: "Green", value: 0, special: "Skip", image: "greenskip.png")) repeat 2 - drawPile.add(newCard(color: "Blue", value: 0, special: "Skip", image: "blueskip.png")) repeat 2 - drawPile.add(newCard(color: "Yellow", value: 0, special: "Skip", image: "yellowskip.png")) repeat 2 - drawPile.add(newCard(color: "Wild" , value: 0, special: "Color Change", image: "wild.png")) repeat 4 - drawPile.add(newCard(color: "Wild", value: 0, special: "Draw +4", image: "wilddraw.png")) repeat 4 + drawPile.add(newCard(color: "Red", value: 0, special: "Draw +2", image: "reddraw.png")) repeat 2 + drawPile.add(newCard(color: "Green", value: 0, special: "Draw +2", image: "greendraw.png")) repeat 2 + drawPile.add(newCard(color: "Blue", value: 0, special: "Draw +2", image: "bluedraw.png")) repeat 2 + drawPile.add(newCard(color: "Yellow", value: 0, special: "Draw +2", image: "yellowdraw.png")) repeat 2 + drawPile.add(newCard(color: "Red", value: 0, special: "Skip", image: "redskip.png")) repeat 2 + drawPile.add(newCard(color: "Green", value: 0, special: "Skip", image: "greenskip.png")) repeat 2 + drawPile.add(newCard(color: "Blue", value: 0, special: "Skip", image: "blueskip.png")) repeat 2 + drawPile.add(newCard(color: "Yellow", value: 0, special: "Skip", image: "yellowskip.png")) repeat 2 + drawPile.add(newCard(color: "Wild" , value: 0, special: "Color Change", image: "wild.png")) repeat 4 + drawPile.add(newCard(color: "Wild", value: 0, special: "Draw +4", image: "wilddraw.png")) repeat 4 foreach card in drawPile { card.set("imageBack", "unocardback.png") @@ -107,7 +109,7 @@ Turn { if card.get("value") >= topCard.get("value") || card.get("value") == 0 { card_str = "Play " + cardInfo(card) - addChoice card_str { + addChoice "Play " + cardInfo(card) { if card.get("special") == "Reverse" { reverseTurnOrder() print() @@ -143,10 +145,12 @@ Turn { } } } + #this resets the color of wild cards when another card is played if topCard.get("special") == "Draw +4" || topCard.get("special") == "Color Change" { topCard.set("color", "Wild") } + player.play(card, playPile) playersPassed = 0 } diff --git a/docs/Systemdokumentation_TDP019.pdf b/docs/Systemdokumentation_TDP019.pdf index 47c2f893c2fbc559c6b6a63d3b1e15ef3fb301e3..49d5e296de0a7f892dbf84094f5a98bd50e76a17 100644 Binary files a/docs/Systemdokumentation_TDP019.pdf and b/docs/Systemdokumentation_TDP019.pdf differ