11-23-2020, 10:08 AM
Hi,
If one ludem uses a stack option, the model of the state of the game becomes a stack model. Consequently, the default behavior will be to stack the pieces (placing a piece on top of another for example rather than removing it for the flat model).
However, that does not mean you can not provided the "stack:true" parameter for the others ludemes, because that parameter modifies the result of the computation of the class corresponding to the ludeme and also of the actions computing thanks to a Move ludeme. That's why here the "stack:true" parameter is important for your game.
In looking the last submitted file, I would advice you to modify it a bit in using the "top:true" parameter of (forEach Piece) to look only the top pieces of each stack owned by the mover and to have only (from) in the (from ...) condition of "MoveWholeStack". That would make the description much nicer and efficient.
Here what I suggest:
Regards,
Eric
If one ludem uses a stack option, the model of the state of the game becomes a stack model. Consequently, the default behavior will be to stack the pieces (placing a piece on top of another for example rather than removing it for the flat model).
However, that does not mean you can not provided the "stack:true" parameter for the others ludemes, because that parameter modifies the result of the computation of the class corresponding to the ludeme and also of the actions computing thanks to a Move ludeme. That's why here the "stack:true" parameter is important for your game.
In looking the last submitted file, I would advice you to modify it a bit in using the "top:true" parameter of (forEach Piece) to look only the top pieces of each stack owned by the mover and to have only (from) in the (from ...) condition of "MoveWholeStack". That would make the description much nicer and efficient.
Here what I suggest:
Code:
(define "MoveWholeStack"
(move
(from)
(to
(sites Direction
from:(from)
stop:(is Occupied (to))
)
)
count:(size Stack at:(from))
stack:true
(then
(add (to (last To)) stack:true)
)
)
)
(game "MoveCountTestWorks"
(players 2)
(equipment
{
(board (hex 5))
(piece "Disc" Each)
(piece "Disc" Neutral)
}
)
(rules
(start {
(place "Disc1" 0)
(place "Disc2" 1)
})
(play
(forEach Piece ("MoveWholeStack") top:true)
)
(end
(if
(no Moves Next)
(result Mover Win)
)
)
)
)
Regards,
Eric