VASSAL Reference Manual
Home > Module > Game Piece Palette > Game Piece > Mask
Mask
The Mask trait allows you to create a generic "reverse side" for pieces (like a deck of cards, or chits) which are intended to be "flipped over" to obscure their faces from opponents.
A masked piece looks different to players other than the player who hid it, but its existence remains visible to all players (unlike a piece with the Invisible trait, which would not appear at all). The Mask trait is useful for playing cards: players may drag a card face down from their hand to the playing area. The owning player will be able to see the identity of the card, but other players will only see the back until it is turned face up. Board games with a concept of concealment can also make use this trait.
Like the Invisible trait, this trait only hides traits that appear before it in the piece’s list of traits. As a general rule of thumb, it should be placed before any Invisible trait but after all other traits of the piece.
A piece with the Mask trait is "owned" by the player who masks it. If it is unmasked but then is masked again by a different player, the second player becomes the owner. Menu commands of traits hidden by a masked piece are not available to non-owning players. A setting in the Global Options determines whether non-owning players can unmask pieces.
EXAMPLE: An ordinary playing card can be implemented by setting the basic image to represent the front of the card. In the "Mask" controls, specify an image for the back of the playing card. When a player types Ctrl+F, that card will be known only to him (as though held in his hand). Typing Ctrl+F again will reveal the card to the other players (as when playing it on the table).
Deal-facedown-to-side command: When this key command is received, the piece will attempt to assign the side specified in the Deal to this side expression as the owner. Ownership will not change if the piece is already masked by a different player/side from the one executing the command, but if the piece is unmasked or else owned by current player it can be assigned ("dealt to") a player from the specified side. If the Can be masked by field is set to either Any Side or Any of the Specified Sides then the piece’s ownership will be assigned to that side. If the masking is by Any Player, however, the piece will become owned by the player currently playing that side—or if no player is currently playing that side the piece will become unmasked (unowned). Deal to this side: An expression which determines which side to assign ownership of the piece when the Deal-facedown-to-side command is received. Note that if the expression does not match any valid side from the Definition of Player Sides then ownership will not be assigned.
|
|
This trait sets the Property ObscuredToOthers=true when the piece is masked.