[messages] Edit: Re: [Module Design] how to count property of cards in player window / hand

grouchysmurf lgrabun at gmail.com
Mon May 29 12:21:21 CEST 2017

[This message has been edited.]

In Pax Renaissance card bear different values / traits--some of these
traits may be counted toward victory. I want to collate a report that
would display who has how many points counting toward victory. Without
loss of generality let's assume there is just one such trait and let's
call it Z.

Cards will be placed in player window (called tableau). Player would
purchase cards from the market, by right clicking on them, sending them
to his tableau. Player could also discard a card from his tableau,
moving it to discard pile. Again, this would be a new action in
right-button menu. The tableau would be a free movement window--i.e. no
grid, no resrtrictions on how card can be placed / moved. The placement
of the cards in Pax Renaissance is liquid: the may be placed next to
each other, or below, or can be rotated and placed one on the
other--while it can be implemented into Vassal, the benefit is too
little for the effort.

Each player has access to other players' tableaus. It can open it and
discard his / her cards--as one of the actions he can take during his

I know how to calculate total Zs of all the cards in the player tableau.
I know how to calculate total of Zs when a card is discarded. (There
would be a number of Global Properties, one for each player, P1, P2, P3,
P4, called PnZ, where n is the number of the player; I would updated the
PnZ accordingly--that is fine).

How do I update the PnZ when the player MANUALLY moves the card from his
tableau to the discard pile? Even if a discard pile would be a deck on
the main map, and I would somehow capture all the cards ending the
movement in the discard pile, a card can be moved first to the map and
only then dragged to the discard pile.


My approach would as follows: there would be a dynamic property called
"owner" which would indicate owner of the card i.e. to which tableu it
belongs currently (Pn). If empty, than there is no owner.

I would implement a set of triggers to cover following conditions (under
the same key command):

1. __owner=="" && CurrentMap~Pn__ => set owner to Pn, increase PnZ (for
each n);
2. __owner=="Pn" && (CurrentMap=="Pa" || CurrentMap=="Pb" ||
CurrentMap=="Pc")__, where a, b, c all are not equal to n => decrease
PnZ, set owner to Pa or Pb or Pc, respectively, increase PaZ, PbZ, PcZ,
3. __owner=="Pn"	&& CurrentMap!="P1" && CurrentMap!="P2" &&
CurrentMap!="P3" && CurrentMap!="P4"__ => set owner to "", decrease PnZ.

I think that would work. Your comments?

Read this topic online here:

More information about the messages mailing list