<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="gl">
	<id>https://gl.doc.boardgamearena.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Quietmint</id>
	<title>Board Game Arena - Contribucións do/a usuario/a [gl]</title>
	<link rel="self" type="application/atom+xml" href="https://gl.doc.boardgamearena.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Quietmint"/>
	<link rel="alternate" type="text/html" href="https://gl.doc.boardgamearena.com/Especial:Contribuci%C3%B3ns/Quietmint"/>
	<updated>2026-09-24T00:59:55Z</updated>
	<subtitle>Contribucións do/a usuario/a</subtitle>
	<generator>MediaWiki 1.39.0</generator>
	<entry>
		<id>https://gl.doc.boardgamearena.com/index.php?title=Gamehelpcoupcitystate&amp;diff=3302</id>
		<title>Gamehelpcoupcitystate</title>
		<link rel="alternate" type="text/html" href="https://gl.doc.boardgamearena.com/index.php?title=Gamehelpcoupcitystate&amp;diff=3302"/>
		<updated>2018-12-25T07:33:38Z</updated>

		<summary type="html">&lt;p&gt;Quietmint: Remove rounds to win&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
In Coup, players vie for control of a corrupt city-state in renaissance Italy. Through your influence in the court (the character cards in your hand), bluff, steal, and murder your opponents to become the last player standing and rise to power. There is no second place.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
The 15-card deck contains 3 copies of 5 different characters (&#039;&#039;Ambassador&#039;&#039;, &#039;&#039;Assassin&#039;&#039;, &#039;&#039;Captain&#039;&#039;, &#039;&#039;Contessa&#039;&#039;, &#039;&#039;Duke&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
Each player begins with ₤2 (or ₤1 in a two-player game) and 2 cards. Money is public knowledge, but character cards in hand are secret.&lt;br /&gt;
&lt;br /&gt;
== Actions ==&lt;br /&gt;
On your turn, take any action you can afford:&lt;br /&gt;
&lt;br /&gt;
=== General actions (always available) ===&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Income&#039;&#039;&#039;: Take ₤1 from the treasury. Cannot be blocked.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Foreign Aid&#039;&#039;&#039;: Take ₤2 from the treasury. Any player claiming to be the &#039;&#039;Duke&#039;&#039; can block.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Coup&#039;&#039;&#039;: Pay ₤7 to the treasury and make another player lose influence (kill a character card). Cannot be blocked. If you start your turn with ₤10, you must choose this action.&lt;br /&gt;
&lt;br /&gt;
=== Character actions (must claim to have that character card in hand) ===&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Tax&#039;&#039;&#039; (as the &#039;&#039;Duke&#039;&#039;): Take ₤3 from the treasury. Cannot be blocked.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Steal&#039;&#039;&#039; (as the &#039;&#039;Captain&#039;&#039;): Take ₤2 from another player. The targeted player can block by claiming to be the &#039;&#039;Ambassador&#039;&#039;/&#039;&#039;Inquisitor&#039;&#039; or the &#039;&#039;Captain&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Exchange&#039;&#039;&#039; (as the &#039;&#039;Ambassador&#039;&#039;): Draw 2 cards from the court deck, then return 2 cards to the deck. Cannot be blocked.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Assassinate&#039;&#039;&#039; (as the &#039;&#039;Assassin&#039;&#039;): Pay ₤3 to the treasury and make another player lose influence (kill a character card). The targeted player can block by claiming to be the &#039;&#039;Contessa&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Challenges ==&lt;br /&gt;
&lt;br /&gt;
Any player making a character claim can be challenged. A challenge always results in one player losing a character. The challenged player reveals a card from his/her hand.&lt;br /&gt;
&lt;br /&gt;
• If bluffing, the revealed card is killed.&lt;br /&gt;
&lt;br /&gt;
• If truthful, the revealed card is shuffled into the deck, replaced, and the challenger kills a card from his/her hand.&lt;br /&gt;
&lt;br /&gt;
Dead character cards remain face-up and their influence can no longer be used. If both of your characters die, you&#039;re eliminated. The last player remaining wins!&lt;br /&gt;
&lt;br /&gt;
== Variant: Factions ==&lt;br /&gt;
&lt;br /&gt;
This variant divides players into two factions (teams), the Monarchists and the Populists. As long as there are two factions, players cannot block or target their teammates (however, &#039;&#039;&#039;Convert&#039;&#039;&#039; and challenges are always allowed). If there is only one faction in play, infighting takes over and no restriction applies.&lt;br /&gt;
&lt;br /&gt;
=== Additional actions ===&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Convert&#039;&#039;&#039;: Pay ₤1 to the almshouse to change your own faction, or pay ₤2 to the almshouse to change another player&#039;s faction. Cannot be blocked.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Embezzle&#039;&#039;&#039; (any character except the &#039;&#039;Duke&#039;&#039;): Take all coins from the almshouse if you are NOT the &#039;&#039;Duke&#039;&#039;. Cannot be blocked.&lt;br /&gt;
&lt;br /&gt;
If the &#039;&#039;&#039;Embezzle&#039;&#039;&#039; action is challenged, the challenged player reveals both cards in hand. If any &#039;&#039;Dukes&#039;&#039; are revealed (bluffing), one is killed (any other revealed card is shuffled into the deck and replaced). Otherwise (truthful), both revealed cards are shuffled into the deck, replaced, and the challenger kills a card from his/her hand as normal.&lt;br /&gt;
&lt;br /&gt;
== Variant: Inquisitor ==&lt;br /&gt;
&lt;br /&gt;
This variant replaces the &#039;&#039;Ambassador&#039;&#039; character with the &#039;&#039;Inquisitor&#039;&#039;. The &#039;&#039;Inquisitor&#039;&#039; still blocks stealing and has two character actions:&lt;br /&gt;
&lt;br /&gt;
=== Replacement character actions ===&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Exchange&#039;&#039;&#039; (as the &#039;&#039;Inquisitor&#039;&#039;): Draw 1 card from the court deck, then return 1 card to the deck. Cannot be blocked.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Examine&#039;&#039;&#039; (as the &#039;&#039;Inquisitor&#039;&#039;): Secretly look at 1 card in another player&#039;s hand. Choose whether to return the card to the owner or force the owner to exchange it with the court deck. Cannot be blocked.&lt;/div&gt;</summary>
		<author><name>Quietmint</name></author>
	</entry>
	<entry>
		<id>https://gl.doc.boardgamearena.com/index.php?title=Game_art:_img_directory&amp;diff=3280</id>
		<title>Game art: img directory</title>
		<link rel="alternate" type="text/html" href="https://gl.doc.boardgamearena.com/index.php?title=Game_art:_img_directory&amp;diff=3280"/>
		<updated>2018-11-25T18:33:22Z</updated>

		<summary type="html">&lt;p&gt;Quietmint: /* Use CSS Sprites */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Requested images ==&lt;br /&gt;
&lt;br /&gt;
The following images are requested by BGA:&lt;br /&gt;
&lt;br /&gt;
;game_box.png&lt;br /&gt;
* It is displayed on the main site on the game description page and when creating a table (280x280 px).&lt;br /&gt;
* It should be a 3D image of a physical copy of the game box as it appears in an online shop.&lt;br /&gt;
* It is better to take the version of the game that is coherent with the game art used in the adaptation, and from the original publisher of the game.&lt;br /&gt;
* The background of the image must be transparent.&lt;br /&gt;
* If you don&#039;t have a 3D version of the game box, you can use the following website to create one: http://www.3d-pack.com/&lt;br /&gt;
&lt;br /&gt;
;game_box180.png&lt;br /&gt;
;game_box75.png&lt;br /&gt;
&lt;br /&gt;
* Don&#039;t modify these images, they are auto generated by &amp;quot;Reload game box image&amp;quot; action. If you have another copy of your source make sure you update you copy of these files after they have been generated and not override with old copied.&lt;br /&gt;
&lt;br /&gt;
;game_icon.png&lt;br /&gt;
&lt;br /&gt;
* It is the icon displayed in the lists of games and tables (50x50 px).&lt;br /&gt;
* The objective of this icon is to make the game recognizable among the other games. A good idea is to take a part of the game cover that is distinctive (ex: the game title).&lt;br /&gt;
* This one  does not have to be transparent. This image should not have a border &lt;br /&gt;
&lt;br /&gt;
;publisher.png&lt;br /&gt;
* It is the logo of the publisher of the game, displayed on the game description page.&lt;br /&gt;
* The width must be 150 px. The height can be anything (reasonable). The image could be transparent.&lt;br /&gt;
&lt;br /&gt;
;publisher2.png (optional)&lt;br /&gt;
* If the game has been co-published by 2 publishers, you should upload a second image named &amp;quot;publisher2.png&amp;quot; (same characteristics as the first one).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important&#039;&#039;&#039;: when you modify these images, you MUST click on &amp;quot;Reload game box image&amp;quot; from the Control Panel in order your update can be taken into account.&lt;br /&gt;
&lt;br /&gt;
== Game art ==&lt;br /&gt;
&lt;br /&gt;
You must upload in img directory all images of your game interface.&lt;br /&gt;
&lt;br /&gt;
=== Images loading ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Be careful&#039;&#039;&#039;: by default, ALL images of your img directory are loaded on a player&#039;s browser when he loads the game. For this reason, don&#039;t let in your img directory images that are not useful, otherwise it&#039;s going to slowdown the game load.&lt;br /&gt;
&lt;br /&gt;
Note that you can tune the way images are loaded with Javascript method &amp;quot;dontPreloadImage&amp;quot; (see [[Game_interface_logic:_yourgamename.js|Game Interface Logic]]).&lt;br /&gt;
&lt;br /&gt;
General recommendation it to have no more than dozen of image files, 2Mb max each. However if there is heavy game resources specific to a player (i.e. player board of specific color or set of cards) it is better to separate them and &amp;quot;don&#039;t pre-load&amp;quot; since in any given game only some of them will be used.&lt;br /&gt;
&lt;br /&gt;
=== Images format ===&lt;br /&gt;
&lt;br /&gt;
You can use 3 image format while building your game interface:&lt;br /&gt;
;jpg images&lt;br /&gt;
&lt;br /&gt;
should be used for non-transparent images. Jpg are usually lighter than Pngs, so please choose Jpg for big pictures (ex: game board, cards) when you don&#039;t need transparency to accelerate game load.&lt;br /&gt;
&lt;br /&gt;
;png images&lt;br /&gt;
&lt;br /&gt;
should be used for transparent images.&lt;br /&gt;
&lt;br /&gt;
;gif images&lt;br /&gt;
&lt;br /&gt;
can be used for animated images. This is not recommended to use gif animated images as they can upset players, but for some specific interface element this could be useful.&lt;br /&gt;
&lt;br /&gt;
=== Use CSS Sprites ===&lt;br /&gt;
&lt;br /&gt;
To limit the number of images load and make the game load faster, you must use CSS sprites, i.e. you must gather several images in a single one. However, there are limitations. Do not make any CSS image sprite with dimensions that exceed 4096x4096 pixels or it will not work on mobile devices (Android max texture size is 4096 pixels, test your own browser at [http://webglreport.com/ WebGL Report]).&lt;br /&gt;
&lt;br /&gt;
To learn more on CSS Sprites:&lt;br /&gt;
* [http://www.w3schools.com/css/css_image_sprites.asp CSS sprites (W3C documentation)].&lt;br /&gt;
* [[Game interface stylesheet: yourgamename.css]]&lt;br /&gt;
&lt;br /&gt;
=== Shrink images ===&lt;br /&gt;
&lt;br /&gt;
If you get high resolution images from publisher you need to shrink them since web display requires much lower resolution than printing.&lt;br /&gt;
&lt;br /&gt;
* Shrink images without loss of quality https://tinypng.com/ or http://www.iloveimg.com/&lt;br /&gt;
&lt;br /&gt;
== Image Manipulation Tools ==&lt;br /&gt;
&lt;br /&gt;
You have no choice but to use one of the image manipulating tools to create a successful game adaptation, you would have to&lt;br /&gt;
deal with&lt;br /&gt;
* Converting to supported formats&lt;br /&gt;
* Adding transparency &lt;br /&gt;
* Stitching&lt;br /&gt;
* Shrinking with no quality loss&lt;br /&gt;
* Resizing&lt;br /&gt;
&lt;br /&gt;
For that you need a good tools, recommended tools (if you know more add them here)&lt;br /&gt;
* Gimp (linux) - general GUI image editor&lt;br /&gt;
* Paint.net (Windows) - general GUI image editor&lt;br /&gt;
* ImageMagic (All platforms) - https://www.imagemagick.org/script/download.php - command line image editor, great for mass manipulations and scripting&lt;/div&gt;</summary>
		<author><name>Quietmint</name></author>
	</entry>
	<entry>
		<id>https://gl.doc.boardgamearena.com/index.php?title=Gamehelptaluva&amp;diff=3265</id>
		<title>Gamehelptaluva</title>
		<link rel="alternate" type="text/html" href="https://gl.doc.boardgamearena.com/index.php?title=Gamehelptaluva&amp;diff=3265"/>
		<updated>2018-11-12T05:57:44Z</updated>

		<summary type="html">&lt;p&gt;Quietmint: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== System Compatibility ==&lt;br /&gt;
This game requires 3D mode. [https://www.google.com/chrome/ Google Chrome] is the recommended browser for best performance and highest image quality. It is &#039;&#039;&#039;not recommended&#039;&#039;&#039; to play on smartphones or tablets.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
In Taluva, players build temples, towers, and huts to settle a volcanic island emerging from the South Pacific. The game ends in an early victory if a player builds &#039;&#039;&#039;all buildings of two types&#039;&#039;&#039;. Otherwise, the game ends when no tiles remain and the winner is the player who built the most &#039;&#039;&#039;temples&#039;&#039;&#039; (in case of a tie, the most &#039;&#039;&#039;towers&#039;&#039;&#039; and then the most &#039;&#039;&#039;huts&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
Each player receives 3 temples, 2 towers, and 20 huts.&lt;br /&gt;
&lt;br /&gt;
12 tiles per player are shuffled to form a draw pile. Each tile is composed of 3 hexagon spaces: A volcano and two other terrain types (from most common to least: jungle, clearing, sand, rock, lake).&lt;br /&gt;
&lt;br /&gt;
== Place A Tile ==&lt;br /&gt;
&lt;br /&gt;
Begin your turn by drawing and placing a tile. Click the space on the board where you want to place the volcano. Choose from one of two options:&lt;br /&gt;
&lt;br /&gt;
=== Expand the landscape ===&lt;br /&gt;
Place your tile on the edge of the island adjacent to any existing tile.&lt;br /&gt;
&lt;br /&gt;
=== Volcanic eruption ===&lt;br /&gt;
Place your tile on top of two existing tiles so the volcano covers another volcano. Your tile must have a different rotation than the tile below and cannot overhang the ocean. You may destroy huts as long as you do not destroy an entire settlement (see below). Destroyed huts remain out of play.&lt;br /&gt;
&lt;br /&gt;
== Build Buildings ==&lt;br /&gt;
&lt;br /&gt;
End your turn by building one or more buildings on empty space(s) of any terrain type except volcano. A chain of your adjacent buildings forms a &#039;&#039;settlement&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Choose from one of four options:&lt;br /&gt;
&lt;br /&gt;
=== New settlement ===&lt;br /&gt;
&lt;br /&gt;
* Begin a new settlement by placing a &#039;&#039;&#039;hut&#039;&#039;&#039; on a first-level space not adjacent to any of your existing settlements.&lt;br /&gt;
&lt;br /&gt;
=== Expand settlement ===&lt;br /&gt;
&lt;br /&gt;
* Expand an existing settlement by choosing a terrain type. On all adjacent spaces of that type, build &#039;&#039;&#039;huts&#039;&#039;&#039; equal to the height (one hut on first-level spaces, two huts on second-level spaces, etc.). You must have enough huts to build on all eligible spaces. In the example below, the red player can build 2 huts on lakes (one on each) or 1 hut on sand (but cannot build only 1 hut on lake).&lt;br /&gt;
[[File:Taluva-expand.png]]&lt;br /&gt;
&lt;br /&gt;
=== Temple ===&lt;br /&gt;
&lt;br /&gt;
* Build a &#039;&#039;&#039;temple&#039;&#039;&#039; adjacent to one of your existing settlements occupying 3 or more spaces that does not already contain a temple. In the previous example, the red player could build a temple on sand if she built huts on both lakes in a prior turn. Note that it is the number of &#039;&#039;spaces&#039;&#039;, not buildings, that determines whether a temple can be built in the settlement.&lt;br /&gt;
&lt;br /&gt;
=== Tower ===&lt;br /&gt;
* Build a &#039;&#039;&#039;tower&#039;&#039;&#039; on a third-level space (or higher) adjacent to one of your existing settlements that does not already contain a tower.&lt;br /&gt;
&lt;br /&gt;
You are allowed to build in such a way that two of your settlements join together, such that there are two temples or two towers in the same settlement, for example.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Beware! If you cannot build, you will be eliminated from the game.&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Quietmint</name></author>
	</entry>
	<entry>
		<id>https://gl.doc.boardgamearena.com/index.php?title=Gamehelptaluva&amp;diff=3264</id>
		<title>Gamehelptaluva</title>
		<link rel="alternate" type="text/html" href="https://gl.doc.boardgamearena.com/index.php?title=Gamehelptaluva&amp;diff=3264"/>
		<updated>2018-11-11T15:18:28Z</updated>

		<summary type="html">&lt;p&gt;Quietmint: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== System Compatibility ==&lt;br /&gt;
This game requires 3D mode. It is &#039;&#039;&#039;not recommended&#039;&#039;&#039; to play on smartphones or tablets due to the performance requirements. On desktop, [https://www.google.com/chrome/ Google Chrome] is the recommended browser.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
In Taluva, players build temples, towers, and huts to settle a volcanic island emerging from the South Pacific. The game ends in an early victory if a player builds &#039;&#039;&#039;all buildings of two types&#039;&#039;&#039;. Otherwise, the game ends when no tiles remain and the winner is the player who built the most &#039;&#039;&#039;temples&#039;&#039;&#039; (in case of a tie, the most &#039;&#039;&#039;towers&#039;&#039;&#039; and then the most &#039;&#039;&#039;huts&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
Each player receives 3 temples, 2 towers, and 20 huts.&lt;br /&gt;
&lt;br /&gt;
12 tiles per player are shuffled to form a draw pile. Each tile is composed of 3 hexagon spaces: A volcano and two other terrain types (from most common to least: jungle, clearing, sand, rock, lake).&lt;br /&gt;
&lt;br /&gt;
== Place A Tile ==&lt;br /&gt;
&lt;br /&gt;
Begin your turn by drawing and placing a tile. Click the space on the board where you want to place the volcano. Choose from one of two options:&lt;br /&gt;
&lt;br /&gt;
=== Expand the landscape ===&lt;br /&gt;
Place your tile on the edge of the island adjacent to any existing tile.&lt;br /&gt;
&lt;br /&gt;
=== Volcanic eruption ===&lt;br /&gt;
Place your tile on top of two existing tiles so the volcano covers another volcano. Your tile must have a different rotation than the tile below and cannot overhang the ocean. You may destroy huts as long as you do not destroy an entire settlement (see below). Destroyed huts remain out of play.&lt;br /&gt;
&lt;br /&gt;
== Build Buildings ==&lt;br /&gt;
&lt;br /&gt;
End your turn by building one or more buildings on empty space(s) of any terrain type except volcano. A chain of your adjacent buildings forms a &#039;&#039;settlement&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Choose from one of four options:&lt;br /&gt;
&lt;br /&gt;
=== New settlement ===&lt;br /&gt;
&lt;br /&gt;
* Begin a new settlement by placing a &#039;&#039;&#039;hut&#039;&#039;&#039; on a first-level space not adjacent to any of your existing settlements.&lt;br /&gt;
&lt;br /&gt;
=== Expand settlement ===&lt;br /&gt;
&lt;br /&gt;
* Expand an existing settlement by choosing a terrain type. On all adjacent spaces of that type, build &#039;&#039;&#039;huts&#039;&#039;&#039; equal to the height (one hut on first-level spaces, two huts on second-level spaces, etc.). You must have enough huts to build on all eligible spaces. In the example below, the red player can build 2 huts on lakes (one on each) or 1 hut on sand (but cannot build only 1 hut on lake).&lt;br /&gt;
[[File:Taluva-expand.png]]&lt;br /&gt;
&lt;br /&gt;
=== Temple ===&lt;br /&gt;
&lt;br /&gt;
* Build a &#039;&#039;&#039;temple&#039;&#039;&#039; adjacent to one of your existing settlements occupying 3 or more spaces that does not already contain a temple. In the previous example, the red player could build a temple on sand if she built huts on both lakes in a prior turn. Note that it is the number of &#039;&#039;spaces&#039;&#039;, not buildings, that determines whether a temple can be built in the settlement.&lt;br /&gt;
&lt;br /&gt;
=== Tower ===&lt;br /&gt;
* Build a &#039;&#039;&#039;tower&#039;&#039;&#039; on a third-level space (or higher) adjacent to one of your existing settlements that does not already contain a tower.&lt;br /&gt;
&lt;br /&gt;
You are allowed to build in such a way that two of your settlements join together, such that there are two temples or two towers in the same settlement, for example.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Beware! If you cannot build, you will be eliminated from the game.&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Quietmint</name></author>
	</entry>
	<entry>
		<id>https://gl.doc.boardgamearena.com/index.php?title=Gamehelptaluva&amp;diff=3088</id>
		<title>Gamehelptaluva</title>
		<link rel="alternate" type="text/html" href="https://gl.doc.boardgamearena.com/index.php?title=Gamehelptaluva&amp;diff=3088"/>
		<updated>2018-06-04T15:10:15Z</updated>

		<summary type="html">&lt;p&gt;Quietmint: /* Build Buildings */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
In Taluva, players build temples, towers, and huts to settle a volcanic island emerging from the South Pacific. The game ends in an early victory if a player builds &#039;&#039;&#039;all buildings of two types&#039;&#039;&#039;. Otherwise, the game ends when no tiles remain and the winner is the player who built the most &#039;&#039;&#039;temples&#039;&#039;&#039; (in case of a tie, the most &#039;&#039;&#039;towers&#039;&#039;&#039; and then the most &#039;&#039;&#039;huts&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
Each player receives 3 temples, 2 towers, and 20 huts.&lt;br /&gt;
&lt;br /&gt;
12 tiles per player are shuffled to form a draw pile. Each tile is composed of 3 hexagon spaces: A volcano and two other terrain types (from most common to least: jungle, clearing, sand, rock, lake).&lt;br /&gt;
&lt;br /&gt;
== Place A Tile ==&lt;br /&gt;
&lt;br /&gt;
Begin your turn by drawing and placing a tile. Click the space on the board where you want to place the volcano. Choose from one of two options:&lt;br /&gt;
&lt;br /&gt;
=== Expand the landscape ===&lt;br /&gt;
Place your tile on the edge of the island adjacent to any existing tile.&lt;br /&gt;
&lt;br /&gt;
=== Volcanic eruption ===&lt;br /&gt;
Place your tile on top of two existing tiles so the volcano covers another volcano. Your tile must have a different rotation than the tile below and cannot overhang the ocean. You may destroy huts as long as you do not destroy an entire settlement (see below). Destroyed huts remain out of play.&lt;br /&gt;
&lt;br /&gt;
== Build Buildings ==&lt;br /&gt;
&lt;br /&gt;
End your turn by building one or more buildings on empty space(s) of any terrain type except volcano. A chain of your adjacent buildings forms a &#039;&#039;settlement&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Choose from one of four options:&lt;br /&gt;
&lt;br /&gt;
=== New settlement ===&lt;br /&gt;
&lt;br /&gt;
* Begin a new settlement by placing a &#039;&#039;&#039;hut&#039;&#039;&#039; on a first-level space not adjacent to any of your existing settlements.&lt;br /&gt;
&lt;br /&gt;
=== Expand settlement ===&lt;br /&gt;
&lt;br /&gt;
* Expand an existing settlement by choosing a terrain type. On all adjacent spaces of that type, build &#039;&#039;&#039;huts&#039;&#039;&#039; equal to the height (one hut on first-level spaces, two huts on second-level spaces, etc.). You must have enough huts to build on all eligible spaces. In the example below, the red player can build 2 huts on lakes (one on each) or 1 hut on sand (but cannot build only 1 hut on lake).&lt;br /&gt;
[[File:Taluva-expand.png]]&lt;br /&gt;
&lt;br /&gt;
=== Temple ===&lt;br /&gt;
&lt;br /&gt;
* Build a &#039;&#039;&#039;temple&#039;&#039;&#039; adjacent to one of your existing settlements occupying 3 or more spaces that does not already contain a temple. In the previous example, the red player could build a temple on sand if she built huts on both lakes in a prior turn. Note that it is the number of &#039;&#039;spaces&#039;&#039;, not buildings, that determines whether a temple can be built in the settlement.&lt;br /&gt;
&lt;br /&gt;
=== Tower ===&lt;br /&gt;
* Build a &#039;&#039;&#039;tower&#039;&#039;&#039; on a third-level space (or higher) adjacent to one of your existing settlements that does not already contain a tower.&lt;br /&gt;
&lt;br /&gt;
You are allowed to build in such a way that two of your settlements join together, such that there are two temples or two towers in the same settlement, for example.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Beware! If you cannot build, you will be eliminated from the game.&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Quietmint</name></author>
	</entry>
	<entry>
		<id>https://gl.doc.boardgamearena.com/index.php?title=Gamehelptaluva&amp;diff=2958</id>
		<title>Gamehelptaluva</title>
		<link rel="alternate" type="text/html" href="https://gl.doc.boardgamearena.com/index.php?title=Gamehelptaluva&amp;diff=2958"/>
		<updated>2018-04-06T12:36:54Z</updated>

		<summary type="html">&lt;p&gt;Quietmint: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
In Taluva, players build temples, towers, and huts to settle a volcanic island emerging from the South Pacific. The game ends in an early victory if a player builds &#039;&#039;&#039;all buildings of two types&#039;&#039;&#039;. Otherwise, the game ends when no tiles remain and the winner is the player who built the most &#039;&#039;&#039;temples&#039;&#039;&#039; (in case of a tie, the most &#039;&#039;&#039;towers&#039;&#039;&#039; and then the most &#039;&#039;&#039;huts&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
Each player receives 3 temples, 2 towers, and 20 huts.&lt;br /&gt;
&lt;br /&gt;
12 tiles per player are shuffled to form a draw pile. Each tile is composed of 3 hexagon spaces: A volcano and two other terrain types (from most common to least: jungle, clearing, sand, rock, lake).&lt;br /&gt;
&lt;br /&gt;
== Place A Tile ==&lt;br /&gt;
&lt;br /&gt;
Begin your turn by drawing and placing a tile. Click the space on the board where you want to place the volcano. Choose from one of two options:&lt;br /&gt;
&lt;br /&gt;
=== Expand the landscape ===&lt;br /&gt;
Place your tile on the edge of the island adjacent to any existing tile.&lt;br /&gt;
&lt;br /&gt;
=== Volcanic eruption ===&lt;br /&gt;
Place your tile on top of two existing tiles so the volcano covers another volcano. Your tile must have a different rotation than the tile below and cannot overhang the ocean. You may destroy huts as long as you do not destroy an entire settlement (see below). Destroyed huts remain out of play.&lt;br /&gt;
&lt;br /&gt;
== Build Buildings ==&lt;br /&gt;
&lt;br /&gt;
End your turn by building one or more buildings on empty space(s) of any terrain type except volcano. A chain of your adjacent buildings forms a &#039;&#039;settlement&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Choose from one of four options:&lt;br /&gt;
&lt;br /&gt;
* Begin a new settlement by placing a &#039;&#039;&#039;hut&#039;&#039;&#039; on a first-level space not adjacent to any of your existing settlements.&lt;br /&gt;
&lt;br /&gt;
* Expand an existing settlement by choosing a terrain type. On all adjacent spaces of that type, build &#039;&#039;&#039;huts&#039;&#039;&#039; equal to the height (one hut on first-level spaces, two huts on second-level spaces, etc.). You must have enough huts to build on all eligible spaces. In the example below, the red player can build 2 huts on lakes (one on each) or 1 hut on sand (but cannot build only 1 hut on lake).&lt;br /&gt;
[[File:Taluva-expand.png]]&lt;br /&gt;
&lt;br /&gt;
* Build a &#039;&#039;&#039;temple&#039;&#039;&#039; adjacent to one of your existing settlements occupying 3 or more spaces that does not already contain a temple. In the previous example, the red player could build a temple on sand if she built huts on both lakes in a prior turn. Note that it is the number of &#039;&#039;spaces&#039;&#039;, not buildings, that determines whether a temple can be built in the settlement.&lt;br /&gt;
&lt;br /&gt;
* Build a &#039;&#039;&#039;tower&#039;&#039;&#039; on a third-level space (or higher) adjacent to one of your existing settlements that does not already contain a tower.&lt;br /&gt;
&lt;br /&gt;
You are allowed to build in such a way that two of your settlements join together, such that there are two temples or two towers in the same settlement, for example.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Beware! If you cannot build, you will be eliminated from the game.&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Quietmint</name></author>
	</entry>
	<entry>
		<id>https://gl.doc.boardgamearena.com/index.php?title=Gamehelptaluva&amp;diff=2955</id>
		<title>Gamehelptaluva</title>
		<link rel="alternate" type="text/html" href="https://gl.doc.boardgamearena.com/index.php?title=Gamehelptaluva&amp;diff=2955"/>
		<updated>2018-04-03T03:36:24Z</updated>

		<summary type="html">&lt;p&gt;Quietmint: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
In Taluva, players build temples, towers, and huts to settle a volcanic island emerging from the South Pacific. The game ends in an early victory if a player builds &#039;&#039;&#039;all buildings of two types&#039;&#039;&#039;. Otherwise, the game ends when no tiles remain and the winner is the player who built the most &#039;&#039;&#039;temples&#039;&#039;&#039; (in case of a tie, the most &#039;&#039;&#039;towers&#039;&#039;&#039; and then the most &#039;&#039;&#039;huts&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
Each player receives 3 temples, 2 towers, and 20 huts.&lt;br /&gt;
&lt;br /&gt;
12 tiles per player are shuffled to form a draw pile. Each tile is composed of 3 hexagon spaces: A volcano and two other terrain types (from most common to least: jungle, clearing, sand, rock, lake).&lt;br /&gt;
&lt;br /&gt;
== Place A Tile ==&lt;br /&gt;
&lt;br /&gt;
Begin your turn by drawing and placing a tile. Choose from one of two options:&lt;br /&gt;
&lt;br /&gt;
* Expand the landscape: Place your tile on the edge of the island adjacent to any existing tile.&lt;br /&gt;
&lt;br /&gt;
* Volcanic eruption: Place your tile on top of two existing tiles so the volcano covers another volcano. Your tile must have a different rotation than the tile below and cannot overhang the ocean. You may destroy huts as long as you do not destroy an entire settlement (see below). Destroyed huts remain out of play.&lt;br /&gt;
&lt;br /&gt;
== Build Buildings ==&lt;br /&gt;
&lt;br /&gt;
End your turn by building one or more buildings on empty space(s) of any terrain type except volcano. A chain of your adjacent buildings forms a &#039;&#039;settlement&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Choose from one of four options:&lt;br /&gt;
&lt;br /&gt;
* Begin a new settlement by placing a &#039;&#039;&#039;hut&#039;&#039;&#039; on a first-level space not adjacent to any of your existing settlements.&lt;br /&gt;
&lt;br /&gt;
* Expand an existing settlement by choosing a terrain type. On all adjacent spaces of that type, build &#039;&#039;&#039;huts&#039;&#039;&#039; equal to the height (one hut on first-level spaces, two huts on second-level spaces, etc.). You must have enough huts to build on all eligible spaces. In the example below, the red player can build 2 huts on lakes (one on each) or 1 hut on sand (but cannot build only 1 hut on lake).&lt;br /&gt;
[[File:Taluva-expand.png]]&lt;br /&gt;
&lt;br /&gt;
* Build a &#039;&#039;&#039;temple&#039;&#039;&#039; adjacent to one of your existing settlements occupying 3 or more spaces that does not already contain a temple. In the previous example, the red player could build a temple on sand if she built huts on both lakes in a prior turn. Note that it is the number of &#039;&#039;spaces&#039;&#039;, not buildings, that determines whether a temple can be built in the settlement.&lt;br /&gt;
&lt;br /&gt;
* Build a &#039;&#039;&#039;tower&#039;&#039;&#039; on a third-level space (or higher) adjacent to one of your existing settlements that does not already contain a tower.&lt;br /&gt;
&lt;br /&gt;
You are allowed to build in such a way that two of your settlements join together, such that there are two temples or two towers in the same settlement, for example.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Beware! If you cannot build, you will be eliminated from the game.&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Quietmint</name></author>
	</entry>
	<entry>
		<id>https://gl.doc.boardgamearena.com/index.php?title=Ficheiro:Taluva-expand.png&amp;diff=2954</id>
		<title>Ficheiro:Taluva-expand.png</title>
		<link rel="alternate" type="text/html" href="https://gl.doc.boardgamearena.com/index.php?title=Ficheiro:Taluva-expand.png&amp;diff=2954"/>
		<updated>2018-04-03T03:10:07Z</updated>

		<summary type="html">&lt;p&gt;Quietmint: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Quietmint</name></author>
	</entry>
	<entry>
		<id>https://gl.doc.boardgamearena.com/index.php?title=Gamehelpcouptaluva&amp;diff=2953</id>
		<title>Gamehelpcouptaluva</title>
		<link rel="alternate" type="text/html" href="https://gl.doc.boardgamearena.com/index.php?title=Gamehelpcouptaluva&amp;diff=2953"/>
		<updated>2018-03-27T10:20:18Z</updated>

		<summary type="html">&lt;p&gt;Quietmint: moved Gamehelpcouptaluva to Gamehelptaluva&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Gamehelptaluva]]&lt;/div&gt;</summary>
		<author><name>Quietmint</name></author>
	</entry>
	<entry>
		<id>https://gl.doc.boardgamearena.com/index.php?title=Gamehelptaluva&amp;diff=2952</id>
		<title>Gamehelptaluva</title>
		<link rel="alternate" type="text/html" href="https://gl.doc.boardgamearena.com/index.php?title=Gamehelptaluva&amp;diff=2952"/>
		<updated>2018-03-27T10:20:18Z</updated>

		<summary type="html">&lt;p&gt;Quietmint: moved Gamehelpcouptaluva to Gamehelptaluva&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
In Taluva, players build temples, towers, and huts to settle a volcanic island emerging from the South Pacific. The game ends in an early victory if a player builds &#039;&#039;&#039;all of two types&#039;&#039;&#039; of buildings. Otherwise, the game ends when no tiles remain and the winner is the player who built the most &#039;&#039;&#039;temples&#039;&#039;&#039; (in case of a tie, the most &#039;&#039;&#039;towers&#039;&#039;&#039; and then the most &#039;&#039;&#039;huts&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
12 tiles per player are shuffled to form a draw pile. Each player receives 3 temples, 2 towers, and 20 huts.&lt;/div&gt;</summary>
		<author><name>Quietmint</name></author>
	</entry>
	<entry>
		<id>https://gl.doc.boardgamearena.com/index.php?title=Gamehelptaluva&amp;diff=2951</id>
		<title>Gamehelptaluva</title>
		<link rel="alternate" type="text/html" href="https://gl.doc.boardgamearena.com/index.php?title=Gamehelptaluva&amp;diff=2951"/>
		<updated>2018-03-27T10:20:04Z</updated>

		<summary type="html">&lt;p&gt;Quietmint: Created page with &amp;quot;== Introduction == In Taluva, players build temples, towers, and huts to settle a volcanic island emerging from the South Pacific. The game ends in an early victory if a playe...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
In Taluva, players build temples, towers, and huts to settle a volcanic island emerging from the South Pacific. The game ends in an early victory if a player builds &#039;&#039;&#039;all of two types&#039;&#039;&#039; of buildings. Otherwise, the game ends when no tiles remain and the winner is the player who built the most &#039;&#039;&#039;temples&#039;&#039;&#039; (in case of a tie, the most &#039;&#039;&#039;towers&#039;&#039;&#039; and then the most &#039;&#039;&#039;huts&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
12 tiles per player are shuffled to form a draw pile. Each player receives 3 temples, 2 towers, and 20 huts.&lt;/div&gt;</summary>
		<author><name>Quietmint</name></author>
	</entry>
	<entry>
		<id>https://gl.doc.boardgamearena.com/index.php?title=Studio&amp;diff=2865</id>
		<title>Studio</title>
		<link rel="alternate" type="text/html" href="https://gl.doc.boardgamearena.com/index.php?title=Studio&amp;diff=2865"/>
		<updated>2018-01-17T02:55:18Z</updated>

		<summary type="html">&lt;p&gt;Quietmint: /* Other resources */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Bga_studio_small.jpg]]&lt;br /&gt;
&lt;br /&gt;
Note: Please DO NOT translate Studio Documentation, so that there can be one place where you can find the latest information available.&lt;br /&gt;
&lt;br /&gt;
== What is Board Game Arena Studio? ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Board Game Arena Studio&#039;&#039;&#039; is a platform to build online board game adaptations using the Board Game Arena platform.&lt;br /&gt;
&lt;br /&gt;
It is open to any gamer with software development skills :)&lt;br /&gt;
&lt;br /&gt;
BGA Studio website: http://en.studio.boardgamearena.com&lt;br /&gt;
&lt;br /&gt;
Original announcement on BGA forum: http://forum.boardgamearena.com/viewtopic.php?f=10&amp;amp;t=1973&lt;br /&gt;
&lt;br /&gt;
== Discover BGA Studio in 5 presentations ==&lt;br /&gt;
&lt;br /&gt;
Why, how, what... to start discovering BGA Studio, we prepared 5 &amp;quot;powerpoint&amp;quot; presentations for you:&lt;br /&gt;
&lt;br /&gt;
* [http://www.slideshare.net/boardgamearena/5-reasons-why-you-should-use-bga-studio-for-your-online-board-game 5 reasons why you should use BGA Studio for your online board game]&lt;br /&gt;
* [http://www.slideshare.net/boardgamearena/the-8-steps-to-create-a-board-game-on-board-game-arena The 8 steps to create a board game on Board Game Arena]&lt;br /&gt;
* [http://www.slideshare.net/boardgamearena/the-bga-framework-at-a-glance The BGA Framework at a glance]&lt;br /&gt;
* [http://www.slideshare.net/boardgamearena/bga-studio-focus-on-bga-game-state-machine Focus on BGA game state machine]&lt;br /&gt;
* [http://www.slideshare.net/boardgamearena/bga-studio-guidelines BGA developers guidelines]&lt;br /&gt;
&lt;br /&gt;
== How to join the BGA developer team? ==&lt;br /&gt;
&lt;br /&gt;
Please see this page: [[How to join BGA developer team?]]&lt;br /&gt;
&lt;br /&gt;
== Great, I&#039;m in! ... How should I start? ==&lt;br /&gt;
&lt;br /&gt;
If you didn&#039;t already, check the presentations at the top of this page to get the basics.&lt;br /&gt;
&lt;br /&gt;
Then, you should checkout the [[First steps with BGA Studio]] to make sure that runs fine.&lt;br /&gt;
&lt;br /&gt;
After that, we strongly advise you to take one of these game creation tutorials:&lt;br /&gt;
* [[Tutorial reversi]] - an abstract strategy game played on an 8×8 uncheckered board for 2 players&lt;br /&gt;
* [[Tutorial gomoku]] - an abstract strategy game tic-tac-toe style for 2 players&lt;br /&gt;
* [[Tutorial hearts]] - a card game for 4 players&lt;br /&gt;
&lt;br /&gt;
Then start editing files and see what happens! ;)&lt;br /&gt;
&lt;br /&gt;
If you have any questions, please check out the &#039;&#039;&#039;[[Studio FAQ]]&#039;&#039;&#039; first, then if you didn&#039;t find the answer you were looking for, please post your question on the [http://forum.boardgamearena.com/viewforum.php?f=12 &#039;&#039;&#039;development forum&#039;&#039;&#039;].&lt;br /&gt;
&lt;br /&gt;
== BGA Studio documentation ==&lt;br /&gt;
&lt;br /&gt;
=== BGA Studio Framework reference ===&lt;br /&gt;
&lt;br /&gt;
This part of the documentation focuses on the development framework itself: functions and methods available to build your game.&lt;br /&gt;
&lt;br /&gt;
[[Studio file reference|File structure of a BGA game]]&lt;br /&gt;
&lt;br /&gt;
==== Game logic (Server side) ====&lt;br /&gt;
&lt;br /&gt;
* [[Main game logic: yourgamename.game.php]]&lt;br /&gt;
* [[Your game state machine: states.inc.php]]&lt;br /&gt;
* [[Game database model: dbmodel.sql]]&lt;br /&gt;
* [[Players actions: yourgamename.action.php]]&lt;br /&gt;
* [[Game material description: material.inc.php]]&lt;br /&gt;
* [[Game statistics: stats.inc.php]]&lt;br /&gt;
&lt;br /&gt;
==== Game interface (Client side) ====&lt;br /&gt;
&lt;br /&gt;
* [[Game interface logic: yourgamename.js]]&lt;br /&gt;
* [[Game art: img directory]]&lt;br /&gt;
* [[Game interface stylesheet: yourgamename.css]]&lt;br /&gt;
* [[Game layout: view and template: yourgamename.view.php and yourgamename_yourgamename.tpl]]&lt;br /&gt;
* [[Your game mobile version]]&lt;br /&gt;
&lt;br /&gt;
==== Other components ====&lt;br /&gt;
&lt;br /&gt;
* [[Translations]] (how to make your game translatable)&lt;br /&gt;
* [[Game options and preferences: gameoptions.inc.php]]&lt;br /&gt;
* [[Game meta-information: gameinfos.inc.php]]&lt;br /&gt;
* [[Game replay]]&lt;br /&gt;
* [[3D]]&lt;br /&gt;
&lt;br /&gt;
=== BGA Studio game components reference ===&lt;br /&gt;
&lt;br /&gt;
Game components are useful tools you can use in your game adaptations.&lt;br /&gt;
&lt;br /&gt;
* [[Deck]]: a PHP component to manage cards (deck, hands, picking cards, moving cards, shuffle deck, ...).&lt;br /&gt;
* [[Counter]]: a JS component to manage a counter that can increase/decrease (ex: player&#039;s score).&lt;br /&gt;
* [[Draggable]]: a JS component to manage drag&#039;n&#039;drop actions.&lt;br /&gt;
* [[ExpandableSection]]: a JS component to manage a rectangular block of HTML than can be displayed/hidden.&lt;br /&gt;
* [[Scrollmap]]: a JS component to manage a scrollable game area (useful when the game area can be infinite. Examples:  Saboteur or Takenoko games).&lt;br /&gt;
* [[Stock]]: a JS component to manage and display a set of game elements displayed at a position.&lt;br /&gt;
* [[Wrapper]]: a JS component to wrap a  &amp;amp;lt;div&amp;amp;gt; element around his child, even if these elements are absolute positioned.&lt;br /&gt;
* [[Zone]]: a JS component to manage a zone of the board where several game elements can come and leave, but should be well displayed together (See for example: token&#039;s places at Can&#039;t Stop).&lt;br /&gt;
&lt;br /&gt;
=== BGA Studio user guide ===&lt;br /&gt;
&lt;br /&gt;
This part of the documentation is a user guide for the BGA Studio online development environment.&lt;br /&gt;
&lt;br /&gt;
* [[BGA game Lifecycle]]&lt;br /&gt;
* [[First steps with BGA Studio]]&lt;br /&gt;
* [[Tutorial reversi]] &lt;br /&gt;
* [[Tutorial gomoku]] &lt;br /&gt;
* [[Tutorial hearts]]&lt;br /&gt;
* [[Create a game in BGA Studio: Complete Walkthrough]]&lt;br /&gt;
* [[Tools and tips of BGA Studio]] - Tips and instructions on setting up development environment&lt;br /&gt;
* [[Practical debugging]] - Tips focused on debugging&lt;br /&gt;
* [[Studio logs]] - Instructions for log access&lt;br /&gt;
* [[BGA Studio Cookbook]] - Tips and instructions on using API&#039;s, libraries and frameworks&lt;br /&gt;
* [[BGA Studio Guidelines]]&lt;br /&gt;
* [[Troubleshooting]] - Most common &amp;quot;I am really stuck&amp;quot; situations&lt;br /&gt;
* [[Studio FAQ]]&lt;br /&gt;
* [[Pre-release checklist]] - Go throught this list if you think you done development&lt;br /&gt;
* [[Post-release phase]]&lt;br /&gt;
* [[BGA Code Sharing]] - Shared resources, projects on git hub, common code, other links&lt;br /&gt;
&lt;br /&gt;
== Other resources ==&lt;br /&gt;
&lt;br /&gt;
[http://forum.boardgamearena.com/viewforum.php?f=12 Development forum]&lt;br /&gt;
&lt;br /&gt;
[https://en.boardgamearena.com/#!bugs Bug tracking system]&lt;/div&gt;</summary>
		<author><name>Quietmint</name></author>
	</entry>
	<entry>
		<id>https://gl.doc.boardgamearena.com/index.php?title=Browser_support&amp;diff=2853</id>
		<title>Browser support</title>
		<link rel="alternate" type="text/html" href="https://gl.doc.boardgamearena.com/index.php?title=Browser_support&amp;diff=2853"/>
		<updated>2018-01-14T20:57:30Z</updated>

		<summary type="html">&lt;p&gt;Quietmint: IE 11, not IE 9&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&amp;lt;h3&amp;gt;For the best experience, we recommend:&amp;lt;/h3&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;Google Chrome 10+&#039;&#039;&#039; [http://www.google.com/chrome Windows] [http://www.google.com/chrome?platform=mac Mac] [http://www.google.com/chrome?platform=linux Linux]&lt;br /&gt;
* &#039;&#039;&#039;Mozilla Firefox 4+&#039;&#039;&#039; [http://www.mozilla.org/products/firefox/ Windows] [http://www.mozilla.org/products/firefox/ Mac] [http://www.mozilla.org/products/firefox/ Linux]&lt;br /&gt;
&lt;br /&gt;
Board Game Arena takes advantage of the most recent web technology to make it possible for you to play without installing anything on your computer: no software to download or update, no plugins to install, etc. &lt;br /&gt;
Consequently, to play you need to use a modern web browser. Generally speaking, the more recent your web browser is, the more pleasant your game experience on Board Game Arena will be. &lt;br /&gt;
&lt;br /&gt;
This website makes intensive use of Javascript and your browser&#039;s graphics capabilities. Thus, if you want to have the best gaming experience with Board Game Arena, you should use one of the browsers listed above. However, we officially support the following browsers:&lt;br /&gt;
&lt;br /&gt;
* Google Chrome 4+&lt;br /&gt;
* Mozilla Firefox 3.5+&lt;br /&gt;
* Internet Explorer 11+&lt;br /&gt;
* Microsoft Edge&lt;br /&gt;
* Safari 4+&lt;br /&gt;
&lt;br /&gt;
We also support playing on iPads or similar tablets, or mobile phones.&lt;br /&gt;
&lt;br /&gt;
[[Category:Help]]&lt;/div&gt;</summary>
		<author><name>Quietmint</name></author>
	</entry>
	<entry>
		<id>https://gl.doc.boardgamearena.com/index.php?title=Gamehelpcoupcitystate&amp;diff=2844</id>
		<title>Gamehelpcoupcitystate</title>
		<link rel="alternate" type="text/html" href="https://gl.doc.boardgamearena.com/index.php?title=Gamehelpcoupcitystate&amp;diff=2844"/>
		<updated>2018-01-09T06:33:48Z</updated>

		<summary type="html">&lt;p&gt;Quietmint: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
In Coup, players vie for control of a corrupt city-state in renaissance Italy. Through your influence in the court (the character cards in your hand), bluff, steal, and murder your opponents to become the last player standing and rise to power. There is no second place.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
The 15-card deck contains 3 copies of 5 different characters (&#039;&#039;Ambassador&#039;&#039;, &#039;&#039;Assassin&#039;&#039;, &#039;&#039;Captain&#039;&#039;, &#039;&#039;Contessa&#039;&#039;, &#039;&#039;Duke&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
Each player begins with ₤2 (or ₤1 in a two-player game) and 2 cards. Money is public knowledge, but character cards in hand are secret.&lt;br /&gt;
&lt;br /&gt;
== Actions ==&lt;br /&gt;
On your turn, take any action you can afford:&lt;br /&gt;
&lt;br /&gt;
=== General actions (always available) ===&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Income&#039;&#039;&#039;: Take ₤1 from the treasury. Cannot be blocked.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Foreign Aid&#039;&#039;&#039;: Take ₤2 from the treasury. Any player claiming to be the &#039;&#039;Duke&#039;&#039; can block.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Coup&#039;&#039;&#039;: Pay ₤7 to the treasury and make another player lose influence (kill a character card). Cannot be blocked. If you start your turn with ₤10, you must choose this action.&lt;br /&gt;
&lt;br /&gt;
=== Character actions (must claim to have that character card in hand) ===&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Tax&#039;&#039;&#039; (as the &#039;&#039;Duke&#039;&#039;): Take ₤3 from the treasury. Cannot be blocked.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Steal&#039;&#039;&#039; (as the &#039;&#039;Captain&#039;&#039;): Take ₤2 from another player. The targeted player can block by claiming to be the &#039;&#039;Ambassador&#039;&#039;/&#039;&#039;Inquisitor&#039;&#039; or the &#039;&#039;Captain&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Exchange&#039;&#039;&#039; (as the &#039;&#039;Ambassador&#039;&#039;): Draw 2 cards from the court deck, then return 2 cards to the deck. Cannot be blocked.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Assassinate&#039;&#039;&#039; (as the &#039;&#039;Assassin&#039;&#039;): Pay ₤3 to the treasury and make another player lose influence (kill a character card). The targeted player can block by claiming to be the &#039;&#039;Contessa&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Challenges ==&lt;br /&gt;
&lt;br /&gt;
Any player making a character claim can be challenged. A challenge always results in one player losing a character. The challenged player reveals a card from his/her hand.&lt;br /&gt;
&lt;br /&gt;
• If bluffing, the revealed card is killed.&lt;br /&gt;
&lt;br /&gt;
• If truthful, the revealed card is shuffled into the deck, replaced, and the challenger kills a card from his/her hand.&lt;br /&gt;
&lt;br /&gt;
Dead character cards remain face-up and their influence can no longer be used. If both of your characters die, you&#039;re eliminated. The last player remaining wins!&lt;br /&gt;
&lt;br /&gt;
== Variant: Rounds to win ==&lt;br /&gt;
&lt;br /&gt;
The standard game of Coup is only one round. This variant allows you to play a longer game, continuing for multiple rounds until one player accumulates a predetermined number of wins.&lt;br /&gt;
&lt;br /&gt;
== Variant: Factions ==&lt;br /&gt;
&lt;br /&gt;
This variant divides players into two factions (teams), the Monarchists and the Populists. As long as there are two factions, players cannot block or target their teammates (however, &#039;&#039;&#039;Convert&#039;&#039;&#039; and challenges are always allowed). If there is only one faction in play, infighting takes over and no restriction applies.&lt;br /&gt;
&lt;br /&gt;
=== Additional actions ===&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Convert&#039;&#039;&#039;: Pay ₤1 to the almshouse to change your own faction, or pay ₤2 to the almshouse to change another player&#039;s faction. Cannot be blocked.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Embezzle&#039;&#039;&#039; (any character except the &#039;&#039;Duke&#039;&#039;): Take all coins from the almshouse if you are NOT the &#039;&#039;Duke&#039;&#039;. Cannot be blocked.&lt;br /&gt;
&lt;br /&gt;
If the &#039;&#039;&#039;Embezzle&#039;&#039;&#039; action is challenged, the challenged player reveals both cards in hand. If any &#039;&#039;Dukes&#039;&#039; are revealed (bluffing), one is killed (any other revealed card is shuffled into the deck and replaced). Otherwise (truthful), both revealed cards are shuffled into the deck, replaced, and the challenger kills a card from his/her hand as normal.&lt;br /&gt;
&lt;br /&gt;
== Variant: Inquisitor ==&lt;br /&gt;
&lt;br /&gt;
This variant replaces the &#039;&#039;Ambassador&#039;&#039; character with the &#039;&#039;Inquisitor&#039;&#039;. The &#039;&#039;Inquisitor&#039;&#039; still blocks stealing and has two character actions:&lt;br /&gt;
&lt;br /&gt;
=== Replacement character actions ===&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Exchange&#039;&#039;&#039; (as the &#039;&#039;Inquisitor&#039;&#039;): Draw 1 card from the court deck, then return 1 card to the deck. Cannot be blocked.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Examine&#039;&#039;&#039; (as the &#039;&#039;Inquisitor&#039;&#039;): Secretly look at 1 card in another player&#039;s hand. Choose whether to return the card to the owner or force the owner to exchange it with the court deck. Cannot be blocked.&lt;/div&gt;</summary>
		<author><name>Quietmint</name></author>
	</entry>
	<entry>
		<id>https://gl.doc.boardgamearena.com/index.php?title=Game_options_and_preferences:_gameoptions.inc.php&amp;diff=2843</id>
		<title>Game options and preferences: gameoptions.inc.php</title>
		<link rel="alternate" type="text/html" href="https://gl.doc.boardgamearena.com/index.php?title=Game_options_and_preferences:_gameoptions.inc.php&amp;diff=2843"/>
		<updated>2018-01-08T01:12:16Z</updated>

		<summary type="html">&lt;p&gt;Quietmint: /* Game Options */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
In this file, you can define your game options (= game variants) and user preferences.&lt;br /&gt;
   &lt;br /&gt;
Note: If your game has no variants or preferences, you don&#039;t have to modify this file.&lt;br /&gt;
&lt;br /&gt;
== Game Options ==&lt;br /&gt;
&lt;br /&gt;
Game options is something selected by table creator and usually correspond to game variation, for example if game includes expansion or certain special rule.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;displaycondition&#039;&#039;&#039; checks the conditions before displaying the option for selection. All conditions must be true for the option to display. Supported condition types:&lt;br /&gt;
** &#039;&#039;otheroption&#039;&#039; condition ensures another option is set to this given value&lt;br /&gt;
* &#039;&#039;&#039;startcondition&#039;&#039;&#039; checks the conditions before starting the game. All conditions must be true for the game to start, otherwise players will get a red error message when attempting to begin the game. Supported condition types:&lt;br /&gt;
** &#039;&#039;minplayers&#039;&#039; condition ensures at least this many players&lt;br /&gt;
** &#039;&#039;maxplayers&#039;&#039; conditions ensure at most this many players&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 $game_options = array(&lt;br /&gt;
     100 =&amp;gt; array(&lt;br /&gt;
         &#039;name&#039; =&amp;gt; totranslate(&#039;my game option&#039;),&lt;br /&gt;
         &#039;values&#039; =&amp;gt; array(&lt;br /&gt;
             // A simple value for this option:&lt;br /&gt;
             1 =&amp;gt; array(&lt;br /&gt;
                 &#039;name&#039; =&amp;gt; totranslate(&#039;option 1&#039;)&lt;br /&gt;
             ),&lt;br /&gt;
&lt;br /&gt;
             // A simple value for this option.&lt;br /&gt;
             // If this value is chosen, the value of &amp;quot;tmdisplay&amp;quot; is displayed in the game lobby&lt;br /&gt;
             2 =&amp;gt; array(&lt;br /&gt;
                 &#039;name&#039; =&amp;gt; totranslate(&#039;option 2&#039;),&lt;br /&gt;
                 &#039;tmdisplay&#039; =&amp;gt; totranslate(&#039;option 2&#039;)&lt;br /&gt;
             ),&lt;br /&gt;
&lt;br /&gt;
             // Another value, with other options:&lt;br /&gt;
             //  beta=true =&amp;gt; this option is in beta version right now.&lt;br /&gt;
             //  nobeginner=true  =&amp;gt;  this option is not recommended for beginners&lt;br /&gt;
             3 =&amp;gt; array(&lt;br /&gt;
                 &#039;name&#039; =&amp;gt; totranslate(&#039;option 3&#039;),&lt;br /&gt;
                 &#039;beta&#039; =&amp;gt; true,&lt;br /&gt;
                 &#039;nobeginner&#039; =&amp;gt; true&lt;br /&gt;
             ),&lt;br /&gt;
         )&lt;br /&gt;
     ),&lt;br /&gt;
     &lt;br /&gt;
     101 =&amp;gt; array(&lt;br /&gt;
         &#039;name&#039; =&amp;gt; totranslate(&#039;Draft variant&#039;),&lt;br /&gt;
         &#039;values&#039; =&amp;gt; array(&lt;br /&gt;
             1 =&amp;gt; array(&lt;br /&gt;
                 &#039;name&#039; =&amp;gt; totranslate(&#039;No draft&#039;)&lt;br /&gt;
             ),&lt;br /&gt;
             2 =&amp;gt; array(&lt;br /&gt;
                 &#039;name&#039; =&amp;gt; totranslate(&#039;Draft&#039;),&lt;br /&gt;
                 &#039;tmdisplay&#039; =&amp;gt; totranslate(&#039;Draft&#039;),&lt;br /&gt;
                 &#039;premium&#039; =&amp;gt; true,&lt;br /&gt;
                 &#039;nobeginner&#039; =&amp;gt; true&lt;br /&gt;
             ),&lt;br /&gt;
         ),&lt;br /&gt;
         &#039;displaycondition&#039; =&amp;gt; array( // Note: do not display this option unless these conditions are met&lt;br /&gt;
             array(&lt;br /&gt;
                 &#039;type&#039; =&amp;gt; &#039;otheroption&#039;,&lt;br /&gt;
                 &#039;id&#039; =&amp;gt; 100,&lt;br /&gt;
                 &#039;value&#039; =&amp;gt; array(2, 3, 4)&lt;br /&gt;
             )&lt;br /&gt;
         ),&lt;br /&gt;
         &#039;startcondition&#039; =&amp;gt; array(&lt;br /&gt;
             1 =&amp;gt; array(),&lt;br /&gt;
             2 =&amp;gt; array(&lt;br /&gt;
                 array(&lt;br /&gt;
                     &#039;type&#039; =&amp;gt; &#039;maxplayers&#039;,&lt;br /&gt;
                     &#039;value&#039; =&amp;gt; 3,&lt;br /&gt;
                     &#039;message&#039; =&amp;gt; totranslate(&#039;Draft option is available for 3 players maximum.&#039;)&lt;br /&gt;
                 )&lt;br /&gt;
             ),&lt;br /&gt;
         ),&lt;br /&gt;
         &#039;disable&#039; =&amp;gt; true&lt;br /&gt;
     ),&lt;br /&gt;
     &lt;br /&gt;
     102 =&amp;gt; array(&lt;br /&gt;
         &#039;name&#039; =&amp;gt; totranslate(&#039;Takeovers&#039;),&lt;br /&gt;
         &#039;values&#039; =&amp;gt; array(&lt;br /&gt;
             2 =&amp;gt; array(&lt;br /&gt;
                 &#039;name&#039; =&amp;gt; totranslate(&#039;No takeover&#039;)&lt;br /&gt;
             ),&lt;br /&gt;
             1 =&amp;gt; array(&lt;br /&gt;
                 &#039;name&#039; =&amp;gt; totranslate(&#039;Allow takeovers&#039;),&lt;br /&gt;
                 &#039;tmdisplay&#039; =&amp;gt; totranslate(&#039;Takeovers&#039;),&lt;br /&gt;
                 &#039;premium&#039; =&amp;gt; true,&lt;br /&gt;
                 &#039;nobeginner&#039; =&amp;gt; true&lt;br /&gt;
             ),&lt;br /&gt;
         ),&lt;br /&gt;
         &#039;displaycondition&#039; =&amp;gt; array( // Note: do not display this option unless these conditions are met&lt;br /&gt;
             array(&lt;br /&gt;
                 &#039;type&#039; =&amp;gt; &#039;otheroption&#039;,&lt;br /&gt;
                 &#039;id&#039; =&amp;gt; 100,&lt;br /&gt;
                 &#039;value&#039; =&amp;gt; array(3, 4)&lt;br /&gt;
             )&lt;br /&gt;
         ),&lt;br /&gt;
         &#039;startcondition&#039; =&amp;gt; array(&lt;br /&gt;
             2 =&amp;gt; array(),&lt;br /&gt;
             1 =&amp;gt; array(&lt;br /&gt;
                 array(&lt;br /&gt;
                     &#039;type&#039; =&amp;gt; &#039;maxplayers&#039;,&lt;br /&gt;
                     &#039;value&#039; =&amp;gt; 2,&lt;br /&gt;
                     &#039;message&#039; =&amp;gt; totranslate(&#039;Rebel vs Imperium Takeover Scenario is available for 2 players only.&#039;)&lt;br /&gt;
                 )&lt;br /&gt;
             ),&lt;br /&gt;
         ),&lt;br /&gt;
         &#039;disable&#039; =&amp;gt; true&lt;br /&gt;
     )&lt;br /&gt;
 );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note²: All options defined in this file should have a corresponding &amp;quot;game state labels&amp;quot; with the same ID (see &amp;quot;initGameStateLabels&amp;quot; in yourgame.game.php)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
             self::initGameStateLabels ( array (&lt;br /&gt;
                        ...&lt;br /&gt;
                        &amp;quot;my_first_game_variant&amp;quot; =&amp;gt; 100,&lt;br /&gt;
              ) );&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
IMPORTANT: After you edited and deployed this file you have to go to control panel and press &amp;quot;Reload game options configuration&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== User Preferences ==&lt;br /&gt;
&lt;br /&gt;
User preferences is something cosmetic about the game interface which however can create user wars, so you can satisfy all user&lt;br /&gt;
by giving them individual preferences. Do not use this unless absolutely necessary and usually only after game has been in production&lt;br /&gt;
for a while. If you add these currently only admins can apply these settings, so you would have to contact them after editing this file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$game_preferences = array(&lt;br /&gt;
    100 =&amp;gt; array(&lt;br /&gt;
			&#039;name&#039; =&amp;gt; totranslate(&#039;Notation style&#039;),&lt;br /&gt;
			&#039;needReload&#039; =&amp;gt; true, // after user changes this preference game interface would auto-reload&lt;br /&gt;
			&#039;values&#039; =&amp;gt; array(&lt;br /&gt;
					1 =&amp;gt; array( &#039;name&#039; =&amp;gt; totranslate( &#039;Classic&#039; ), &#039;cssPref&#039; =&amp;gt; &#039;notation_classic&#039; ),&lt;br /&gt;
					2 =&amp;gt; array( &#039;name&#039; =&amp;gt; totranslate( &#039;Tournament&#039; ), &#039;cssPref&#039; =&amp;gt; &#039;notation_tournament&#039; )&lt;br /&gt;
			)&lt;br /&gt;
	)&lt;br /&gt;
);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is two ways to check/apply this. In java Script&lt;br /&gt;
&lt;br /&gt;
  if (this.prefs[100].value == 2) ...&lt;br /&gt;
&lt;br /&gt;
This checks if preferences 100 has selected value 2.&lt;br /&gt;
&lt;br /&gt;
Second, if cssPref specified it will be applied to the body tag. So you can use different css styling for the preference.&lt;br /&gt;
&lt;br /&gt;
As user you have to select them from the Gear menu when game is started. On studio only user0 will have it actually working (bug?).&lt;/div&gt;</summary>
		<author><name>Quietmint</name></author>
	</entry>
	<entry>
		<id>https://gl.doc.boardgamearena.com/index.php?title=Gamehelpcoupcitystate&amp;diff=2839</id>
		<title>Gamehelpcoupcitystate</title>
		<link rel="alternate" type="text/html" href="https://gl.doc.boardgamearena.com/index.php?title=Gamehelpcoupcitystate&amp;diff=2839"/>
		<updated>2018-01-06T16:37:56Z</updated>

		<summary type="html">&lt;p&gt;Quietmint: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
In Coup, players vie for control of a corrupt city-state in renaissance Italy. Through your influence in the court (the character cards in your hand), bluff, steal, and murder your opponents to become the last player standing and rise to power. There is no second place.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
The 15-card deck contains 3 copies of 5 different characters (&#039;&#039;Ambassador&#039;&#039;, &#039;&#039;Assassin&#039;&#039;, &#039;&#039;Captain&#039;&#039;, &#039;&#039;Contessa&#039;&#039;, &#039;&#039;Duke&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
Each player begins with ₤2 (or ₤1 in a two-player game) and 2 cards. Money is public knowledge, but character cards in hand are secret.&lt;br /&gt;
&lt;br /&gt;
== Actions ==&lt;br /&gt;
On your turn, take any action you can afford:&lt;br /&gt;
&lt;br /&gt;
=== General actions (always available) ===&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Income&#039;&#039;&#039;: Take ₤1 from the treasury. Cannot be blocked.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Foreign Aid&#039;&#039;&#039;: Take ₤2 from the treasury. Any player claiming to be the &#039;&#039;Duke&#039;&#039; can block.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Coup&#039;&#039;&#039;: Pay ₤7 to the treasury and make another player lose influence (kill a character card). Cannot be blocked. If you start your turn with ₤10, you must choose this action.&lt;br /&gt;
&lt;br /&gt;
=== Character actions (must claim to have that character card in hand) ===&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Tax&#039;&#039;&#039; (as the &#039;&#039;Duke&#039;&#039;): Take ₤3 from the treasury. Cannot be blocked.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Steal&#039;&#039;&#039; (as the &#039;&#039;Captain&#039;&#039;): Take ₤2 from another player. The targeted player can block by claiming to be the &#039;&#039;Ambassador&#039;&#039; or the &#039;&#039;Captain&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Exchange&#039;&#039;&#039; (as the &#039;&#039;Ambassador&#039;&#039;): Draw 2 cards from the court deck, then return 2 cards to the deck. Cannot be blocked.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Assassinate&#039;&#039;&#039; (as the &#039;&#039;Assassin&#039;&#039;): Pay ₤3 to the treasury and make another player lose influence (kill a character card). The targeted player can block by claiming to be the &#039;&#039;Contessa&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Challenges ==&lt;br /&gt;
&lt;br /&gt;
Any player making a character claim can be challenged. A challenge always results in one player losing a character. The challenged player reveals a card from his/her hand.&lt;br /&gt;
&lt;br /&gt;
• If bluffing, the revealed card is killed.&lt;br /&gt;
&lt;br /&gt;
• If truthful, the revealed card is shuffled into the deck, replaced, and the challenger kills a card from his/her hand.&lt;br /&gt;
&lt;br /&gt;
Dead character cards remain face-up and their influence can no longer be used. If both of your characters die, you&#039;re eliminated. The last player remaining wins!&lt;br /&gt;
&lt;br /&gt;
== Variant: Rounds to win ==&lt;br /&gt;
&lt;br /&gt;
The standard game of Coup is only one round. This variant allows you to play a longer game, continuing for multiple rounds until one player accumulates a predetermined number of wins (1 - 5).&lt;br /&gt;
&lt;br /&gt;
== Variant: Factions ==&lt;br /&gt;
&lt;br /&gt;
This variant divides players into two factions or teams, the Monarchists and the Populists. As long as there are two factions, players cannot &#039;&#039;&#039;Assassinate&#039;&#039;&#039;, &#039;&#039;&#039;Coup&#039;&#039;&#039;, &#039;&#039;&#039;Steal&#039;&#039;&#039;, or block &#039;&#039;&#039;Foreign Aid&#039;&#039;&#039; against teammates (however, &#039;&#039;&#039;Convert&#039;&#039;&#039; and challenges are always allowed). If there is only one faction in play, no restriction applies.&lt;br /&gt;
&lt;br /&gt;
=== Additional actions ===&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Convert&#039;&#039;&#039;: Pay ₤1 to the almshouse to change your own faction, or pay ₤2 to the almshouse to change another player&#039;s faction. Cannot be blocked.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Embezzle&#039;&#039;&#039;: Take all coins from the almshouse if you are NOT the &#039;&#039;Duke&#039;&#039;. Cannot be blocked.&lt;br /&gt;
&lt;br /&gt;
If the &#039;&#039;&#039;Embezzle&#039;&#039;&#039; action is challenged, the challenged player reveals both cards in hand. If any &#039;&#039;Dukes&#039;&#039; are revealed (bluffing), one is killed (any other revealed card is shuffled into the deck and replaced). Otherwise (truthful), both revealed cards are shuffled into the deck, replaced, and the challenger kills a card from his/her hand as normal.&lt;/div&gt;</summary>
		<author><name>Quietmint</name></author>
	</entry>
	<entry>
		<id>https://gl.doc.boardgamearena.com/index.php?title=Gamehelpcoupcitystate&amp;diff=2834</id>
		<title>Gamehelpcoupcitystate</title>
		<link rel="alternate" type="text/html" href="https://gl.doc.boardgamearena.com/index.php?title=Gamehelpcoupcitystate&amp;diff=2834"/>
		<updated>2018-01-06T07:42:30Z</updated>

		<summary type="html">&lt;p&gt;Quietmint: /* Variant: Factions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
In Coup, players vie for control of a corrupt city-state in renaissance Italy. Through your influence in the court (the character cards in your hand), bluff, steal, and murder your opponents to become the last player standing and rise to power.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
The 15-card deck contains 3 copies of 5 different characters (&#039;&#039;Ambassador&#039;&#039;, &#039;&#039;Assassin&#039;&#039;, &#039;&#039;Captain&#039;&#039;, &#039;&#039;Contessa&#039;&#039;, &#039;&#039;Duke&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
Each player begins with ₤2 (or ₤1 in a two-player game) and 2 cards. Money is public knowledge, but character cards in hand are secret.&lt;br /&gt;
&lt;br /&gt;
== Actions ==&lt;br /&gt;
On your turn, take any action you can afford:&lt;br /&gt;
&lt;br /&gt;
=== General actions (always available) ===&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Income&#039;&#039;&#039;: Take ₤1 from the treasury. Cannot be blocked.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Foreign Aid&#039;&#039;&#039;: Take ₤2 from the treasury. Any player claiming to be the &#039;&#039;Duke&#039;&#039; can block.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Coup&#039;&#039;&#039;: Pay ₤7 to the treasury and make another player lose influence (kill a character card). Cannot be blocked. If you start your turn with ₤10, you must choose this action.&lt;br /&gt;
&lt;br /&gt;
=== Character actions (must claim to have that character card in hand) ===&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Tax&#039;&#039;&#039; (as the &#039;&#039;Duke&#039;&#039;): Take ₤3 from the treasury. Cannot be blocked.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Steal&#039;&#039;&#039; (as the &#039;&#039;Captain&#039;&#039;): Take ₤2 from another player. The targeted player can block by claiming to be the &#039;&#039;Ambassador&#039;&#039; or the &#039;&#039;Captain&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Exchange&#039;&#039;&#039; (as the &#039;&#039;Ambassador&#039;&#039;): Draw 2 cards from the court deck, then return 2 cards to the deck. Cannot be blocked.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Assassinate&#039;&#039;&#039; (as the &#039;&#039;Assassin&#039;&#039;): Pay ₤3 to the treasury and make another player lose influence (kill a character card). The targeted player can block by claiming to be the &#039;&#039;Contessa&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Challenges ==&lt;br /&gt;
&lt;br /&gt;
Any player making a character claim can be challenged. A challenge always results in one player losing a character. The challenged player reveals a card from his/her hand.&lt;br /&gt;
&lt;br /&gt;
• If bluffing, the revealed card is killed.&lt;br /&gt;
&lt;br /&gt;
• If truthful, the revealed card is shuffled into the deck, replaced, and the challenger kills a card from his/her hand.&lt;br /&gt;
&lt;br /&gt;
Dead character cards remain face-up and their influence can no longer be used. If both of your characters die, you&#039;re eliminated. The last player remaining wins! There is no second place.&lt;br /&gt;
&lt;br /&gt;
== Variant: Rounds to win ==&lt;br /&gt;
&lt;br /&gt;
The standard game of Coup is only one round. This variant allows you to play a longer game, continuing for multiple rounds until one player accumulates a predetermined number of wins (1 - 5).&lt;br /&gt;
&lt;br /&gt;
== Variant: Factions ==&lt;br /&gt;
&lt;br /&gt;
This variant divides players into two factions or teams, the Monarchists and the Populists. As long as there are two factions, players cannot &#039;&#039;&#039;Assassinate&#039;&#039;&#039;, &#039;&#039;&#039;Coup&#039;&#039;&#039;, &#039;&#039;&#039;Steal&#039;&#039;&#039;, or block &#039;&#039;&#039;Foreign Aid&#039;&#039;&#039; against teammates (however, &#039;&#039;&#039;Convert&#039;&#039;&#039; and challenges are always allowed). If there is only one faction in play, no restriction applies.&lt;br /&gt;
&lt;br /&gt;
=== Additional actions ===&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Convert&#039;&#039;&#039;: Pay ₤1 to the almshouse to change your own faction, or pay ₤2 to the almshouse to change another player&#039;s faction. Cannot be blocked.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Embezzle&#039;&#039;&#039;: Take all coins from the almshouse if you are NOT the &#039;&#039;Duke&#039;&#039;. Cannot be blocked.&lt;br /&gt;
&lt;br /&gt;
If the &#039;&#039;&#039;Embezzle&#039;&#039;&#039; action is challenged, the challenged player reveals both cards in hand. If any &#039;&#039;Dukes&#039;&#039; are revealed (bluffing), one is killed (any other revealed card is shuffled into the deck and replaced). Otherwise (truthful), both revealed cards are shuffled into the deck, replaced, and the challenger kills a card from his/her hand as normal.&lt;/div&gt;</summary>
		<author><name>Quietmint</name></author>
	</entry>
	<entry>
		<id>https://gl.doc.boardgamearena.com/index.php?title=Gamehelpcoupcitystate&amp;diff=2813</id>
		<title>Gamehelpcoupcitystate</title>
		<link rel="alternate" type="text/html" href="https://gl.doc.boardgamearena.com/index.php?title=Gamehelpcoupcitystate&amp;diff=2813"/>
		<updated>2018-01-04T04:30:40Z</updated>

		<summary type="html">&lt;p&gt;Quietmint: /* Variant: Factions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
In Coup, players vie for control of a corrupt city-state in renaissance Italy. Through your influence in the court (the character cards in your hand), bluff, steal, and murder your opponents to become the last player standing and rise to power.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
The 15-card deck contains 3 copies of 5 different characters (&#039;&#039;Ambassador&#039;&#039;, &#039;&#039;Assassin&#039;&#039;, &#039;&#039;Captain&#039;&#039;, &#039;&#039;Contessa&#039;&#039;, &#039;&#039;Duke&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
Each player begins with ₤2 (or ₤1 in a two-player game) and 2 cards. Money is public knowledge, but character cards in hand are secret.&lt;br /&gt;
&lt;br /&gt;
== Actions ==&lt;br /&gt;
On your turn, take any action you can afford:&lt;br /&gt;
&lt;br /&gt;
=== General actions (always available) ===&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Income&#039;&#039;&#039;: Take ₤1 from the treasury. Cannot be blocked.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Foreign Aid&#039;&#039;&#039;: Take ₤2 from the treasury. Any player claiming to be the &#039;&#039;Duke&#039;&#039; can block.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Coup&#039;&#039;&#039;: Pay ₤7 to the treasury and make another player lose influence (kill a character card). Cannot be blocked. If you start your turn with ₤10, you must choose this action.&lt;br /&gt;
&lt;br /&gt;
=== Character actions (must claim to have that character card in hand) ===&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Tax&#039;&#039;&#039; (as the &#039;&#039;Duke&#039;&#039;): Take ₤3 from the treasury. Cannot be blocked.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Steal&#039;&#039;&#039; (as the &#039;&#039;Captain&#039;&#039;): Take ₤2 from another player. The targeted player can block by claiming to be the &#039;&#039;Ambassador&#039;&#039; or the &#039;&#039;Captain&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Exchange&#039;&#039;&#039; (as the &#039;&#039;Ambassador&#039;&#039;): Draw 2 cards from the court deck, then return 2 cards to the deck. Cannot be blocked.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Assassinate&#039;&#039;&#039; (as the &#039;&#039;Assassin&#039;&#039;): Pay ₤3 to the treasury and make another player lose influence (kill a character card). The targeted player can block by claiming to be the &#039;&#039;Contessa&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Challenges ==&lt;br /&gt;
&lt;br /&gt;
Any player making a character claim can be challenged. A challenge always results in one player losing a character. The challenged player reveals a card from his/her hand.&lt;br /&gt;
&lt;br /&gt;
• If bluffing, the revealed card is killed.&lt;br /&gt;
&lt;br /&gt;
• If truthful, the revealed card is shuffled into the deck, replaced, and the challenger kills a card from his/her hand.&lt;br /&gt;
&lt;br /&gt;
Dead character cards remain face-up and their influence can no longer be used. If both of your characters die, you&#039;re eliminated. The last player remaining wins! There is no second place.&lt;br /&gt;
&lt;br /&gt;
== Variant: Rounds to win ==&lt;br /&gt;
&lt;br /&gt;
The standard game of Coup is only one round. This variant allows you to play a longer game, continuing for multiple rounds until one player accumulates a predetermined number of wins (1 - 5).&lt;br /&gt;
&lt;br /&gt;
== Variant: Factions ==&lt;br /&gt;
&lt;br /&gt;
This variant divides players into two factions or teams. While there are two factions, players cannot &#039;&#039;&#039;Assassinate&#039;&#039;&#039;, &#039;&#039;&#039;Coup&#039;&#039;&#039;, &#039;&#039;&#039;Steal&#039;&#039;&#039;, or block &#039;&#039;&#039;Foreign Aid&#039;&#039;&#039; against teammates (however, &#039;&#039;&#039;Convert&#039;&#039;&#039; and challenges are always allowed). If there is only one faction in play, no restriction applies.&lt;br /&gt;
&lt;br /&gt;
=== Additional actions ===&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Convert&#039;&#039;&#039;: Pay ₤1 to the almshouse to change your own faction, or pay ₤2 to the almshouse to change another player&#039;s faction. Cannot be blocked.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Embezzle&#039;&#039;&#039;: Take all coins from the almshouse if you are NOT the &#039;&#039;Duke&#039;&#039;. Cannot be blocked.&lt;br /&gt;
&lt;br /&gt;
If the &#039;&#039;&#039;Embezzle&#039;&#039;&#039; action is challenged, the challenged player reveals both cards in hand. If any &#039;&#039;Dukes&#039;&#039; are revealed (bluffing), one is killed (the other revealed card is shuffled into the deck and replaced). Otherwise (truthful), both revealed cards are shuffled into the deck, replaced, and the challenger kills a card from his/her hand as normal.&lt;/div&gt;</summary>
		<author><name>Quietmint</name></author>
	</entry>
	<entry>
		<id>https://gl.doc.boardgamearena.com/index.php?title=Gamehelpcoupcitystate&amp;diff=2812</id>
		<title>Gamehelpcoupcitystate</title>
		<link rel="alternate" type="text/html" href="https://gl.doc.boardgamearena.com/index.php?title=Gamehelpcoupcitystate&amp;diff=2812"/>
		<updated>2018-01-04T04:02:28Z</updated>

		<summary type="html">&lt;p&gt;Quietmint: Factions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
In Coup, players vie for control of a corrupt city-state in renaissance Italy. Through your influence in the court (the character cards in your hand), bluff, steal, and murder your opponents to become the last player standing and rise to power.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
The 15-card deck contains 3 copies of 5 different characters (&#039;&#039;Ambassador&#039;&#039;, &#039;&#039;Assassin&#039;&#039;, &#039;&#039;Captain&#039;&#039;, &#039;&#039;Contessa&#039;&#039;, &#039;&#039;Duke&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
Each player begins with ₤2 (or ₤1 in a two-player game) and 2 cards. Money is public knowledge, but character cards in hand are secret.&lt;br /&gt;
&lt;br /&gt;
== Actions ==&lt;br /&gt;
On your turn, take any action you can afford:&lt;br /&gt;
&lt;br /&gt;
=== General actions (always available) ===&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Income&#039;&#039;&#039;: Take ₤1 from the treasury. Cannot be blocked.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Foreign Aid&#039;&#039;&#039;: Take ₤2 from the treasury. Any player claiming to be the &#039;&#039;Duke&#039;&#039; can block.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Coup&#039;&#039;&#039;: Pay ₤7 to the treasury and make another player lose influence (kill a character card). Cannot be blocked. If you start your turn with ₤10, you must choose this action.&lt;br /&gt;
&lt;br /&gt;
=== Character actions (must claim to have that character card in hand) ===&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Tax&#039;&#039;&#039; (as the &#039;&#039;Duke&#039;&#039;): Take ₤3 from the treasury. Cannot be blocked.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Steal&#039;&#039;&#039; (as the &#039;&#039;Captain&#039;&#039;): Take ₤2 from another player. The targeted player can block by claiming to be the &#039;&#039;Ambassador&#039;&#039; or the &#039;&#039;Captain&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Exchange&#039;&#039;&#039; (as the &#039;&#039;Ambassador&#039;&#039;): Draw 2 cards from the court deck, then return 2 cards to the deck. Cannot be blocked.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Assassinate&#039;&#039;&#039; (as the &#039;&#039;Assassin&#039;&#039;): Pay ₤3 to the treasury and make another player lose influence (kill a character card). The targeted player can block by claiming to be the &#039;&#039;Contessa&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Challenges ==&lt;br /&gt;
&lt;br /&gt;
Any player making a character claim can be challenged. A challenge always results in one player losing a character. The challenged player reveals a card from his/her hand.&lt;br /&gt;
&lt;br /&gt;
• If bluffing, the revealed card is killed.&lt;br /&gt;
&lt;br /&gt;
• If truthful, the revealed card is shuffled into the deck, replaced, and the challenger kills a card from his/her hand.&lt;br /&gt;
&lt;br /&gt;
Dead character cards remain face-up and their influence can no longer be used. If both of your characters die, you&#039;re eliminated. The last player remaining wins! There is no second place.&lt;br /&gt;
&lt;br /&gt;
== Variant: Rounds to win ==&lt;br /&gt;
&lt;br /&gt;
The standard game of Coup is only one round. This variant allows you to play a longer game, continuing for multiple rounds until one player accumulates a predetermined number of wins (1 - 5).&lt;br /&gt;
&lt;br /&gt;
== Variant: Factions ==&lt;br /&gt;
&lt;br /&gt;
This variant divides players into two factions or teams. While there are two factions, players cannot &#039;&#039;&#039;Assassinate&#039;&#039;&#039;, &#039;&#039;&#039;Coup&#039;&#039;&#039;, &#039;&#039;&#039;Steal&#039;&#039;&#039;, or block &#039;&#039;&#039;Foreign Aid&#039;&#039;&#039; against teammates (however, &#039;&#039;&#039;Convert&#039;&#039;&#039; and challenges are always allowed). If there is only one faction in play, no restriction applies.&lt;br /&gt;
&lt;br /&gt;
There are two new general actions:&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Convert&#039;&#039;&#039;: Pay ₤1 to the almshouse to change your own faction, or pay ₤2 to the almshouse to change another player&#039;s faction. Cannot be blocked.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Embezzle&#039;&#039;&#039;: Take all coins from the almshouse if you are NOT the &#039;&#039;Duke&#039;&#039;. Cannot be blocked.&lt;br /&gt;
&lt;br /&gt;
If the &#039;&#039;&#039;Embezzle&#039;&#039;&#039; action is challenged, the challenged player reveals both cards in hand. If any &#039;&#039;Dukes&#039;&#039; are revealed (bluffing), one is killed (the other revealed card is shuffled into the deck and replaced). Otherwise (truthful), both revealed cards are shuffled into the deck, replaced, and the challenger kills a card from his/her hand as normal.&lt;/div&gt;</summary>
		<author><name>Quietmint</name></author>
	</entry>
	<entry>
		<id>https://gl.doc.boardgamearena.com/index.php?title=Main_game_logic:_yourgamename.game.php&amp;diff=2802</id>
		<title>Main game logic: yourgamename.game.php</title>
		<link rel="alternate" type="text/html" href="https://gl.doc.boardgamearena.com/index.php?title=Main_game_logic:_yourgamename.game.php&amp;diff=2802"/>
		<updated>2018-01-02T22:00:25Z</updated>

		<summary type="html">&lt;p&gt;Quietmint: /* Game states and active players */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This file is the main file for your game logic. Here you initialize the game, persist data, implement the rules and notify changes to the client interface.&lt;br /&gt;
&lt;br /&gt;
== File Structure ==&lt;br /&gt;
&lt;br /&gt;
The details on how the file is structured is described directly with comments on the code skeleton provided to you.&lt;br /&gt;
 &lt;br /&gt;
Basically, here&#039;s this structure:&lt;br /&gt;
* EmptyGame (constructor): where you define global variables.&lt;br /&gt;
* setupNewGame: initial setup of the game.&lt;br /&gt;
* getAllDatas: where you retrieve all game data during a complete reload of the game.&lt;br /&gt;
* getGameProgression: where you compute the game progression indicator.&lt;br /&gt;
* Utility functions: your utility functions.&lt;br /&gt;
* Player actions: the entry points for players actions. &lt;br /&gt;
* Game state arguments: methods to return additional data on specific game states ([http://en.doc.boardgamearena.com/Your_game_state_machine:_states.inc.php#args more info here]).&lt;br /&gt;
* Game state actions: the logic to run when entering a new game state ([http://en.doc.boardgamearena.com/Your_game_state_machine:_states.inc.php#action more info here]).&lt;br /&gt;
* zombieTurn: what to do it&#039;s the turn of a zombie player.&lt;br /&gt;
&lt;br /&gt;
== Accessing player informations ==&lt;br /&gt;
&lt;br /&gt;
; getPlayersNumber()&lt;br /&gt;
: Returns the number of players playing at the table&lt;br /&gt;
: Note: doesn&#039;t work in setupNewGame so use count($players) instead&lt;br /&gt;
&lt;br /&gt;
; getActivePlayerId()&lt;br /&gt;
: Get the &amp;quot;active_player&amp;quot;, whatever what is the current state type.&lt;br /&gt;
: Note: it does NOT mean that this player is active right now, because state type could be &amp;quot;game&amp;quot; or &amp;quot;multiplayer&amp;quot;&lt;br /&gt;
: Note: avoid using this method in a &amp;quot;multiplayer&amp;quot; state because it does not mean anything.&lt;br /&gt;
&lt;br /&gt;
; getActivePlayerName()&lt;br /&gt;
: Get the &amp;quot;active_player&amp;quot; name&lt;br /&gt;
: Note: avoid using this method in a &amp;quot;multiplayer&amp;quot; state because it does not mean anything.&lt;br /&gt;
&lt;br /&gt;
; loadPlayersBasicInfos()&lt;br /&gt;
: Get an associative array with generic data about players (ie: not game specific data).&lt;br /&gt;
: The key of the associative array is the player id.&lt;br /&gt;
: The content of each value is:&lt;br /&gt;
: * player_name&lt;br /&gt;
: * player_color (ex: ff0000)&lt;br /&gt;
&lt;br /&gt;
; getCurrentPlayerId()&lt;br /&gt;
: Get the &amp;quot;current_player&amp;quot;. The current player is the one from which the action originated (the one who send the request).&lt;br /&gt;
: &#039;&#039;&#039;Be careful&#039;&#039;&#039;: It is not always the active player.&lt;br /&gt;
: In general, you shouldn&#039;t use this method, unless you are in &amp;quot;multiplayer&amp;quot; state.&lt;br /&gt;
&lt;br /&gt;
; getCurrentPlayerName()&lt;br /&gt;
: Get the &amp;quot;current_player&amp;quot; name&lt;br /&gt;
: Be careful using this method (see above).&lt;br /&gt;
&lt;br /&gt;
; getCurrentPlayerColor()&lt;br /&gt;
: Get the &amp;quot;current_player&amp;quot; color&lt;br /&gt;
: Be careful using this method (see above).&lt;br /&gt;
&lt;br /&gt;
; isCurrentPlayerZombie()&lt;br /&gt;
: Check the &amp;quot;current_player&amp;quot; zombie status. If true, player is zombie, i.e. left or was kicked out of the game.&lt;br /&gt;
&lt;br /&gt;
== Accessing database ==&lt;br /&gt;
&lt;br /&gt;
The main game logic should be the only point from where you should access to the game database. You access your database using SQL queries with the methods below.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
BGA is using [http://dev.mysql.com/doc/refman/5.0/en/sql-syntax-transactions.html database transactions]. It means that your database changes WON&#039;T BE APPLIED to the database until your request ends normally. Using transaction is in fact very useful for you: at any time, if your game logic detects that something is wrong (ex: unallowed move), you just have to throw an exception and all the changes already performed on the game situation will be removed.&lt;br /&gt;
&lt;br /&gt;
; DbQuery( $sql )&lt;br /&gt;
: This is the generic method to access the database.&lt;br /&gt;
: It can execute any type of SELECT/UPDATE/DELETE/REPLACE query on the database.&lt;br /&gt;
: You should use it for UPDATE/DELETE/REPLACE query. For SELECT queries, the specialized methods below are much better.&lt;br /&gt;
&lt;br /&gt;
; getUniqueValueFromDB( $sql )&lt;br /&gt;
: Returns a unique value from DB or null if no value is found.&lt;br /&gt;
: $sql must be a SELECT query.&lt;br /&gt;
: Raise an exception if more than 1 row is returned.&lt;br /&gt;
&lt;br /&gt;
; getCollectionFromDB( $sql, $bSingleValue=false )&lt;br /&gt;
: Returns an associative array of rows for a sql SELECT query.&lt;br /&gt;
: The key of the resulting associative array is the first field specified in the SELECT query.&lt;br /&gt;
: The value of the resulting associative array if an associative array with all the field specified in the SELECT query and associated values.&lt;br /&gt;
: First column must be a primary or alternate key.&lt;br /&gt;
: The resulting collection can be empty.&lt;br /&gt;
: If you specified $bSingleValue=true and if your SQL query request 2 fields A and B, the method returns an associative array &amp;quot;A=&amp;gt;B&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Example 1:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
self::getCollectionFromDB( &amp;quot;SELECT player_id id, player_name name, player_score score FROM player&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
Result:&lt;br /&gt;
array(&lt;br /&gt;
 1234 =&amp;gt; array( &#039;id&#039;=&amp;gt;1234, &#039;name&#039;=&amp;gt;&#039;myuser0&#039;, &#039;score&#039;=&amp;gt;1 ),&lt;br /&gt;
 1235 =&amp;gt; array( &#039;id&#039;=&amp;gt;1235, &#039;name&#039;=&amp;gt;&#039;myuser1&#039;, &#039;score&#039;=&amp;gt;0 )&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Example 2:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
self::getCollectionFromDB( &amp;quot;SELECT player_id id, player_name name FROM player&amp;quot;, true );&lt;br /&gt;
&lt;br /&gt;
Result:&lt;br /&gt;
array(&lt;br /&gt;
 1234 =&amp;gt; &#039;myuser0&#039;,&lt;br /&gt;
 1235 =&amp;gt; &#039;myuser1&#039;&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; getNonEmptyCollectionFromDB( $sql )&lt;br /&gt;
: Idem than previous one, but raise an exception if the collection is empty&lt;br /&gt;
&lt;br /&gt;
; getObjectFromDB( $sql )&lt;br /&gt;
: Returns one row for the sql SELECT query as an associative array or null if there is no result&lt;br /&gt;
: Raise an exception if the query return more than one row&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
self::getObjectFromDB( &amp;quot;SELECT player_id id, player_name name, player_score score FROM player WHERE player_id=&#039;$player_id&#039;&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
Result:&lt;br /&gt;
array(&lt;br /&gt;
  &#039;id&#039;=&amp;gt;1234, &#039;name&#039;=&amp;gt;&#039;myuser0&#039;, &#039;score&#039;=&amp;gt;1 &lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; getNonEmptyObjectFromDB( $sql )&lt;br /&gt;
: Idem than previous one, but raise an exception if no row is found&lt;br /&gt;
&lt;br /&gt;
; getObjectListFromDB( $sql, $bUniqueValue=false )&lt;br /&gt;
: Return an array of rows for a sql SELECT query.&lt;br /&gt;
: the result if the same than &amp;quot;getCollectionFromDB&amp;quot; except that the result is a simple array (and not an associative array).&lt;br /&gt;
: The result can be empty.&lt;br /&gt;
: If you specified $bUniqueValue=true and if your SQL query request 1 field, the method returns directly an array of values.&lt;br /&gt;
&lt;br /&gt;
Example 1:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
self::getObjectListFromDB( &amp;quot;SELECT player_id id, player_name name, player_score score FROM player&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
Result:&lt;br /&gt;
array(&lt;br /&gt;
 array( &#039;id&#039;=&amp;gt;1234, &#039;name&#039;=&amp;gt;&#039;myuser0&#039;, &#039;score&#039;=&amp;gt;1 ),&lt;br /&gt;
 array( &#039;id&#039;=&amp;gt;1235, &#039;name&#039;=&amp;gt;&#039;myuser1&#039;, &#039;score&#039;=&amp;gt;0 )&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Example 2:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
self::getObjectListFromDB( &amp;quot;SELECT player_name name FROM player&amp;quot;, true );&lt;br /&gt;
&lt;br /&gt;
Result:&lt;br /&gt;
array(&lt;br /&gt;
 &#039;myuser0&#039;,&lt;br /&gt;
 &#039;myuser1&#039;&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; getDoubleKeyCollectionFromDB( $sql, $bSingleValue=false )&lt;br /&gt;
: Return an associative array of associative array, from a SQL SELECT query.&lt;br /&gt;
: First array level correspond to first column specified in SQL query.&lt;br /&gt;
: Second array level correspond to second column specified in SQL query.&lt;br /&gt;
: If bSingleValue = true, keep only third column on result&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; DbGetLastId()&lt;br /&gt;
: Return the PRIMARY key of the last inserted row (see PHP mysql_insert_id function).&lt;br /&gt;
&lt;br /&gt;
; DbAffectedRow()&lt;br /&gt;
: Return the number of row affected by the last operation&lt;br /&gt;
&lt;br /&gt;
; escapeStringForDB( $string )&lt;br /&gt;
: You must use this function on every string type data in your database that contains unsafe data.&lt;br /&gt;
: (unsafe = can be modified by a player).&lt;br /&gt;
: This method makes sure that no SQL injection will be done through the string used.&lt;br /&gt;
: Note: if you using standard types in ajax actions, like AT_alphanum it is sanitized before arrival,&lt;br /&gt;
: this is only needed if you manage to get unchecked string, like in the games where user has to enter text as a response.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: see Editing [[Game database model: dbmodel.sql]] to know how to define your database model.&lt;br /&gt;
&lt;br /&gt;
== Use globals ==&lt;br /&gt;
&lt;br /&gt;
Sometimes, you have to keep a single integer value that is global to your game, and you don&#039;t want to create a DB table specifically for it.&lt;br /&gt;
&lt;br /&gt;
Using a BGA framework &amp;quot;global&amp;quot;, you can do such a thing. Your value will be stored in the &amp;quot;global&amp;quot; table in database, and you can access it with simple methods.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;initGameStateLabels&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This method is located at the beginning of your game logic. This is the place you defines the globals used in your game logic, by assigning them IDs.&lt;br /&gt;
&lt;br /&gt;
You can define up to 79 globals, with IDs from 10 to 89. You must NOT use globals outside this range as globals are used by other components of the framework.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        self::initGameStateLabels( array( &lt;br /&gt;
                &amp;quot;my_first_global_variable&amp;quot; =&amp;gt; 10,&lt;br /&gt;
                &amp;quot;my_second_global_variable&amp;quot; =&amp;gt; 11&lt;br /&gt;
        ) );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;setGameStateInitialValue( $value_label, $value_value )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Init your global value. Must be called before any use of your global, so you should call this method from your &amp;quot;setupNewGame&amp;quot; method.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;getGameStateValue( $value_label )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Retrieve the current value of a global.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;setGameStateValue( $value_label, $value_value )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Set the current value of a global.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;incGameStateValue( $value_label, $increment )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Increment the current value of a global. If increment is negative, decrement the value of the global.&lt;br /&gt;
&lt;br /&gt;
Return the final value of the global.&lt;br /&gt;
&lt;br /&gt;
== Game states and active players ==&lt;br /&gt;
&lt;br /&gt;
; checkAction( $actionName, $bThrowException=true )&lt;br /&gt;
: Check if action is valid regarding current game state (exception if fails).&lt;br /&gt;
: The action is valid if it is listed as a &amp;quot;possibleactions&amp;quot; in the current game state (see game state description).&lt;br /&gt;
: This method MUST be called in the first place in ALL your PHP methods that handle players action, in order to make sure a player can&#039;t do an action when the rules disallow it at this moment of the game.&lt;br /&gt;
: if &amp;quot;bThrowException&amp;quot; is set to &amp;quot;false&amp;quot;, the function return false in case of failure instead of throwing and exception. This is useful when several actions are possible in order to test each of them without throwing exceptions.&lt;br /&gt;
&lt;br /&gt;
; activeNextPlayer()&lt;br /&gt;
: Make the next player active in the natural player order.&lt;br /&gt;
: Note: you CANT use this method in a &amp;quot;activeplayer&amp;quot; or &amp;quot;multipleactiveplayer&amp;quot; state. You must use a &amp;quot;game&amp;quot; type game state for this.&lt;br /&gt;
&lt;br /&gt;
; activePrevPlayer()&lt;br /&gt;
: Make the previous player active (in the natural player order).&lt;br /&gt;
: Note: you CANT use this method in a &amp;quot;activeplayer&amp;quot; or &amp;quot;multipleactiveplayer&amp;quot; state. You must use a &amp;quot;game&amp;quot; type game state for this.&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;gamestate-&amp;gt;changeActivePlayer( $player_id )&lt;br /&gt;
: You can call this method to make any player active.&lt;br /&gt;
: Note: you CANT use this method in a &amp;quot;activeplayer&amp;quot; or &amp;quot;multipleactiveplayer&amp;quot; state. You must use a &amp;quot;game&amp;quot; type game state for this.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;gamestate-&amp;gt;getActivePlayerList()&lt;br /&gt;
: With this method you can retrieve the list of the active player at any time.&lt;br /&gt;
: During a &amp;quot;game&amp;quot; type gamestate, it will return a void array.&lt;br /&gt;
: During a &amp;quot;activeplayer&amp;quot; type gamestate, it will return an array with one value (the active player id).&lt;br /&gt;
: during a &amp;quot;multipleactiveplayer&amp;quot; type gamestate, it will return an array of the active players id.&lt;br /&gt;
: Note: you should only use this method is the latter case.&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;gamestate-&amp;gt;setAllPlayersMultiactive()&lt;br /&gt;
: With this method, all playing players are made active.&lt;br /&gt;
: Usually, you use this method at the beginning (ex: &amp;quot;st&amp;quot; action method) of a multiplayer game state when all players have to do some action.&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;gamestate-&amp;gt;setPlayersMultiactive( $players, $next_state )&lt;br /&gt;
: Make a specific list of players active during a multiactive gamestate.&lt;br /&gt;
: Bare in mind it doesn&#039;t deactivate other previously active players. To do this, execute this SQL beforehand:&lt;br /&gt;
  self::DbQuery(&#039;UPDATE player SET player_is_multiactive = 0&#039;);&lt;br /&gt;
: &amp;quot;players&amp;quot; is the array of player id that should be made active.&lt;br /&gt;
: In case &amp;quot;players&amp;quot; is empty, the method trigger the &amp;quot;next_state&amp;quot; transition to go to the next game state.&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;gamestate-&amp;gt;setPlayerNonMultiactive( $player_id, $next_state )&lt;br /&gt;
: During a multiactive game state, make the specified player inactive.&lt;br /&gt;
: Usually, you call this method during a multiactive game state after a player did his action.&lt;br /&gt;
: If this player was the last active player, the method trigger the &amp;quot;next_state&amp;quot; transition to go to the next game state.&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;gamestate-&amp;gt;checkPossibleAction( $action )&lt;br /&gt;
: (rarely used)&lt;br /&gt;
: This works exactly like &amp;quot;checkAction&amp;quot;, except that it do NOT check if current player is active.&lt;br /&gt;
: This is used specifically in certain game states when you want to authorize some additional actions for players that are not active at the moment.&lt;br /&gt;
: Example: in Libertalia game, you want to authorize players to change their mind about card played. They are of course not active at the time they change their mind, so you cannot use &amp;quot;checkAction&amp;quot; and use &amp;quot;checkPossibleAction&amp;quot; instead.&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;gamestate-&amp;gt;nextState( $transition )&lt;br /&gt;
: Change current state to a new state. Important: parameter $transition is the name of the transition, and NOT the name of the target game state, see [[Your game state machine: states.inc.php]] for more information about states.&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;gamestate-&amp;gt;state()&lt;br /&gt;
: Get an associative array of current game state attributes, see [[Your game state machine: states.inc.php]] for state attributes.&lt;br /&gt;
  $state=$this-&amp;gt;gamestate-&amp;gt;state(); if( $state[&#039;name&#039;] == &#039;myGameState&#039; ) {...}&lt;br /&gt;
&lt;br /&gt;
== Players turn order ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;getNextPlayerTable()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Return an associative array which associate each player with the next player around the table.&lt;br /&gt;
&lt;br /&gt;
In addition, key 0 is associated to the first player to play.&lt;br /&gt;
&lt;br /&gt;
Example: if three player with ID 1, 2 and 3 are around the table, in this order, the method returns:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   array( &lt;br /&gt;
    1 =&amp;gt; 2, &lt;br /&gt;
    2 =&amp;gt; 3, &lt;br /&gt;
    3 =&amp;gt; 1, &lt;br /&gt;
    0 =&amp;gt; 1 &lt;br /&gt;
   );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;getPrevPlayerTable()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Same as above, but the associative array associate the previous player around the table.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;getPlayerAfter( $player_id )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Get player playing after given player in natural playing order.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;getPlayerBefore( $player_id )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Get player playing before given player in natural playing order.&lt;br /&gt;
&lt;br /&gt;
Note: There is no API to modify this order, if you have custom player order you have to maintain it in your database&lt;br /&gt;
and have custom function to access it.&lt;br /&gt;
&lt;br /&gt;
== Notify players ==&lt;br /&gt;
&lt;br /&gt;
To understand notifications, please read [http://www.slideshare.net/boardgamearena/the-bga-framework-at-a-glance The BGA Framework at a glance] first.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Notifications are sent at the very end of the request, when it ends normally. It means that if you throw an exception for any reason (ex: move not allowed), no notifications will be sent to players.&lt;br /&gt;
Notifications sent between the game start (setupNewGame) and the end of the &amp;quot;action&amp;quot; method of the first active state will never reach their destination.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;notifyAllPlayers( $notification_type, $notification_log, $notification_args )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Send a notification to all players of the game.&lt;br /&gt;
&lt;br /&gt;
* notification_type:&lt;br /&gt;
A string that defines the type of your notification.&lt;br /&gt;
&lt;br /&gt;
Your game interface Javascript logic will use this to know what is the type of the received notification (and to trigger the corresponding method).&lt;br /&gt;
&lt;br /&gt;
* notification_log:&lt;br /&gt;
A string that defines what is to be displayed in the game log.&lt;br /&gt;
&lt;br /&gt;
You can use an empty string here (&amp;quot;&amp;quot;). In this case, nothing is displayed in the game log.&lt;br /&gt;
&lt;br /&gt;
If you define a real string here, you should use &amp;quot;clienttranslate&amp;quot; method to make sure it can be translate.&lt;br /&gt;
&lt;br /&gt;
You can use arguments in your notification_log strings, that refers to values defines in the &amp;quot;notification_args&amp;quot; argument (see below). NB: Make sure you only use single quotes (&#039;), otherwise PHP will try to interpolate the variable and will ignore the values in the args array.&lt;br /&gt;
&lt;br /&gt;
Note: you CAN use some HTML inside your notification log, and it is working. However:&lt;br /&gt;
_ pay attention to keep the log clear.&lt;br /&gt;
_ try to not include some HTML tags inside the &amp;quot;clienttranslate&amp;quot; method, otherwise it will make the translators work more difficult. You can use a notification argument instead, and provide your HTML through this argument.&lt;br /&gt;
&lt;br /&gt;
* notification_args:&lt;br /&gt;
The arguments of your notifications, as an associative array.&lt;br /&gt;
&lt;br /&gt;
This array will be transmitted to the game interface logic, in order the game interface can be updated.&lt;br /&gt;
&lt;br /&gt;
Complete notifyAllPlayers example (from &amp;quot;Reversi&amp;quot;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
self::notifyAllPlayers( &amp;quot;playDisc&amp;quot;, clienttranslate( &#039;${player_name} plays a disc and turns over ${returned_nbr} disc(s)&#039; ),&lt;br /&gt;
 array(&lt;br /&gt;
        &#039;player_id&#039; =&amp;gt; $player_id,&lt;br /&gt;
        &#039;player_name&#039; =&amp;gt; self::getActivePlayerName(),&lt;br /&gt;
        &#039;returned_nbr&#039; =&amp;gt; count( $turnedOverDiscs ),&lt;br /&gt;
        &#039;x&#039; =&amp;gt; $x,&lt;br /&gt;
        &#039;y&#039; =&amp;gt; $y&lt;br /&gt;
     ) );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can see in the example above the use of the &amp;quot;clienttranslate&amp;quot; method, and the use of 2 arguments &amp;quot;player_name&amp;quot; and &amp;quot;returned_nbr&amp;quot; in the notification log.&lt;br /&gt;
&lt;br /&gt;
Important: NO private data must be sent with this method, as a cheater could see it even it is not used explicitly by the game interface logic. If you want to send private information to a player, please use notifyPlayer below.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;notifyPlayer( $player_id, $notification_type, $notification_log, $notification_args )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Same as above, except that the notification is sent to one player only.&lt;br /&gt;
&lt;br /&gt;
This method must be used each time some private information must be transmitted to a player.&lt;br /&gt;
&lt;br /&gt;
Important: the variable for player name must be ${player_name} in order to be highlighted with the player color in the game log&lt;br /&gt;
&lt;br /&gt;
== Game statistics ==&lt;br /&gt;
&lt;br /&gt;
There are 2 types of statistics:&lt;br /&gt;
* a &amp;quot;player&amp;quot; statistic is a statistic associated to a player&lt;br /&gt;
* a &amp;quot;table&amp;quot; statistics is a statistic not associated to a player (global statistic for this game).&lt;br /&gt;
&lt;br /&gt;
See [[Game statistics: stats.inc.php]] to see how you defines statistics for your game.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;initStat( $table_or_player, $name, $value, $player_id = null )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create a statistic entry  with a default value.&lt;br /&gt;
This method must be called for each statistics of your game, in your setupNewGame method.&lt;br /&gt;
&lt;br /&gt;
&#039;$table_or_player&#039; must be set to &amp;quot;table&amp;quot; if this is a table statistics, or &amp;quot;player&amp;quot; if this is a player statistics.&lt;br /&gt;
&lt;br /&gt;
&#039;$name&#039; is the name of your statistics, as it has been defined in your stats.inc.php file.&lt;br /&gt;
&lt;br /&gt;
&#039;$value&#039; is the initial value of the statistics. If this is a player statistics and if the player is not specified by &amp;quot;$player_id&amp;quot; argument, the value is set for ALL players.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;setStat( $value, $name, $player_id = null )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Set a statistic $name to $value.&lt;br /&gt;
&lt;br /&gt;
If &amp;quot;$player_id&amp;quot; is not specified, setStat consider it is a TABLE statistic.&lt;br /&gt;
&lt;br /&gt;
If &amp;quot;$player_id&amp;quot; is specified, setStat consider it is a PLAYER statistic.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;incStat( $delta, $name, $player_id = null )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Increment (or decrement) specified statistic value by $delta value. Same behavior as setStat function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;getStat( $name, $player_id = null )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Return the value of statistic specified by $name. Useful when creating derivative statistics such as average.&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
See [[Translations]]&lt;br /&gt;
&lt;br /&gt;
== Manage player scores and Tie breaker ==&lt;br /&gt;
&lt;br /&gt;
=== Normal scoring ===&lt;br /&gt;
&lt;br /&gt;
At the end of the game, players automatically get a rank depending on their score: the player with the biggest score is #1, the player with the second biggest score is #2, and so on...&lt;br /&gt;
&lt;br /&gt;
During the game, you update player&#039;s score directly by updating &amp;quot;player_score&amp;quot; field of &amp;quot;player&amp;quot; table in database.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  // +2 points to active player&lt;br /&gt;
  self::DbQuery( &amp;quot;UPDATE player SET player_score=player_score+2 WHERE player_id=&#039;&amp;quot;.self::getActivePlayerId().&amp;quot;&#039;&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
  // Set score of active player to 5&lt;br /&gt;
  self::DbQuery( &amp;quot;UPDATE player SET player_score=5 WHERE player_id=&#039;&amp;quot;.self::getActivePlayerId().&amp;quot;&#039;&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: don&#039;t forget to notify the client side in order the score control can be updated accordingly.&lt;br /&gt;
&lt;br /&gt;
=== Tie breaker ===&lt;br /&gt;
&lt;br /&gt;
Tie breaker is used when two players get the same score at the end of a game.&lt;br /&gt;
&lt;br /&gt;
Tie breaker is using &amp;quot;player_score_aux&amp;quot; field of &amp;quot;player&amp;quot; table. It is updated exactly like the &amp;quot;player_score&amp;quot; field.&lt;br /&gt;
&lt;br /&gt;
Tie breaker score is displayed only for players who are tied at the end of the game. Most of the time, it is not supposed to be displayed explicitly during the game.&lt;br /&gt;
&lt;br /&gt;
When you are using &amp;quot;player_score_aux&amp;quot; functionality, you must describe the formula to use in your gameinfos.inc.php file like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
         &#039;tie_breaker_description&#039; =&amp;gt; totranslate(&amp;quot;Describe here your tie breaker formula&amp;quot;),&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This description will be used as a tooltip to explain to players how this auxiliary score has been calculated.&lt;br /&gt;
&lt;br /&gt;
=== Co-operative game ===&lt;br /&gt;
&lt;br /&gt;
To make everyone lose in full-coop game:&lt;br /&gt;
&lt;br /&gt;
Add the following in gameinfos.inc.php :&lt;br /&gt;
&#039;is_coop&#039; =&amp;gt; 1, // full cooperative&lt;br /&gt;
&lt;br /&gt;
And score zero to everyone.&lt;br /&gt;
&lt;br /&gt;
=== Semi-coop ===&lt;br /&gt;
&lt;br /&gt;
If the game is not full-coop, then everyone lose = everyone is tie. I.e. set score to 0 to everybody.&lt;br /&gt;
&lt;br /&gt;
=== One winner only ===&lt;br /&gt;
If you need to one person to win and everybody else to lose, set the scores so that the winner has the best score, and the other players have the same (lower) score. Then add the following lines to gameinfos.php:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// If in the game, all losers are equal (no score to rank them or explicit in the rules that losers are not ranked between them), set this to true &lt;br /&gt;
// The game end result will display &amp;quot;Winner&amp;quot; for the 1st player and &amp;quot;Loser&amp;quot; for all other players&lt;br /&gt;
&#039;losers_not_ranked&#039; =&amp;gt; true,&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Quantum and Coup are implemented like this, as you can see here:&lt;br /&gt;
* https://boardgamearena.com/#!gamepanel?game=quantum&amp;amp;section=lastresults&lt;br /&gt;
* https://boardgamearena.com/#!gamepanel?game=coupcitystate&amp;amp;section=lastresults&lt;br /&gt;
&lt;br /&gt;
=== Solo ===&lt;br /&gt;
&lt;br /&gt;
If game supports solo variant, a negative score means defeat, a positive score means victory.&lt;br /&gt;
&lt;br /&gt;
=== Player elimination ===&lt;br /&gt;
&lt;br /&gt;
In some games, this is useful to eliminate a player from the game in order he/she can start another game without waiting for the current game end.&lt;br /&gt;
&lt;br /&gt;
This case should be rare. Please don&#039;t use player elimination feature if some player just has to wait the last 10% of the game for game end. This feature should be used only in games where players are eliminated all along the game (typical examples: &amp;quot;Perudo&amp;quot; or &amp;quot;The Werewolves of Miller&#039;s Hollow&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
&lt;br /&gt;
* Player to eliminate should NOT be active anymore (preferably use the feature in a &amp;quot;game&amp;quot; type game state).&lt;br /&gt;
* In your PHP code:&lt;br /&gt;
  self::eliminatePlayer( &amp;lt;player_to_eliminate_id&amp;gt; );&lt;br /&gt;
* the player is informed in a dialog box that he no longer have to played and can start another game if he/she wants too (whith buttons &amp;quot;stay at this table&amp;quot; &amp;quot;quit table and back to main site&amp;quot;). In any case, the player is free to tart&amp;amp;join another table from now.&lt;br /&gt;
* When your game is over, all players who have been eliminated before receive a &amp;quot;notification&amp;quot; (the small &amp;quot;!&amp;quot; icon on the top right of the BGA interface) that indicate them that &amp;quot;the game has ended&amp;quot; and invite them to review the game results.&lt;br /&gt;
&lt;br /&gt;
== Reflexion time ==&lt;br /&gt;
&lt;br /&gt;
; function giveExtraTime( $player_id, $specific_time=null )&lt;br /&gt;
: Give standard extra time to this player.&lt;br /&gt;
: Standard extra time depends on the speed of the game (small with &amp;quot;slow&amp;quot; game option, bigger with other options).&lt;br /&gt;
: You can also specify an exact time to add, in seconds, with the &amp;quot;specified_time&amp;quot; argument (rarely used).&lt;br /&gt;
&lt;br /&gt;
== Managing errors and exceptions ==&lt;br /&gt;
&lt;br /&gt;
Note: when you throw an exception, all database changes and all notifications are cancelled immediately. This way, the game situation that were existing before the request is completely restored.&lt;br /&gt;
&lt;br /&gt;
; throw new BgaUserException ( $error_message)&lt;br /&gt;
: Base class to notify a user error&lt;br /&gt;
: You must throw this exception when a player want to do something that he is not allowed to do.&lt;br /&gt;
: The error message will be shown to the player as a &amp;quot;red message&amp;quot;, so it must be translated.&lt;br /&gt;
: Throwing such an exception is NOT considered as a bug, so it is not traced in BGA error logs.&lt;br /&gt;
&lt;br /&gt;
Example from Gomoku:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     throw new BgaUserException( self::_(&amp;quot;There is already a stone on this intersection, you can&#039;t play there&amp;quot;) );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; throw new BgaVisibleSystemException ( $error_message)&lt;br /&gt;
: You must throw this exception when you detect something that is not supposed to happened into your code.&lt;br /&gt;
: The error message is shown to the user as an &amp;quot;Unexpected error&amp;quot;, in order he can report it in the forum.&lt;br /&gt;
: The error message is logged in BGA error logs. If it happens regularly, we will report it to you.&lt;br /&gt;
&lt;br /&gt;
; throw new BgaSystemException ( $error_message)&lt;br /&gt;
: Base class to notify a system exception. The message will be hidden from the user, but show in the logs. Use this if the message contains technical information.&lt;br /&gt;
: You shouldn&#039;t use this type of exception except if you think the information shown could be critical. Indeed: a generic error message will be shown to the user, so it&#039;s going to be difficult for you to see what happened.&lt;br /&gt;
&lt;br /&gt;
== Zombie mode ==&lt;br /&gt;
&lt;br /&gt;
When a player leaves a game for any reason (expelled, quit), he becomes a &amp;quot;zombie player&amp;quot;. In this case, the results of the game won&#039;t count for statistics, but this is cool if the other players can finish the game anyway. That&#039;s why zombie mode exists: allow the other player to finish the game, even if the situation is not ideal.&lt;br /&gt;
&lt;br /&gt;
While developing your zombie mode, keep in mind that:&lt;br /&gt;
* Do not refer to the rules, because this situation is not planned by the rules.&lt;br /&gt;
* Try to figure that you are playing with your friends and one of them has to leave: how can we finish the game without killing the spirit of the game?&lt;br /&gt;
* The idea is NOT to develop an artificial intelligence for the game.&lt;br /&gt;
&lt;br /&gt;
Most of the time, the best thing to do when it is zombie player turn is to jump immediately to a state where he is not active anymore. For example, if he is in a game state where he has a choice between playing A and playing B, the best thing to do is NOT to choose A or B, but to pass. So, even if there&#039;s no &amp;quot;pass&amp;quot; action in the rules, add a &amp;quot;zombiepass&amp;quot; transitition in your game state and use it.&lt;br /&gt;
&lt;br /&gt;
Each time a zombie player must play, your &amp;quot;zombieTurn&amp;quot; method is called.&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
* $state: the name of the current game state.&lt;br /&gt;
* $active_player: the id of the active player.&lt;br /&gt;
&lt;br /&gt;
Most of the time, your zombieTurn method looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    function zombieTurn( $state, $active_player )&lt;br /&gt;
    {&lt;br /&gt;
    	$statename = $state[&#039;name&#039;];&lt;br /&gt;
&lt;br /&gt;
        if( $statename == &#039;myFirstGameState&#039;&lt;br /&gt;
             ||  $statename == &#039;my2ndGameState&#039;&lt;br /&gt;
             ||  $statename == &#039;my3rdGameState&#039;&lt;br /&gt;
               ....&lt;br /&gt;
           )&lt;br /&gt;
        {&lt;br /&gt;
            $this-&amp;gt;gamestate-&amp;gt;nextState( &amp;quot;zombiePass&amp;quot; );&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
            throw new BgaVisibleSystemException( &amp;quot;Zombie mode not supported at this game state: &amp;quot;.$statename );&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that in the example above, all corresponding game state should implement &amp;quot;zombiePass&amp;quot; as a transition.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Player color preferences ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
BGA players (Club members) may now choose their preferred color for playing. For example, if they are used to play green for every board game, they can select &amp;quot;green&amp;quot; in their BGA preferences page.&lt;br /&gt;
&lt;br /&gt;
Making your game compatible with colors preferences is very easy and requires only 1 line of PHP and 1 configuration change :&lt;br /&gt;
&lt;br /&gt;
On your gameinfos.inc.php file, add the following lines :&lt;br /&gt;
&lt;br /&gt;
  // Favorite colors support : if set to &amp;quot;true&amp;quot;, support attribution of favorite colors based on player&#039;s preferences (see reattributeColorsBasedOnPreferences PHP method)&lt;br /&gt;
  &#039;favorite_colors_support&#039; =&amp;gt; true,&lt;br /&gt;
&lt;br /&gt;
Then, on your main &amp;lt;your_game&amp;gt;.game.php file, find the &amp;quot;reloadPlayersBasicInfos&amp;quot; call in your &amp;quot;setupNewGame&amp;quot; method and replace :&lt;br /&gt;
&lt;br /&gt;
        $sql .= implode( $values, &#039;,&#039; );&lt;br /&gt;
        self::DbQuery( $sql );&lt;br /&gt;
        self::reloadPlayersBasicInfos();&lt;br /&gt;
&lt;br /&gt;
By :&lt;br /&gt;
&lt;br /&gt;
        $sql .= implode( $values, &#039;,&#039; );&lt;br /&gt;
        self::DbQuery( $sql );&lt;br /&gt;
        self::reattributeColorsBasedOnPreferences( $players, array(  /* LIST HERE THE AVAILABLE COLORS OF YOUR GAME INSTEAD OF THESE ONES */&amp;quot;ff0000&amp;quot;, &amp;quot;008000&amp;quot;, &amp;quot;0000ff&amp;quot;, &amp;quot;ffa500&amp;quot;, &amp;quot;773300&amp;quot; ) );&lt;br /&gt;
        self::reloadPlayersBasicInfos();&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;reattributeColorsBasedOnPreferences&amp;quot; method reattributes all colors, taking into account players color preferences and available colors.&lt;br /&gt;
&lt;br /&gt;
Note that you must update the colors to indicate the colors available for your game.&lt;br /&gt;
&lt;br /&gt;
2 important remarks :&lt;br /&gt;
* for some games (ex : Chess), the color has an influence on a mechanism of the game, most of the time by giving a special advantage to a player (ex : Starting the game). Color preference mechanism must NOT be used in such a case.&lt;br /&gt;
* your logic should NEVER consider that the first player has the color X, that the second player has the color Y, and so on. If this is the case, your game will NOT be compatible with reattributeColorsBasedOnPreferences as this method attribute colors to players based on their preferences and not based as their order at the table.&lt;br /&gt;
&lt;br /&gt;
Colours currently listed as a choice in preferences:&lt;br /&gt;
&lt;br /&gt;
* #ff0000 Red&lt;br /&gt;
* #008000 Green&lt;br /&gt;
* #0000ff Blue&lt;br /&gt;
* #ffa500 Yellow&lt;br /&gt;
* #000000 Black&lt;br /&gt;
* #ffffff White&lt;br /&gt;
&lt;br /&gt;
== Debugging and Tracing ==&lt;br /&gt;
&lt;br /&gt;
To debug php code you can use some tracing functions available from the parent class such as debug, trace, error, warn, dump.&lt;br /&gt;
  &lt;br /&gt;
  self::debug(&amp;quot;Ahh!&amp;quot;);&lt;br /&gt;
  self::dump(&#039;my_var&#039;,$my_var);&lt;br /&gt;
&lt;br /&gt;
See [[Practical_debugging]] section for complete information about debugging interfaces and where to find logs.&lt;/div&gt;</summary>
		<author><name>Quietmint</name></author>
	</entry>
	<entry>
		<id>https://gl.doc.boardgamearena.com/index.php?title=Gamehelpcoupcitystate&amp;diff=2801</id>
		<title>Gamehelpcoupcitystate</title>
		<link rel="alternate" type="text/html" href="https://gl.doc.boardgamearena.com/index.php?title=Gamehelpcoupcitystate&amp;diff=2801"/>
		<updated>2018-01-02T21:31:56Z</updated>

		<summary type="html">&lt;p&gt;Quietmint: /* Setup */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
In Coup, players vie for control of a corrupt city-state in renaissance Italy. Through your influence in the court (the character cards in your hand), bluff, steal, and murder your opponents to become the last player standing and rise to power.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
The 15-card deck contains 3 copies of 5 different characters (&#039;&#039;Ambassador&#039;&#039;, &#039;&#039;Assassin&#039;&#039;, &#039;&#039;Captain&#039;&#039;, &#039;&#039;Contessa&#039;&#039;, &#039;&#039;Duke&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
Each player begins with ₤2 (or ₤1 in a two-player game) and 2 cards. Money is public knowledge, but character cards in hand are secret.&lt;br /&gt;
&lt;br /&gt;
== Actions ==&lt;br /&gt;
On your turn, take any action you can afford:&lt;br /&gt;
&lt;br /&gt;
=== General actions (always available) ===&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Income&#039;&#039;&#039;: Take ₤1 from the treasury. Cannot be blocked.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Foreign Aid&#039;&#039;&#039;: Take ₤2 from the treasury. Any player claiming to be the &#039;&#039;Duke&#039;&#039; can block.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Coup&#039;&#039;&#039;: Pay ₤7 to the treasury and make another player lose influence (kill a character card). Cannot be blocked. If you start your turn with ₤10, you must choose this action.&lt;br /&gt;
&lt;br /&gt;
=== Character actions (must claim to have that character card in hand) ===&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Tax&#039;&#039;&#039; (as the &#039;&#039;Duke&#039;&#039;): Take ₤3 from the treasury. Cannot be blocked.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Steal&#039;&#039;&#039; (as the &#039;&#039;Captain&#039;&#039;): Take ₤2 from another player. The targeted player can block by claiming to be the &#039;&#039;Ambassador&#039;&#039; or the &#039;&#039;Captain&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Exchange&#039;&#039;&#039; (as the &#039;&#039;Ambassador&#039;&#039;): Draw 2 cards from the court deck, then return 2 cards to the deck. Cannot be blocked.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Assassinate&#039;&#039;&#039; (as the &#039;&#039;Assassin&#039;&#039;): Pay ₤3 to the treasury and make another player lose influence (kill a character card). The targeted player can block by claiming to be the &#039;&#039;Contessa&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Challenges ==&lt;br /&gt;
&lt;br /&gt;
Any player making a character claim can be challenged. A challenge always results in one player losing a character. The challenged player reveals a card from his/her hand.&lt;br /&gt;
&lt;br /&gt;
• If bluffing, that card is killed.&lt;br /&gt;
&lt;br /&gt;
• If truthful, that card is shuffled into the deck, replaced, and the challenger kills a card from his/her hand.&lt;br /&gt;
&lt;br /&gt;
Dead character cards remain face-up and their influence can no longer be used. If both of your characters die, you&#039;re eliminated. The last player remaining wins! There is no second place.&lt;br /&gt;
&lt;br /&gt;
== Variants ==&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Rounds to win&#039;&#039;&#039;: A standard game of Coup is only one round. As the game is quite short, you may wish to play multiple rounds until one player accumulates a predetermined number of wins (1 - 5). Consider the number of players when selecting this option (e.g., 5 rounds to win means you&#039;ll play up to 9 rounds in a two-player game but up to 25 rounds in a six-player game).&lt;/div&gt;</summary>
		<author><name>Quietmint</name></author>
	</entry>
	<entry>
		<id>https://gl.doc.boardgamearena.com/index.php?title=Gamehelpcoupcitystate&amp;diff=2800</id>
		<title>Gamehelpcoupcitystate</title>
		<link rel="alternate" type="text/html" href="https://gl.doc.boardgamearena.com/index.php?title=Gamehelpcoupcitystate&amp;diff=2800"/>
		<updated>2018-01-02T21:31:14Z</updated>

		<summary type="html">&lt;p&gt;Quietmint: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
In Coup, players vie for control of a corrupt city-state in renaissance Italy. Through your influence in the court (the character cards in your hand), bluff, steal, and murder your opponents to become the last player standing and rise to power.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
The 15-card deck contains 3 copies of 5 different characters (&#039;&#039;Ambassador&#039;&#039;, &#039;&#039;Assassin&#039;&#039;, &#039;&#039;Captain&#039;&#039;, &#039;&#039;Contessa&#039;&#039;, &#039;&#039;Duke&#039;&#039;). Each player begins with ₤2 (or ₤1 in a two-player game) and 2 cards. Money is public knowledge, but character cards in hand are secret.&lt;br /&gt;
&lt;br /&gt;
== Actions ==&lt;br /&gt;
On your turn, take any action you can afford:&lt;br /&gt;
&lt;br /&gt;
=== General actions (always available) ===&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Income&#039;&#039;&#039;: Take ₤1 from the treasury. Cannot be blocked.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Foreign Aid&#039;&#039;&#039;: Take ₤2 from the treasury. Any player claiming to be the &#039;&#039;Duke&#039;&#039; can block.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Coup&#039;&#039;&#039;: Pay ₤7 to the treasury and make another player lose influence (kill a character card). Cannot be blocked. If you start your turn with ₤10, you must choose this action.&lt;br /&gt;
&lt;br /&gt;
=== Character actions (must claim to have that character card in hand) ===&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Tax&#039;&#039;&#039; (as the &#039;&#039;Duke&#039;&#039;): Take ₤3 from the treasury. Cannot be blocked.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Steal&#039;&#039;&#039; (as the &#039;&#039;Captain&#039;&#039;): Take ₤2 from another player. The targeted player can block by claiming to be the &#039;&#039;Ambassador&#039;&#039; or the &#039;&#039;Captain&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Exchange&#039;&#039;&#039; (as the &#039;&#039;Ambassador&#039;&#039;): Draw 2 cards from the court deck, then return 2 cards to the deck. Cannot be blocked.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Assassinate&#039;&#039;&#039; (as the &#039;&#039;Assassin&#039;&#039;): Pay ₤3 to the treasury and make another player lose influence (kill a character card). The targeted player can block by claiming to be the &#039;&#039;Contessa&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Challenges ==&lt;br /&gt;
&lt;br /&gt;
Any player making a character claim can be challenged. A challenge always results in one player losing a character. The challenged player reveals a card from his/her hand.&lt;br /&gt;
&lt;br /&gt;
• If bluffing, that card is killed.&lt;br /&gt;
&lt;br /&gt;
• If truthful, that card is shuffled into the deck, replaced, and the challenger kills a card from his/her hand.&lt;br /&gt;
&lt;br /&gt;
Dead character cards remain face-up and their influence can no longer be used. If both of your characters die, you&#039;re eliminated. The last player remaining wins! There is no second place.&lt;br /&gt;
&lt;br /&gt;
== Variants ==&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Rounds to win&#039;&#039;&#039;: A standard game of Coup is only one round. As the game is quite short, you may wish to play multiple rounds until one player accumulates a predetermined number of wins (1 - 5). Consider the number of players when selecting this option (e.g., 5 rounds to win means you&#039;ll play up to 9 rounds in a two-player game but up to 25 rounds in a six-player game).&lt;/div&gt;</summary>
		<author><name>Quietmint</name></author>
	</entry>
	<entry>
		<id>https://gl.doc.boardgamearena.com/index.php?title=Gamehelpcoupcitystate&amp;diff=2799</id>
		<title>Gamehelpcoupcitystate</title>
		<link rel="alternate" type="text/html" href="https://gl.doc.boardgamearena.com/index.php?title=Gamehelpcoupcitystate&amp;diff=2799"/>
		<updated>2018-01-02T21:30:56Z</updated>

		<summary type="html">&lt;p&gt;Quietmint: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
In Coup, players vie for control of a corrupt city-state in renaissance Italy. Through your influence in the court (the character cards in your hand), bluff, steal, and murder your opponents to become the last player standing and rise to power.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
The 15-card deck contains 3 copies of 5 different characters (&#039;&#039;Ambassador&#039;&#039;, &#039;&#039;Assassin&#039;&#039;, &#039;&#039;Captain&#039;&#039;, &#039;&#039;Contessa&#039;&#039;, &#039;&#039;Duke&#039;&#039;). Each player begins with ₤2 (or ₤1 in a two-player game) and 2 cards. Money is public knowledge, but character cards in hand are secret.&lt;br /&gt;
&lt;br /&gt;
== Actions ==&lt;br /&gt;
On your turn, take any action you can afford:&lt;br /&gt;
&lt;br /&gt;
=== General actions (always available) ===&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Income&#039;&#039;&#039;: Take ₤1 from the treasury. Cannot be blocked.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Foreign Aid&#039;&#039;&#039;: Take ₤2 from the treasury. Any player claiming to be the &#039;&#039;Duke&#039;&#039; can block.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Coup&#039;&#039;&#039;: Pay ₤7 to the treasury and make another player lose influence (kill a character card). Cannot be blocked. If you start your turn with ₤10, you must choose this action.&lt;br /&gt;
&lt;br /&gt;
=== Character actions (must claim to have that character card in hand) ===&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Tax&#039;&#039;&#039; (as the &#039;&#039;Duke&#039;&#039;): Take ₤3 from the treasury. Cannot be blocked.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Steal&#039;&#039;&#039; (as the &#039;&#039;Captain&#039;&#039;): Take ₤2 from another player. The targeted player can block by claiming to be the &#039;&#039;Ambassador&#039;&#039; or the &#039;&#039;Captain&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Exchange&#039;&#039;&#039; (as the &#039;&#039;Ambassador&#039;&#039;): Draw 2 cards from the court deck, then return 2 cards to the deck. Cannot be blocked.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Assassinate&#039;&#039;&#039; (as the &#039;&#039;Assassin&#039;&#039;): Pay ₤3 to the treasury and make another player lose influence (kill a character card). The targeted player can block by claiming to be the &#039;&#039;Contessa&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Challenges ==&lt;br /&gt;
&lt;br /&gt;
Any player making a character claim can be challenged. A challenge always results in one player losing a character. The challenged player reveals a card from his/her hand.&lt;br /&gt;
&lt;br /&gt;
• If bluffing, that card is killed.&lt;br /&gt;
&lt;br /&gt;
• If truthful, that card is shuffled into the deck, replaced, and the challenger kills a card from his/her hand.&lt;br /&gt;
&lt;br /&gt;
Dead character cards remain face-up and their influence can no longer be used. If both of your characters die, you&#039;re eliminated. The last player remaining wins! There is no second place.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Variants ==&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Rounds to win&#039;&#039;&#039;: A standard game of Coup is only one round. As the game is quite short, you may wish to play multiple rounds until one player accumulates a predetermined number of wins (1 - 5). Consider the number of players when selecting this option (e.g., 5 rounds to win means you&#039;ll play up to 9 rounds in a two-player game but up to 25 rounds in a six-player game).&lt;/div&gt;</summary>
		<author><name>Quietmint</name></author>
	</entry>
	<entry>
		<id>https://gl.doc.boardgamearena.com/index.php?title=Gamehelpcoupcitystate&amp;diff=2798</id>
		<title>Gamehelpcoupcitystate</title>
		<link rel="alternate" type="text/html" href="https://gl.doc.boardgamearena.com/index.php?title=Gamehelpcoupcitystate&amp;diff=2798"/>
		<updated>2018-01-02T21:30:19Z</updated>

		<summary type="html">&lt;p&gt;Quietmint: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
In Coup, players vie for control of a corrupt city-state in renaissance Italy. Through your influence in the court (the character cards in your hand), bluff, steal, and murder your opponents to become the last player standing and rise to power.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
The 15-card deck contains 3 copies of 5 different characters (&#039;&#039;Ambassador&#039;&#039;, &#039;&#039;Assassin&#039;&#039;, &#039;&#039;Captain&#039;&#039;, &#039;&#039;Contessa&#039;&#039;, &#039;&#039;Duke&#039;&#039;). Each player begins with ₤2 (or ₤1 in a two-player game) and 2 cards. Money is public knowledge, but character cards in hand are secret.&lt;br /&gt;
&lt;br /&gt;
== Actions ==&lt;br /&gt;
On your turn, take any action you can afford:&lt;br /&gt;
&lt;br /&gt;
==== General actions (always available) ====&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Income&#039;&#039;&#039;: Take ₤1 from the treasury. Cannot be blocked.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Foreign Aid&#039;&#039;&#039;: Take ₤2 from the treasury. Any player claiming to be the &#039;&#039;Duke&#039;&#039; can block.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Coup&#039;&#039;&#039;: Pay ₤7 to the treasury and make another player lose influence (kill a character card). Cannot be blocked. If you start your turn with ₤10, you must choose this action.&lt;br /&gt;
&lt;br /&gt;
==== Character actions (must claim to have that character card in hand) ====&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Tax&#039;&#039;&#039; (as the &#039;&#039;Duke&#039;&#039;): Take ₤3 from the treasury. Cannot be blocked.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Steal&#039;&#039;&#039; (as the &#039;&#039;Captain&#039;&#039;): Take ₤2 from another player. The targeted player can block by claiming to be the &#039;&#039;Ambassador&#039;&#039; or the &#039;&#039;Captain&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Exchange&#039;&#039;&#039; (as the &#039;&#039;Ambassador&#039;&#039;): Draw 2 cards from the court deck, then return 2 cards to the deck. Cannot be blocked.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Assassinate&#039;&#039;&#039; (as the &#039;&#039;Assassin&#039;&#039;): Pay ₤3 to the treasury and make another player lose influence (kill a character card). The targeted player can block by claiming to be the &#039;&#039;Contessa&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Challenges ==&lt;br /&gt;
&lt;br /&gt;
Any player making a character claim can be challenged. A challenge always results in one player losing a character. The challenged player reveals a card from his/her hand.&lt;br /&gt;
&lt;br /&gt;
• If bluffing, that card is killed.&lt;br /&gt;
&lt;br /&gt;
• If truthful, that card is shuffled into the deck, replaced, and the challenger kills a card from his/her hand.&lt;br /&gt;
&lt;br /&gt;
Dead character cards remain face-up and their influence can no longer be used. If both of your characters die, you&#039;re eliminated. The last player remaining wins! There is no second place.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Variants ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Rounds to win&#039;&#039;&#039;: A standard game of Coup is only one round. As the game is quite short, you may wish to play multiple rounds until one player accumulates a predetermined number of wins (1 - 5). Consider the number of players when selecting this option (e.g., 5 rounds to win means you&#039;ll play up to 9 rounds in a two-player game but up to 25 rounds in a six-player game).&lt;/div&gt;</summary>
		<author><name>Quietmint</name></author>
	</entry>
	<entry>
		<id>https://gl.doc.boardgamearena.com/index.php?title=Gamehelpcoupcitystate&amp;diff=2797</id>
		<title>Gamehelpcoupcitystate</title>
		<link rel="alternate" type="text/html" href="https://gl.doc.boardgamearena.com/index.php?title=Gamehelpcoupcitystate&amp;diff=2797"/>
		<updated>2018-01-02T21:28:17Z</updated>

		<summary type="html">&lt;p&gt;Quietmint: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
In Coup, players vie for control of a corrupt city-state in renaissance Italy. Through your influence in the court (the character cards in your hand), bluff, steal, and murder your opponents to become the last player standing and rise to power.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
The 15-card deck contains 3 copies of 5 different characters (&#039;&#039;Ambassador&#039;&#039;, &#039;&#039;Assassin&#039;&#039;, &#039;&#039;Captain&#039;&#039;, &#039;&#039;Contessa&#039;&#039;, &#039;&#039;Duke&#039;&#039;). Each player begins with ₤2 (or ₤1 in a two-player game) and 2 cards. Money is public knowledge, but character cards in hand are secret.&lt;br /&gt;
&lt;br /&gt;
== Actions ==&lt;br /&gt;
On your turn, take any action you can afford:&lt;br /&gt;
&lt;br /&gt;
=== General actions (always available) ===&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Income&#039;&#039;&#039;: Take ₤1 from the treasury. Cannot be blocked.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Foreign Aid&#039;&#039;&#039;: Take ₤2 from the treasury. Any player claiming to be the &#039;&#039;Duke&#039;&#039; can block.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Coup&#039;&#039;&#039;: Pay ₤7 to the treasury and make another player lose influence (kill a character card). Cannot be blocked. If you start your turn with ₤10, you must choose this action.&lt;br /&gt;
&lt;br /&gt;
==== Character actions (must claim to have that character card in hand) ====&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Tax&#039;&#039;&#039; (as the &#039;&#039;Duke&#039;&#039;): Take ₤3 from the treasury. Cannot be blocked.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Steal&#039;&#039;&#039; (as the &#039;&#039;Captain&#039;&#039;): Take ₤2 from another player. The targeted player can block by claiming to be the &#039;&#039;Ambassador&#039;&#039; or the &#039;&#039;Captain&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Exchange&#039;&#039;&#039; (as the &#039;&#039;Ambassador&#039;&#039;): Draw 2 cards from the court deck, then return 2 cards to the deck. Cannot be blocked.&lt;br /&gt;
&lt;br /&gt;
• &#039;&#039;&#039;Assassinate&#039;&#039;&#039; (as the &#039;&#039;Assassin&#039;&#039;): Pay ₤3 to the treasury and make another player lose influence (kill a character card). The targeted player can block by claiming to be the &#039;&#039;Contessa&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Challenges ==&lt;br /&gt;
&lt;br /&gt;
Any player making a character claim can be challenged. The challenged player reveals a card from his/her hand.&lt;br /&gt;
&lt;br /&gt;
- If bluffing, that card is killed.&lt;br /&gt;
&lt;br /&gt;
- If truthful, that card is shuffled into the deck, replaced, and the challenger kills a card from his/her hand.&lt;br /&gt;
&lt;br /&gt;
Either way, someone loses a character. Dead character cards remain face-up and their influence can no longer be used. If both of your characters die, you&#039;re eliminated. The last player remaining wins! There is no second place.&lt;br /&gt;
&lt;br /&gt;
== Variants ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Rounds to win&#039;&#039;&#039;: A standard game of Coup is only one round. As the game is quite short, you may wish to play multiple rounds until one player accumulates a predetermined number of wins (1 - 5). Consider the number of players when selecting this option (e.g., 5 rounds to win means you&#039;ll play up to 9 rounds in a two-player game but up to 25 rounds in a six-player game).&lt;/div&gt;</summary>
		<author><name>Quietmint</name></author>
	</entry>
	<entry>
		<id>https://gl.doc.boardgamearena.com/index.php?title=Gamehelpcoupcitystate&amp;diff=2796</id>
		<title>Gamehelpcoupcitystate</title>
		<link rel="alternate" type="text/html" href="https://gl.doc.boardgamearena.com/index.php?title=Gamehelpcoupcitystate&amp;diff=2796"/>
		<updated>2018-01-02T21:04:31Z</updated>

		<summary type="html">&lt;p&gt;Quietmint: Created page with &amp;quot;In Coup, you head a family vying for control of a corrupt Italian city-state. Through your influence in the court (the character cards in your hand), bluff, steal, and murder ...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In Coup, you head a family vying for control of a corrupt Italian city-state. Through your influence in the court (the character cards in your hand), bluff, steal, and murder your opponents to become the last player standing and rise to power.&lt;br /&gt;
&lt;br /&gt;
The 15-card deck contains 3 copies of 5 different characters (&#039;&#039;Ambassador&#039;&#039;, &#039;&#039;Assassin&#039;&#039;, &#039;&#039;Captain&#039;&#039;, &#039;&#039;Contessa&#039;&#039;, &#039;&#039;Duke&#039;&#039;). Each player begins with ₤2 (or ₤1 in a two-player game) and 2 cards. Money is public knowledge, but character cards in hand are secret.&lt;br /&gt;
&lt;br /&gt;
On your turn, take any action you can afford:&lt;br /&gt;
* General actions (always available):&lt;br /&gt;
** &#039;&#039;&#039;Income&#039;&#039;&#039;: Take ₤1 from the treasury. Cannot be blocked.&lt;br /&gt;
** &#039;&#039;&#039;Foreign Aid&#039;&#039;&#039;: Take ₤2 from the treasury. Any player claiming to be the &#039;&#039;Duke&#039;&#039; can block.&lt;br /&gt;
** &#039;&#039;&#039;Coup&#039;&#039;&#039;: Pay ₤7 to the treasury and make another player lose influence (kill a character card). Cannot be blocked. If you start your turn with ₤10, you must choose this action.&lt;br /&gt;
* Character actions (must claim to have that character card in hand):&lt;br /&gt;
** &#039;&#039;&#039;Tax&#039;&#039;&#039; (as the &#039;&#039;Duke&#039;&#039;): Take ₤3 from the treasury. Cannot be blocked.&lt;br /&gt;
** &#039;&#039;&#039;Steal&#039;&#039;&#039; (as the &#039;&#039;Captain&#039;&#039;): Take ₤2 from another player. The targeted player can block by claiming to be the &#039;&#039;Ambassador&#039;&#039; or the &#039;&#039;Captain&#039;&#039;.&lt;br /&gt;
** &#039;&#039;&#039;Exchange&#039;&#039;&#039; (as the &#039;&#039;Ambassador&#039;&#039;): Draw 2 cards from the court deck, then return 2 cards to the deck. Cannot be blocked.&lt;br /&gt;
** &#039;&#039;&#039;Assassinate&#039;&#039;&#039; (as the &#039;&#039;Assassin&#039;&#039;): Pay ₤3 to the treasury and make another player lose influence (kill a character card). The targeted player can block by claiming to be the &#039;&#039;Contessa&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Any player making a character claim can be challenged. The challenged player reveals a card from his/her hand. If bluffing, that card is killed. If truthful, that card is shuffled into the deck, replaced, and the challenger kills a card from his/her hand. Dead character cards remain face-up for all players to see. Their influence can no longer be used. If both of your characters die, you&#039;re eliminated. The last player remaining wins! There is no second place.&lt;br /&gt;
&lt;br /&gt;
== Game options and variants ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Rounds to win&#039;&#039;&#039;: A standard game of Coup is only one round. As the game is quite short, you may wish to play multiple rounds until one player accumulates a predetermined number of wins (1 - 5). Consider the number of players when selecting this option (e.g., 5 rounds to win means you&#039;ll play up to 9 rounds in a two-player game but up to 25 rounds in a six-player game).&lt;/div&gt;</summary>
		<author><name>Quietmint</name></author>
	</entry>
	<entry>
		<id>https://gl.doc.boardgamearena.com/index.php?title=Main_game_logic:_yourgamename.game.php&amp;diff=2766</id>
		<title>Main game logic: yourgamename.game.php</title>
		<link rel="alternate" type="text/html" href="https://gl.doc.boardgamearena.com/index.php?title=Main_game_logic:_yourgamename.game.php&amp;diff=2766"/>
		<updated>2017-12-06T00:36:00Z</updated>

		<summary type="html">&lt;p&gt;Quietmint: /* One player wins and everybody else loses */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
This file is the main file for your game logic. Here you initialize the game, persist data, implement the rules and notify changes to the client interface.&lt;br /&gt;
&lt;br /&gt;
== File Structure ==&lt;br /&gt;
&lt;br /&gt;
The details on how the file is structured is described directly with comments on the code skeleton provided to you.&lt;br /&gt;
 &lt;br /&gt;
Basically, here&#039;s this structure:&lt;br /&gt;
* EmptyGame (constructor): where you define global variables.&lt;br /&gt;
* setupNewGame: initial setup of the game.&lt;br /&gt;
* getAllDatas: where you retrieve all game data during a complete reload of the game.&lt;br /&gt;
* getGameProgression: where you compute the game progression indicator.&lt;br /&gt;
* Utility functions: your utility functions.&lt;br /&gt;
* Player actions: the entry points for players actions. &lt;br /&gt;
* Game state arguments: methods to return additional data on specific game states ([http://en.doc.boardgamearena.com/Your_game_state_machine:_states.inc.php#args more info here]).&lt;br /&gt;
* Game state actions: the logic to run when entering a new game state ([http://en.doc.boardgamearena.com/Your_game_state_machine:_states.inc.php#action more info here]).&lt;br /&gt;
* zombieTurn: what to do it&#039;s the turn of a zombie player.&lt;br /&gt;
&lt;br /&gt;
== Accessing player informations ==&lt;br /&gt;
&lt;br /&gt;
; getPlayersNumber()&lt;br /&gt;
: Returns the number of players playing at the table&lt;br /&gt;
: Note: doesn&#039;t work in setupNewGame so use count($players) instead&lt;br /&gt;
&lt;br /&gt;
; getActivePlayerId()&lt;br /&gt;
: Get the &amp;quot;active_player&amp;quot;, whatever what is the current state type.&lt;br /&gt;
: Note: it does NOT mean that this player is active right now, because state type could be &amp;quot;game&amp;quot; or &amp;quot;multiplayer&amp;quot;&lt;br /&gt;
: Note: avoid using this method in a &amp;quot;multiplayer&amp;quot; state because it does not mean anything.&lt;br /&gt;
&lt;br /&gt;
; getActivePlayerName()&lt;br /&gt;
: Get the &amp;quot;active_player&amp;quot; name&lt;br /&gt;
: Note: avoid using this method in a &amp;quot;multiplayer&amp;quot; state because it does not mean anything.&lt;br /&gt;
&lt;br /&gt;
; loadPlayersBasicInfos()&lt;br /&gt;
: Get an associative array with generic data about players (ie: not game specific data).&lt;br /&gt;
: The key of the associative array is the player id.&lt;br /&gt;
: The content of each value is:&lt;br /&gt;
: * player_name&lt;br /&gt;
: * player_color (ex: ff0000)&lt;br /&gt;
&lt;br /&gt;
; getCurrentPlayerId()&lt;br /&gt;
: Get the &amp;quot;current_player&amp;quot;. The current player is the one from which the action originated (the one who send the request).&lt;br /&gt;
: &#039;&#039;&#039;Be careful&#039;&#039;&#039;: It is not always the active player.&lt;br /&gt;
: In general, you shouldn&#039;t use this method, unless you are in &amp;quot;multiplayer&amp;quot; state.&lt;br /&gt;
&lt;br /&gt;
; getCurrentPlayerName()&lt;br /&gt;
: Get the &amp;quot;current_player&amp;quot; name&lt;br /&gt;
: Be careful using this method (see above).&lt;br /&gt;
&lt;br /&gt;
; getCurrentPlayerColor()&lt;br /&gt;
: Get the &amp;quot;current_player&amp;quot; color&lt;br /&gt;
: Be careful using this method (see above).&lt;br /&gt;
&lt;br /&gt;
; isCurrentPlayerZombie()&lt;br /&gt;
: Check the &amp;quot;current_player&amp;quot; zombie status. If true, player is zombie, i.e. left or was kicked out of the game.&lt;br /&gt;
&lt;br /&gt;
== Accessing database ==&lt;br /&gt;
&lt;br /&gt;
The main game logic should be the only point from where you should access to the game database. You access your database using SQL queries with the methods below.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
BGA is using [http://dev.mysql.com/doc/refman/5.0/en/sql-syntax-transactions.html database transactions]. It means that your database changes WON&#039;T BE APPLIED to the database until your request ends normally. Using transaction is in fact very useful for you: at any time, if your game logic detects that something is wrong (ex: unallowed move), you just have to throw an exception and all the changes already performed on the game situation will be removed.&lt;br /&gt;
&lt;br /&gt;
; DbQuery( $sql )&lt;br /&gt;
: This is the generic method to access the database.&lt;br /&gt;
: It can execute any type of SELECT/UPDATE/DELETE/REPLACE query on the database.&lt;br /&gt;
: You should use it for UPDATE/DELETE/REPLACE query. For SELECT queries, the specialized methods below are much better.&lt;br /&gt;
&lt;br /&gt;
; getUniqueValueFromDB( $sql )&lt;br /&gt;
: Returns a unique value from DB or null if no value is found.&lt;br /&gt;
: $sql must be a SELECT query.&lt;br /&gt;
: Raise an exception if more than 1 row is returned.&lt;br /&gt;
&lt;br /&gt;
; getCollectionFromDB( $sql, $bSingleValue=false )&lt;br /&gt;
: Returns an associative array of rows for a sql SELECT query.&lt;br /&gt;
: The key of the resulting associative array is the first field specified in the SELECT query.&lt;br /&gt;
: The value of the resulting associative array if an associative array with all the field specified in the SELECT query and associated values.&lt;br /&gt;
: First column must be a primary or alternate key.&lt;br /&gt;
: The resulting collection can be empty.&lt;br /&gt;
: If you specified $bSingleValue=true and if your SQL query request 2 fields A and B, the method returns an associative array &amp;quot;A=&amp;gt;B&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Example 1:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
self::getCollectionFromDB( &amp;quot;SELECT player_id id, player_name name, player_score score FROM player&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
Result:&lt;br /&gt;
array(&lt;br /&gt;
 1234 =&amp;gt; array( &#039;id&#039;=&amp;gt;1234, &#039;name&#039;=&amp;gt;&#039;myuser0&#039;, &#039;score&#039;=&amp;gt;1 ),&lt;br /&gt;
 1235 =&amp;gt; array( &#039;id&#039;=&amp;gt;1235, &#039;name&#039;=&amp;gt;&#039;myuser1&#039;, &#039;score&#039;=&amp;gt;0 )&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Example 2:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
self::getCollectionFromDB( &amp;quot;SELECT player_id id, player_name name FROM player&amp;quot;, true );&lt;br /&gt;
&lt;br /&gt;
Result:&lt;br /&gt;
array(&lt;br /&gt;
 1234 =&amp;gt; &#039;myuser0&#039;,&lt;br /&gt;
 1235 =&amp;gt; &#039;myuser1&#039;&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; getNonEmptyCollectionFromDB( $sql )&lt;br /&gt;
: Idem than previous one, but raise an exception if the collection is empty&lt;br /&gt;
&lt;br /&gt;
; getObjectFromDB( $sql )&lt;br /&gt;
: Returns one row for the sql SELECT query as an associative array or null if there is no result&lt;br /&gt;
: Raise an exception if the query return more than one row&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
self::getObjectFromDB( &amp;quot;SELECT player_id id, player_name name, player_score score FROM player WHERE player_id=&#039;$player_id&#039;&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
Result:&lt;br /&gt;
array(&lt;br /&gt;
  &#039;id&#039;=&amp;gt;1234, &#039;name&#039;=&amp;gt;&#039;myuser0&#039;, &#039;score&#039;=&amp;gt;1 &lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; getNonEmptyObjectFromDB( $sql )&lt;br /&gt;
: Idem than previous one, but raise an exception if no row is found&lt;br /&gt;
&lt;br /&gt;
; getObjectListFromDB( $sql, $bUniqueValue=false )&lt;br /&gt;
: Return an array of rows for a sql SELECT query.&lt;br /&gt;
: the result if the same than &amp;quot;getCollectionFromDB&amp;quot; except that the result is a simple array (and not an associative array).&lt;br /&gt;
: The result can be empty.&lt;br /&gt;
: If you specified $bUniqueValue=true and if your SQL query request 1 field, the method returns directly an array of values.&lt;br /&gt;
&lt;br /&gt;
Example 1:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
self::getObjectListFromDB( &amp;quot;SELECT player_id id, player_name name, player_score score FROM player&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
Result:&lt;br /&gt;
array(&lt;br /&gt;
 array( &#039;id&#039;=&amp;gt;1234, &#039;name&#039;=&amp;gt;&#039;myuser0&#039;, &#039;score&#039;=&amp;gt;1 ),&lt;br /&gt;
 array( &#039;id&#039;=&amp;gt;1235, &#039;name&#039;=&amp;gt;&#039;myuser1&#039;, &#039;score&#039;=&amp;gt;0 )&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Example 2:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
self::getObjectListFromDB( &amp;quot;SELECT player_name name FROM player&amp;quot;, true );&lt;br /&gt;
&lt;br /&gt;
Result:&lt;br /&gt;
array(&lt;br /&gt;
 &#039;myuser0&#039;,&lt;br /&gt;
 &#039;myuser1&#039;&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; getDoubleKeyCollectionFromDB( $sql, $bSingleValue=false )&lt;br /&gt;
: Return an associative array of associative array, from a SQL SELECT query.&lt;br /&gt;
: First array level correspond to first column specified in SQL query.&lt;br /&gt;
: Second array level correspond to second column specified in SQL query.&lt;br /&gt;
: If bSingleValue = true, keep only third column on result&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; DbGetLastId()&lt;br /&gt;
: Return the PRIMARY key of the last inserted row (see PHP mysql_insert_id function).&lt;br /&gt;
&lt;br /&gt;
; DbAffectedRow()&lt;br /&gt;
: Return the number of row affected by the last operation&lt;br /&gt;
&lt;br /&gt;
; escapeStringForDB( $string )&lt;br /&gt;
: You must use this function on every string type data in your database that contains unsafe data.&lt;br /&gt;
: (unsafe = can be modified by a player).&lt;br /&gt;
: This method makes sure that no SQL injection will be done through the string used.&lt;br /&gt;
: Note: if you using standard types in ajax actions, like AT_alphanum it is sanitized before arrival,&lt;br /&gt;
: this is only needed if you manage to get unchecked string, like in the games where user has to enter text as a response.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: see Editing [[Game database model: dbmodel.sql]] to know how to define your database model.&lt;br /&gt;
&lt;br /&gt;
== Use globals ==&lt;br /&gt;
&lt;br /&gt;
Sometimes, you have to keep a single integer value that is global to your game, and you don&#039;t want to create a DB table specifically for it.&lt;br /&gt;
&lt;br /&gt;
Using a BGA framework &amp;quot;global&amp;quot;, you can do such a thing. Your value will be stored in the &amp;quot;global&amp;quot; table in database, and you can access it with simple methods.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;initGameStateLabels&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This method is located at the beginning of your game logic. This is the place you defines the globals used in your game logic, by assigning them IDs.&lt;br /&gt;
&lt;br /&gt;
You can define up to 79 globals, with IDs from 10 to 89. You must NOT use globals outside this range as globals are used by other components of the framework.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        self::initGameStateLabels( array( &lt;br /&gt;
                &amp;quot;my_first_global_variable&amp;quot; =&amp;gt; 10,&lt;br /&gt;
                &amp;quot;my_second_global_variable&amp;quot; =&amp;gt; 11&lt;br /&gt;
        ) );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;setGameStateInitialValue( $value_label, $value_value )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Init your global value. Must be called before any use of your global, so you should call this method from your &amp;quot;setupNewGame&amp;quot; method.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;getGameStateValue( $value_label )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Retrieve the current value of a global.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;setGameStateValue( $value_label, $value_value )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Set the current value of a global.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;incGameStateValue( $value_label, $increment )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Increment the current value of a global. If increment is negative, decrement the value of the global.&lt;br /&gt;
&lt;br /&gt;
Return the final value of the global.&lt;br /&gt;
&lt;br /&gt;
== Game states and active players ==&lt;br /&gt;
&lt;br /&gt;
; checkAction( $actionName, $bThrowException=true )&lt;br /&gt;
: Check if action is valid regarding current game state (exception if fails).&lt;br /&gt;
: The action is valid if it is listed as a &amp;quot;possibleactions&amp;quot; in the current game state (see game state description).&lt;br /&gt;
: This method MUST be called in the first place in ALL your PHP methods that handle players action, in order to make sure a player can&#039;t do an action when the rules disallow it at this moment of the game.&lt;br /&gt;
: if &amp;quot;bThrowException&amp;quot; is set to &amp;quot;false&amp;quot;, the function return false in case of failure instead of throwing and exception. This is useful when several actions are possible in order to test each of them without throwing exceptions.&lt;br /&gt;
&lt;br /&gt;
; activeNextPlayer()&lt;br /&gt;
: Make the next player active in the natural player order.&lt;br /&gt;
: Note: you CANT use this method in a &amp;quot;activeplayer&amp;quot; or &amp;quot;multipleactiveplayer&amp;quot; state. You must use a &amp;quot;game&amp;quot; type game state for this.&lt;br /&gt;
&lt;br /&gt;
; activePrevPlayer()&lt;br /&gt;
: Make the previous player active (in the natural player order).&lt;br /&gt;
: Note: you CANT use this method in a &amp;quot;activeplayer&amp;quot; or &amp;quot;multipleactiveplayer&amp;quot; state. You must use a &amp;quot;game&amp;quot; type game state for this.&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;gamestate-&amp;gt;changeActivePlayer( $player_id )&lt;br /&gt;
: You can call this method to make any player active.&lt;br /&gt;
: Note: you CANT use this method in a &amp;quot;activeplayer&amp;quot; or &amp;quot;multipleactiveplayer&amp;quot; state. You must use a &amp;quot;game&amp;quot; type game state for this.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;gamestate-&amp;gt;getActivePlayerList()&lt;br /&gt;
: With this method you can retrieve the list of the active player at any time.&lt;br /&gt;
: During a &amp;quot;game&amp;quot; type gamestate, it will return a void array.&lt;br /&gt;
: During a &amp;quot;activeplayer&amp;quot; type gamestate, it will return an array with one value (the active player id).&lt;br /&gt;
: during a &amp;quot;multipleactiveplayer&amp;quot; type gamestate, it will return an array of the active players id.&lt;br /&gt;
: Note: you should only use this method is the latter case.&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;gamestate-&amp;gt;setAllPlayersMultiactive()&lt;br /&gt;
: With this method, all playing players are made active.&lt;br /&gt;
: Usually, you use this method at the beginning (ex: &amp;quot;st&amp;quot; action method) of a multiplayer game state when all players have to do some action.&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;gamestate-&amp;gt;setPlayersMultiactive( $players, $next_state )&lt;br /&gt;
: Make a specific list of players active during a multiactive gamestate.&lt;br /&gt;
: Bare in mind it doesn&#039;t deactivate other previously active players.&lt;br /&gt;
: &amp;quot;players&amp;quot; is the array of player id that should be made active.&lt;br /&gt;
: In case &amp;quot;players&amp;quot; is empty, the method trigger the &amp;quot;next_state&amp;quot; transition to go to the next game state.&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;gamestate-&amp;gt;setPlayerNonMultiactive( $player_id, $next_state )&lt;br /&gt;
: During a multiactive game state, make the specified player inactive.&lt;br /&gt;
: Usually, you call this method during a multiactive game state after a player did his action.&lt;br /&gt;
: If this player was the last active player, the method trigger the &amp;quot;next_state&amp;quot; transition to go to the next game state.&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;gamestate-&amp;gt;checkPossibleAction( $action )&lt;br /&gt;
: (rarely used)&lt;br /&gt;
: This works exactly like &amp;quot;checkAction&amp;quot;, except that it do NOT check if current player is active.&lt;br /&gt;
: This is used specifically in certain game states when you want to authorize some additional actions for players that are not active at the moment.&lt;br /&gt;
: Example: in Libertalia game, you want to authorize players to change their mind about card played. They are of course not active at the time they change their mind, so you cannot use &amp;quot;checkAction&amp;quot; and use &amp;quot;checkPossibleAction&amp;quot; instead.&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;gamestate-&amp;gt;nextState( $transition )&lt;br /&gt;
: Change current state to a new state. Important: parameter $transition is the name of the transition, and NOT the name of the target game state, see [[Your game state machine: states.inc.php]] for more information about states.&lt;br /&gt;
&lt;br /&gt;
; $this-&amp;gt;gamestate-&amp;gt;state()&lt;br /&gt;
: Get an associative array of current game state attributes, see [[Your game state machine: states.inc.php]] for state attributes.&lt;br /&gt;
  $state=$this-&amp;gt;gamestate-&amp;gt;state(); if( $state[&#039;name&#039;] == &#039;myGameState&#039; ) {...}&lt;br /&gt;
&lt;br /&gt;
== Players turn order ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;getNextPlayerTable()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Return an associative array which associate each player with the next player around the table.&lt;br /&gt;
&lt;br /&gt;
In addition, key 0 is associated to the first player to play.&lt;br /&gt;
&lt;br /&gt;
Example: if three player with ID 1, 2 and 3 are around the table, in this order, the method returns:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   array( &lt;br /&gt;
    1 =&amp;gt; 2, &lt;br /&gt;
    2 =&amp;gt; 3, &lt;br /&gt;
    3 =&amp;gt; 1, &lt;br /&gt;
    0 =&amp;gt; 1 &lt;br /&gt;
   );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;getPrevPlayerTable()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Same as above, but the associative array associate the previous player around the table.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;getPlayerAfter( $player_id )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Get player playing after given player in natural playing order.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;getPlayerBefore( $player_id )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Get player playing before given player in natural playing order.&lt;br /&gt;
&lt;br /&gt;
Note: There is no API to modify this order, if you have custom player order you have to maintain it in your database&lt;br /&gt;
and have custom function to access it.&lt;br /&gt;
&lt;br /&gt;
== Notify players ==&lt;br /&gt;
&lt;br /&gt;
To understand notifications, please read [http://www.slideshare.net/boardgamearena/the-bga-framework-at-a-glance The BGA Framework at a glance] first.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Notifications are sent at the very end of the request, when it ends normally. It means that if you throw an exception for any reason (ex: move not allowed), no notifications will be sent to players.&lt;br /&gt;
Notifications sent between the game start (setupNewGame) and the end of the &amp;quot;action&amp;quot; method of the first active state will never reach their destination.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;notifyAllPlayers( $notification_type, $notification_log, $notification_args )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Send a notification to all players of the game.&lt;br /&gt;
&lt;br /&gt;
* notification_type:&lt;br /&gt;
A string that defines the type of your notification.&lt;br /&gt;
&lt;br /&gt;
Your game interface Javascript logic will use this to know what is the type of the received notification (and to trigger the corresponding method).&lt;br /&gt;
&lt;br /&gt;
* notification_log:&lt;br /&gt;
A string that defines what is to be displayed in the game log.&lt;br /&gt;
&lt;br /&gt;
You can use an empty string here (&amp;quot;&amp;quot;). In this case, nothing is displayed in the game log.&lt;br /&gt;
&lt;br /&gt;
If you define a real string here, you should use &amp;quot;clienttranslate&amp;quot; method to make sure it can be translate.&lt;br /&gt;
&lt;br /&gt;
You can use arguments in your notification_log strings, that refers to values defines in the &amp;quot;notification_args&amp;quot; argument (see below). NB: Make sure you only use single quotes (&#039;), otherwise PHP will try to interpolate the variable and will ignore the values in the args array.&lt;br /&gt;
&lt;br /&gt;
Note: you CAN use some HTML inside your notification log, and it is working. However:&lt;br /&gt;
_ pay attention to keep the log clear.&lt;br /&gt;
_ try to not include some HTML tags inside the &amp;quot;clienttranslate&amp;quot; method, otherwise it will make the translators work more difficult. You can use a notification argument instead, and provide your HTML through this argument.&lt;br /&gt;
&lt;br /&gt;
* notification_args:&lt;br /&gt;
The arguments of your notifications, as an associative array.&lt;br /&gt;
&lt;br /&gt;
This array will be transmitted to the game interface logic, in order the game interface can be updated.&lt;br /&gt;
&lt;br /&gt;
Complete notifyAllPlayers example (from &amp;quot;Reversi&amp;quot;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
self::notifyAllPlayers( &amp;quot;playDisc&amp;quot;, clienttranslate( &#039;${player_name} plays a disc and turns over ${returned_nbr} disc(s)&#039; ),&lt;br /&gt;
 array(&lt;br /&gt;
        &#039;player_id&#039; =&amp;gt; $player_id,&lt;br /&gt;
        &#039;player_name&#039; =&amp;gt; self::getActivePlayerName(),&lt;br /&gt;
        &#039;returned_nbr&#039; =&amp;gt; count( $turnedOverDiscs ),&lt;br /&gt;
        &#039;x&#039; =&amp;gt; $x,&lt;br /&gt;
        &#039;y&#039; =&amp;gt; $y&lt;br /&gt;
     ) );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can see in the example above the use of the &amp;quot;clienttranslate&amp;quot; method, and the use of 2 arguments &amp;quot;player_name&amp;quot; and &amp;quot;returned_nbr&amp;quot; in the notification log.&lt;br /&gt;
&lt;br /&gt;
Important: NO private data must be sent with this method, as a cheater could see it even it is not used explicitly by the game interface logic. If you want to send private information to a player, please use notifyPlayer below.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;notifyPlayer( $player_id, $notification_type, $notification_log, $notification_args )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Same as above, except that the notification is sent to one player only.&lt;br /&gt;
&lt;br /&gt;
This method must be used each time some private information must be transmitted to a player.&lt;br /&gt;
&lt;br /&gt;
Important: the variable for player name must be ${player_name} in order to be highlighted with the player color in the game log&lt;br /&gt;
&lt;br /&gt;
== Game statistics ==&lt;br /&gt;
&lt;br /&gt;
There are 2 types of statistics:&lt;br /&gt;
* a &amp;quot;player&amp;quot; statistic is a statistic associated to a player&lt;br /&gt;
* a &amp;quot;table&amp;quot; statistics is a statistic not associated to a player (global statistic for this game).&lt;br /&gt;
&lt;br /&gt;
See [[Game statistics: stats.inc.php]] to see how you defines statistics for your game.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;initStat( $table_or_player, $name, $value, $player_id = null )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create a statistic entry  with a default value.&lt;br /&gt;
This method must be called for each statistics of your game, in your setupNewGame method.&lt;br /&gt;
&lt;br /&gt;
&#039;$table_or_player&#039; must be set to &amp;quot;table&amp;quot; if this is a table statistics, or &amp;quot;player&amp;quot; if this is a player statistics.&lt;br /&gt;
&lt;br /&gt;
&#039;$name&#039; is the name of your statistics, as it has been defined in your stats.inc.php file.&lt;br /&gt;
&lt;br /&gt;
&#039;$value&#039; is the initial value of the statistics. If this is a player statistics and if the player is not specified by &amp;quot;$player_id&amp;quot; argument, the value is set for ALL players.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;setStat( $value, $name, $player_id = null )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Set a statistic $name to $value.&lt;br /&gt;
&lt;br /&gt;
If &amp;quot;$player_id&amp;quot; is not specified, setStat consider it is a TABLE statistic.&lt;br /&gt;
&lt;br /&gt;
If &amp;quot;$player_id&amp;quot; is specified, setStat consider it is a PLAYER statistic.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;incStat( $delta, $name, $player_id = null )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Increment (or decrement) specified statistic value by $delta value. Same behavior as setStat function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;getStat( $name, $player_id = null )&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Return the value of statistic specified by $name. Useful when creating derivative statistics such as average.&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
See [[Translations]]&lt;br /&gt;
&lt;br /&gt;
== Manage player scores and Tie breaker ==&lt;br /&gt;
&lt;br /&gt;
=== Normal scoring ===&lt;br /&gt;
&lt;br /&gt;
At the end of the game, players automatically get a rank depending on their score: the player with the biggest score is #1, the player with the second biggest score is #2, and so on...&lt;br /&gt;
&lt;br /&gt;
During the game, you update player&#039;s score directly by updating &amp;quot;player_score&amp;quot; field of &amp;quot;player&amp;quot; table in database.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  // +2 points to active player&lt;br /&gt;
  self::DbQuery( &amp;quot;UPDATE player SET player_score=player_score+2 WHERE player_id=&#039;&amp;quot;.self::getActivePlayerId().&amp;quot;&#039;&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
  // Set score of active player to 5&lt;br /&gt;
  self::DbQuery( &amp;quot;UPDATE player SET player_score=5 WHERE player_id=&#039;&amp;quot;.self::getActivePlayerId().&amp;quot;&#039;&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: don&#039;t forget to notify the client side in order the score control can be updated accordingly.&lt;br /&gt;
&lt;br /&gt;
=== Tie breaker ===&lt;br /&gt;
&lt;br /&gt;
Tie breaker is used when two players get the same score at the end of a game.&lt;br /&gt;
&lt;br /&gt;
Tie breaker is using &amp;quot;player_score_aux&amp;quot; field of &amp;quot;player&amp;quot; table. It is updated exactly like the &amp;quot;player_score&amp;quot; field.&lt;br /&gt;
&lt;br /&gt;
Tie breaker score is displayed only for players who are tied at the end of the game. Most of the time, it is not supposed to be displayed explicitly during the game.&lt;br /&gt;
&lt;br /&gt;
When you are using &amp;quot;player_score_aux&amp;quot; functionality, you must describe the formula to use in your gameinfos.inc.php file like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
         &#039;tie_breaker_description&#039; =&amp;gt; totranslate(&amp;quot;Describe here your tie breaker formula&amp;quot;),&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This description will be used as a tooltip to explain to players how this auxiliary score has been calculated.&lt;br /&gt;
&lt;br /&gt;
=== Co-operative game ===&lt;br /&gt;
&lt;br /&gt;
To make everyone lose in full-coop game:&lt;br /&gt;
&lt;br /&gt;
Add the following in gameinfos.inc.php :&lt;br /&gt;
&#039;is_coop&#039; =&amp;gt; 1, // full cooperative&lt;br /&gt;
&lt;br /&gt;
And score zero to everyone.&lt;br /&gt;
&lt;br /&gt;
=== Semi-coop ===&lt;br /&gt;
&lt;br /&gt;
If the game is not full-coop, then everyone lose = everyone is tie. I.e. set score to 0 to everybody.&lt;br /&gt;
&lt;br /&gt;
=== One winner only ===&lt;br /&gt;
If you need to one person to win and everybody else to lose, set the scores so that the winner has the best score, and the other players have the same (lower) score. Then add the following lines to gameinfos.php:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// If in the game, all losers are equal (no score to rank them or explicit in the rules that losers are not ranked between them), set this to true &lt;br /&gt;
// The game end result will display &amp;quot;Winner&amp;quot; for the 1st player and &amp;quot;Loser&amp;quot; for all other players&lt;br /&gt;
&#039;losers_not_ranked&#039; =&amp;gt; true,&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Quantum and Coup are implemented like this, as you can see here:&lt;br /&gt;
* https://boardgamearena.com/#!gamepanel?game=quantum&amp;amp;section=lastresults&lt;br /&gt;
* https://boardgamearena.com/#!gamepanel?game=coupcitystate&amp;amp;section=lastresults&lt;br /&gt;
&lt;br /&gt;
=== Solo ===&lt;br /&gt;
&lt;br /&gt;
If game supports solo variant, a negative score means defeat, a positive score means victory.&lt;br /&gt;
&lt;br /&gt;
=== Player elimination ===&lt;br /&gt;
&lt;br /&gt;
In some games, this is useful to eliminate a player from the game in order he/she can start another game without waiting for the current game end.&lt;br /&gt;
&lt;br /&gt;
This case should be rare. Please don&#039;t use player elimination feature if some player just has to wait the last 10% of the game for game end. This feature should be used only in games where players are eliminated all along the game (typical examples: &amp;quot;Perudo&amp;quot; or &amp;quot;The Werewolves of Miller&#039;s Hollow&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
&lt;br /&gt;
* Player to eliminate should NOT be active anymore (preferably use the feature in a &amp;quot;game&amp;quot; type game state).&lt;br /&gt;
* In your PHP code:&lt;br /&gt;
  self::eliminatePlayer( &amp;lt;player_to_eliminate_id&amp;gt; );&lt;br /&gt;
* the player is informed in a dialog box that he no longer have to played and can start another game if he/she wants too (whith buttons &amp;quot;stay at this table&amp;quot; &amp;quot;quit table and back to main site&amp;quot;). In any case, the player is free to tart&amp;amp;join another table from now.&lt;br /&gt;
* When your game is over, all players who have been eliminated before receive a &amp;quot;notification&amp;quot; (the small &amp;quot;!&amp;quot; icon on the top right of the BGA interface) that indicate them that &amp;quot;the game has ended&amp;quot; and invite them to review the game results.&lt;br /&gt;
&lt;br /&gt;
== Reflexion time ==&lt;br /&gt;
&lt;br /&gt;
; function giveExtraTime( $player_id, $specific_time=null )&lt;br /&gt;
: Give standard extra time to this player.&lt;br /&gt;
: Standard extra time depends on the speed of the game (small with &amp;quot;slow&amp;quot; game option, bigger with other options).&lt;br /&gt;
: You can also specify an exact time to add, in seconds, with the &amp;quot;specified_time&amp;quot; argument (rarely used).&lt;br /&gt;
&lt;br /&gt;
== Managing errors and exceptions ==&lt;br /&gt;
&lt;br /&gt;
Note: when you throw an exception, all database changes and all notifications are cancelled immediately. This way, the game situation that were existing before the request is completely restored.&lt;br /&gt;
&lt;br /&gt;
; throw new BgaUserException ( $error_message)&lt;br /&gt;
: Base class to notify a user error&lt;br /&gt;
: You must throw this exception when a player want to do something that he is not allowed to do.&lt;br /&gt;
: The error message will be shown to the player as a &amp;quot;red message&amp;quot;, so it must be translated.&lt;br /&gt;
: Throwing such an exception is NOT considered as a bug, so it is not traced in BGA error logs.&lt;br /&gt;
&lt;br /&gt;
Example from Gomoku:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     throw new BgaUserException( self::_(&amp;quot;There is already a stone on this intersection, you can&#039;t play there&amp;quot;) );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; throw new BgaVisibleSystemException ( $error_message)&lt;br /&gt;
: You must throw this exception when you detect something that is not supposed to happened into your code.&lt;br /&gt;
: The error message is shown to the user as an &amp;quot;Unexpected error&amp;quot;, in order he can report it in the forum.&lt;br /&gt;
: The error message is logged in BGA error logs. If it happens regularly, we will report it to you.&lt;br /&gt;
&lt;br /&gt;
; throw new BgaSystemException ( $error_message)&lt;br /&gt;
: Base class to notify a system exception. The message will be hidden from the user, but show in the logs. Use this if the message contains technical information.&lt;br /&gt;
: You shouldn&#039;t use this type of exception except if you think the information shown could be critical. Indeed: a generic error message will be shown to the user, so it&#039;s going to be difficult for you to see what happened.&lt;br /&gt;
&lt;br /&gt;
== Zombie mode ==&lt;br /&gt;
&lt;br /&gt;
When a player leaves a game for any reason (expelled, quit), he becomes a &amp;quot;zombie player&amp;quot;. In this case, the results of the game won&#039;t count for statistics, but this is cool if the other players can finish the game anyway. That&#039;s why zombie mode exists: allow the other player to finish the game, even if the situation is not ideal.&lt;br /&gt;
&lt;br /&gt;
While developing your zombie mode, keep in mind that:&lt;br /&gt;
* Do not refer to the rules, because this situation is not planned by the rules.&lt;br /&gt;
* Try to figure that you are playing with your friends and one of them has to leave: how can we finish the game without killing the spirit of the game?&lt;br /&gt;
* The idea is NOT to develop an artificial intelligence for the game.&lt;br /&gt;
&lt;br /&gt;
Most of the time, the best thing to do when it is zombie player turn is to jump immediately to a state where he is not active anymore. For example, if he is in a game state where he has a choice between playing A and playing B, the best thing to do is NOT to choose A or B, but to pass. So, even if there&#039;s no &amp;quot;pass&amp;quot; action in the rules, add a &amp;quot;zombiepass&amp;quot; transitition in your game state and use it.&lt;br /&gt;
&lt;br /&gt;
Each time a zombie player must play, your &amp;quot;zombieTurn&amp;quot; method is called.&lt;br /&gt;
&lt;br /&gt;
Parameters:&lt;br /&gt;
* $state: the name of the current game state.&lt;br /&gt;
* $active_player: the id of the active player.&lt;br /&gt;
&lt;br /&gt;
Most of the time, your zombieTurn method looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    function zombieTurn( $state, $active_player )&lt;br /&gt;
    {&lt;br /&gt;
    	$statename = $state[&#039;name&#039;];&lt;br /&gt;
&lt;br /&gt;
        if( $statename == &#039;myFirstGameState&#039;&lt;br /&gt;
             ||  $statename == &#039;my2ndGameState&#039;&lt;br /&gt;
             ||  $statename == &#039;my3rdGameState&#039;&lt;br /&gt;
               ....&lt;br /&gt;
           )&lt;br /&gt;
        {&lt;br /&gt;
            $this-&amp;gt;gamestate-&amp;gt;nextState( &amp;quot;zombiePass&amp;quot; );&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
            throw new BgaVisibleSystemException( &amp;quot;Zombie mode not supported at this game state: &amp;quot;.$statename );&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that in the example above, all corresponding game state should implement &amp;quot;zombiePass&amp;quot; as a transition.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Player color preferences ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
BGA players (Club members) may now choose their preferred color for playing. For example, if they are used to play green for every board game, they can select &amp;quot;green&amp;quot; in their BGA preferences page.&lt;br /&gt;
&lt;br /&gt;
Making your game compatible with colors preferences is very easy and requires only 1 line of PHP and 1 configuration change :&lt;br /&gt;
&lt;br /&gt;
On your gameinfos.inc.php file, add the following lines :&lt;br /&gt;
&lt;br /&gt;
  // Favorite colors support : if set to &amp;quot;true&amp;quot;, support attribution of favorite colors based on player&#039;s preferences (see reattributeColorsBasedOnPreferences PHP method)&lt;br /&gt;
  &#039;favorite_colors_support&#039; =&amp;gt; true,&lt;br /&gt;
&lt;br /&gt;
Then, on your main &amp;lt;your_game&amp;gt;.game.php file, find the &amp;quot;reloadPlayersBasicInfos&amp;quot; call in your &amp;quot;setupNewGame&amp;quot; method and replace :&lt;br /&gt;
&lt;br /&gt;
        $sql .= implode( $values, &#039;,&#039; );&lt;br /&gt;
        self::DbQuery( $sql );&lt;br /&gt;
        self::reloadPlayersBasicInfos();&lt;br /&gt;
&lt;br /&gt;
By :&lt;br /&gt;
&lt;br /&gt;
        $sql .= implode( $values, &#039;,&#039; );&lt;br /&gt;
        self::DbQuery( $sql );&lt;br /&gt;
        self::reattributeColorsBasedOnPreferences( $players, array(  /* LIST HERE THE AVAILABLE COLORS OF YOUR GAME INSTEAD OF THESE ONES */&amp;quot;ff0000&amp;quot;, &amp;quot;008000&amp;quot;, &amp;quot;0000ff&amp;quot;, &amp;quot;ffa500&amp;quot;, &amp;quot;773300&amp;quot; ) );&lt;br /&gt;
        self::reloadPlayersBasicInfos();&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;reattributeColorsBasedOnPreferences&amp;quot; method reattributes all colors, taking into account players color preferences and available colors.&lt;br /&gt;
&lt;br /&gt;
Note that you must update the colors to indicate the colors available for your game.&lt;br /&gt;
&lt;br /&gt;
2 important remarks :&lt;br /&gt;
* for some games (ex : Chess), the color has an influence on a mechanism of the game, most of the time by giving a special advantage to a player (ex : Starting the game). Color preference mechanism must NOT be used in such a case.&lt;br /&gt;
* your logic should NEVER consider that the first player has the color X, that the second player has the color Y, and so on. If this is the case, your game will NOT be compatible with reattributeColorsBasedOnPreferences as this method attribute colors to players based on their preferences and not based as their order at the table.&lt;br /&gt;
&lt;br /&gt;
Colours currently listed as a choice in preferences:&lt;br /&gt;
&lt;br /&gt;
* #ff0000 Red&lt;br /&gt;
* #008000 Green&lt;br /&gt;
* #0000ff Blue&lt;br /&gt;
* #ffa500 Yellow&lt;br /&gt;
* #000000 Black&lt;br /&gt;
* #ffffff White&lt;br /&gt;
&lt;br /&gt;
== Debugging and Tracing ==&lt;br /&gt;
&lt;br /&gt;
To debug php code you can use some tracing functions available from the parent class such as debug, trace, error, warn, dump.&lt;br /&gt;
  &lt;br /&gt;
  self::debug(&amp;quot;Ahh!&amp;quot;);&lt;br /&gt;
  self::dump(&#039;my_var&#039;,$my_var);&lt;br /&gt;
&lt;br /&gt;
See [[Practical_debugging]] section for complete information about debugging interfaces and where to find logs.&lt;/div&gt;</summary>
		<author><name>Quietmint</name></author>
	</entry>
	<entry>
		<id>https://gl.doc.boardgamearena.com/index.php?title=BGA_Code_Sharing&amp;diff=2764</id>
		<title>BGA Code Sharing</title>
		<link rel="alternate" type="text/html" href="https://gl.doc.boardgamearena.com/index.php?title=BGA_Code_Sharing&amp;diff=2764"/>
		<updated>2017-11-29T02:38:52Z</updated>

		<summary type="html">&lt;p&gt;Quietmint: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is for listing of externally hosted bga projects, tools and resources, as well as internal project&lt;br /&gt;
intended for sharing&lt;br /&gt;
&lt;br /&gt;
== Projects hosted not in studio ==&lt;br /&gt;
&lt;br /&gt;
See the table a link and nickname of the developer on bga (same as used for dev forum), and short description&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important notice about artwork on BGA Open Source projects: original hi-resolution images from publishers must not be published on the repositories. In addition, this is better to specify that the images derivated from publishers artwork are copyrighted and cannot be licensed under a free license like Creative Commons.&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! NAME&lt;br /&gt;
! CODE LINK&lt;br /&gt;
! DEVELOPER&lt;br /&gt;
|-&lt;br /&gt;
| Shared Code (not a game)&lt;br /&gt;
| https://github.com/elaskavaia/bga-sharedcode&lt;br /&gt;
| Victoria_La&lt;br /&gt;
|-&lt;br /&gt;
| Eruption&lt;br /&gt;
| https://github.com/AndyKerrison/bga-eruption&lt;br /&gt;
| Andy_K&lt;br /&gt;
|-&lt;br /&gt;
| Nile&lt;br /&gt;
| https://github.com/AndyKerrison/bga-nile&lt;br /&gt;
| Andy_K&lt;br /&gt;
|-&lt;br /&gt;
| Assyria &lt;br /&gt;
| https://github.com/sebastien-prudhomme/bga-assyria&lt;br /&gt;
| daikinee &lt;br /&gt;
|-&lt;br /&gt;
| Florenza: The Card Game&lt;br /&gt;
| https://github.com/alberto-bottarini/bga-florenza&lt;br /&gt;
| tarini &lt;br /&gt;
|-&lt;br /&gt;
| Incan Gold&lt;br /&gt;
| https://github.com/AntonioSoler/bga-incangold&lt;br /&gt;
| Morgalad &lt;br /&gt;
|-&lt;br /&gt;
| Marco Polo&lt;br /&gt;
| https://github.com/rcitaliano/MarcoPolo&lt;br /&gt;
| rcitaliano&lt;br /&gt;
|-&lt;br /&gt;
| Bonbons&lt;br /&gt;
| https://github.com/AntonioSoler/bga-bonbons&lt;br /&gt;
| Morgalad &lt;br /&gt;
|-&lt;br /&gt;
| Takara Island&lt;br /&gt;
| https://github.com/AntonioSoler/bga-takaraisland&lt;br /&gt;
| Morgalad&lt;br /&gt;
|-&lt;br /&gt;
| Noir: Killer vs Inspector&lt;br /&gt;
| https://bitbucket.org/chhuang76/bga_noirkvi&lt;br /&gt;
| ch huang&lt;br /&gt;
|-&lt;br /&gt;
| Hearts (Tutorial)&lt;br /&gt;
| https://github.com/elaskavaia/bga-heartsla&lt;br /&gt;
| Victoria_La&lt;br /&gt;
|-&lt;br /&gt;
| The Battle for Hill 218&lt;br /&gt;
| https://github.com/danielholmes/battle-for-hill-218&lt;br /&gt;
| Daniel Holmes (dhau)&lt;br /&gt;
|-&lt;br /&gt;
| Coup: City State&lt;br /&gt;
| https://github.com/quietmint/bga-coupcitystate&lt;br /&gt;
| quietmint&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Projects on studio ==&lt;br /&gt;
&lt;br /&gt;
Links to studio project which owner wish share as read only.&lt;br /&gt;
Project owner please add you project here, dev nickname and short description if you would like to share it.&lt;br /&gt;
For the projects below any developer can add themselves to a project as read-only from http://en.studio.boardgamearena.com/#!projects page.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! NAME&lt;br /&gt;
! CODE LINK&lt;br /&gt;
! DEVELOPER&lt;br /&gt;
|-&lt;br /&gt;
| Shared Code&lt;br /&gt;
| http://en.studio.boardgamearena.com/#!studiogame?game=sharedcode&lt;br /&gt;
| Victoria_La&lt;br /&gt;
|-&lt;br /&gt;
| Original BGA template&lt;br /&gt;
| http://en.studio.boardgamearena.com/#!studiogame?game=template&lt;br /&gt;
| Victoria_La&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Other useful resources ==&lt;br /&gt;
&lt;br /&gt;
* Archive of tutorial projects https://www.dropbox.com/s/rsd5r4v49xudpp0/Studio.zip?dl=0&lt;br /&gt;
** Note: Hearts project is corrupted there, use Hearts tutorial project above&lt;br /&gt;
* Website with bunch of textures and sounds http://www.grsites.com/archive/textures/&lt;br /&gt;
* Shrink images without loss of quality https://tinypng.com/ or http://www.iloveimg.com/ (recommended by Gregory Isabelli)&lt;br /&gt;
* CSS shapes https://css-tricks.com/examples/ShapesOfCSS/&lt;br /&gt;
* PDF Scraper - extract images - http://www.extractpdf.com/&lt;/div&gt;</summary>
		<author><name>Quietmint</name></author>
	</entry>
</feed>