db0/Dune-CCG-for-OCTGN — Issue #7: Create a petitioning process
Author: db0
Created: 2012-02-14 12:02:55+00:00
State: open
Labels: Fool Proofing, New Features

Idea on how this could work

First, a shared counter for the current value.

The petitioning will start when a player deploys an assemply card. They will be asked to confirm the first bid with an askInteger (default equal to the deployment cost of the card). A price of 0 or None will cancel the petition. The price given, will be set as the player's starting bid.

*(The card's unique ID and and deployment cost should be stored in a global variable for use later)*

Going clockwise, each player is expected to either either use the "Increase petition bid" function or pass. If they increase the bid, the script will check each other player's bid and make sure it's higher, otherwise it will re-ask the player to enter a number. 0 or None will set the counter to 0 and the player should be considered to have passed.

*(Maybe the script should announce whose turn it is to increase bid next? In that case, I first need to have a sorted players list. and a global variable with who has passed.)*

Before the askInteger(), the function shall do a check to see who has passed. If only one person remains, , the game checks the global variable for each other player. If everyone except the one calling the function is at 0, then the function will instead declare them the winner.

If the winner is an opponent, then it will take the function will automatically take an amount of solaris from their treasury equal to their bid - deployment cost, then put the card face down. If they don't have enough money, they will lose one favor per missing solaris (min 0)

If the winner is the petitioner and the card is of their own allegiance, then it will askInteger() them how much favour they want to lose to reduce the cose. The final cost will be the final bid - favour given. The card will then be moved to the middle of their play area and engaged. If the card is not of the same allegiance as the player, then they will also lose a favour.