# MRisk Game Rules MRisk is a risk inspired game made only on HTML and JS. It runs in your web browser and does not need to install anything. A game of Risk involves territories captured by players, investing into the territories and capturing enemy territories. Each player has Capital Territories, which when captured by another player, automatically eliminates the player whose capital is captured. ## Starting the Game The game starts with only two Players: Red, and Green. There is a map serving as a board on which these two players will play the game. On the Map there are several territories, some in dark grey and some in light grey. Each territory has a name, and houses three types of armies, Infantry, Cavalry and Artillery indicated by numbers on the tile of the territory (x-y-z means there are x Infantry units, y Cavalry units and z Artilley units in this territory). ### Choosing Capital Territories The first step for each player is to select two Capital Territories each. This happens alternatively, starting with Red. Out of all the territories, the game randomly selects 10 territories, highlights them in light grey color. Red can choose any one of these light grey territories to be their Capital. A Capital Territory is denoted by a bright boundary around the territory with their color. ![Capital](assets/capital.png =180x120) ### Initial Territorial Assignment After the Red and Green players have each chosen two Capital territories each, the game will automatically calculate the remaining unassigned (grey) territories, shuffle them in a random order and assign half of them to Green and the other half to Red. This means out of the 40 total territories, 4 being chosen as Capitals, the remaining 36 get divided evenly between Red and Green, both of them getting 18 territories each always. ### State of the game at the beginning After the Capital Territories are selected, each player starts with 24 units of gold. The HUD on the right completes itself: 1. Color reflects the current player, Red or Green 2. Gold Pile Number reflects the current gold pile, which can be used to add armies to a player's territories 3. Capital Territories' names of the current player 4. Total Number of zones owned by the player currently 5. Reminder of the cost of armies when adding armies to a player's territories ![Capital](assets/game-start.png =600x300) ## Playing the Game After the Capital cities are selected, the player gets 3 actions, the main gameplay loop. At the start of a player's turn, one half of the number of territories owned by that player is rouneded up and added to the player's gold pile. Each turn a player can choose exactly one type of action (Add or Attack), but as many times as they want. Once the player is done making as many Add actions, or Attack actions, they can click the "Pass" button to pass the turn to the 2nd player. Here is a short description of the Actions: ### Action 1: Add Armies Players can choose to add armies to their territories by pressing the "Add" button at the bottom of the HUD. Armies are of three kinds: Infantry, Cavalry and Artillery. Players can choose any amount of armies to add into any owned territories. To add armies, press the yellow "Add" button on the bottom of the HUD, then select which kind of army you wish you add, then select which territory you want to add the armies to. The territory you select has to be owned by you, meaning, Red can only add armies to Red territories and vice versa. ![Capital](assets/adding-armies.png =650x100) When you add armies, the corresponding price is calculated and deducted from your gold pile. A player can choose to add as many armies as many times as they can afford every turn. ### Action 2: Attack Territories Players can choose to attack any enemy territory initiating an attack from one of the neighbour territories that they own. There are 3 conditions for a valid attack: 1. The initiating territory must be owned by the current player 2. The attack target territory must be owned by the enemy 3. The initiating territory and target territory must be neighbours on the map. Each territory has at most 8 neighbours when surrounded on all sides. The winner of an attack is calculated as per an algorithm, which has following principles: 1. 1 Infantry can kill 0.5 Cavalry and 1 Cavalry can kill 2 Infantry 2. 1 Cavalry can kill 0.5 Artillery and 1 Artillery can kill 2 Cavalry 3. 1 Artillery can kill 3 Infantry and 1 Infantry can kill 0.33 Artillery 4. Artillery attacks first, followed by Cavalry followed by Infantry. 5. Artillery defends first, followed by Cavalry followed by Infantry. 6. If the attack is success, the attacking player is awarded Maximum of (1, Half of Defending Army Gold Cost). 7. Since each territory requires at least 1 army unit to be occupied, if the attacker wins, 1 weakest army unit is left behind and the rest of thier army is transferred to the territory conquered. ## Ending the Game Once a player has conquered both the Capital Territories of another player, the game ends. The player who conquers all Capital Territories of a player are lost, they lose the game. The winning player conquers both the Capital Territories of the all other players.