{# Copyright 2020-2021 Ian Jackson and contributors to Otter SPDX-License-Identifier: AGPL-3.0-or-later There is NO WARRANTY. #} format=2 {% macro hand(pos, colour, lplace, edge="white", edge_width="0.75") %} [[pieces]] pos = {{pos}} colour = "{{colour}}" label.place = "{{lplace}}" label.colour = "black" type = "Hand" edge = "{{edge}}" edge_width = {{edge_width}} shape.type = "Rect" shape.xy = [93,25] {% endmacro hand %} {% macro deckplace(pos, lplace) %} [[pieces]] pos = {{pos}} type = "PickupDeck" faces = ["lightblue", "grey"] edges = ["black", "white"] label.colour = "black" label.place = "{{lplace}}" shape.type = "Rect" shape.xy = [25,30] {% endmacro deck %} {% macro some_cards() %} [[pieces]] pos = [150, 84] posd = [0, 0] type = "LibList" {% endmacro some_cards %} {% macro deck52() %} {% set suits = "c d h s" | split(pat=" ") %} {% for suffix in suits %} {{ self::some_cards() }} lib = "cards-oxymoron" prefix = "card-oxymoron-" suffix = "-{{suffix}}" items = [ "2","3","4","5","6","7","8","9","T","J","Q","K","A", ] {% endfor %} {% endmacro suit %} # -------------------- actual game spec -------------------- # table_size = [300, 200] table_colour = "#bbd" [pcaliases.card-back] type = "Lib" lib = "wikimedia" item = "card-plain-back-maroon" # pickup/play decks {{ m::deckplace(pos=[136,115], lplace="BottomLeftOutside" )}} {{ m::deckplace(pos=[162,115], lplace="BottomLeftOutside" )}} {{ m::deckplace(pos=[150, 84], lplace="TopLeftOutside" )}} # hands {{ m::hand(pos="[ 53, 25]", colour="brown" , lplace="BottomLeftOutside" )}} {{ m::hand(pos="[150, 23]", colour="red" , lplace="BottomLeftOutside" )}} {{ m::hand(pos="[247, 25]", colour="orange", lplace="BottomLeftOutside" )}} {{ m::hand(pos="[247, 70]", colour="yellow", lplace="BottomLeftOutside", edge="darkgrey", edge_width="1.0" )}} {{ m::hand(pos="[247, 130]", colour="green" , lplace="TopLeftOutside" )}} {{ m::hand(pos="[247, 175]", colour="blue" , lplace="TopLeftOutside" )}} {{ m::hand(pos="[150, 177]", colour="purple", lplace="TopLeftOutside" )}} {{ m::hand(pos="[ 53, 175]", colour="grey" , lplace="TopLeftOutside" )}} {{ m::hand(pos="[ 53, 70]", colour="black" , lplace="BottomLeftOutside" )}} {{ m::hand(pos="[ 53, 130]", colour="white" , lplace="TopLeftOutside" , edge="darkgrey", edge_width="1.0" )}} # decks of 52 {% set decks = [1,2,3] %} {% for deck in decks %} {{ m::deck52() }} {% endfor %} # jokers, on top {{ m::some_cards() }} lib = "wikimedia" prefix = "card-" items = [ {% for deck in decks %} "bellot-joker-black", "rainbow", "bellot-joker-black", {% endfor %} ]