War

## Introduction

War is the means by which a faction may conquer enemy provinces. Ancar Earth hosts an unique type of war system, tied-in with our own-coded factions plugin.

In short, the ability to wage war is limited by certain conditions (a land-connection with the enemy or sea crossing), the war has to be declared on a specific discord channel following a certain template, the latter will be reviewed by staff and war will be scheduled. The war is fought in-game on a scheduled day in a precise hour. The conflict gets hosted within the contested province, Staff will set three randomly-located "checkpoints". These checkpoints are 16 block diameter areas which may be occupied by stationing players inside for 20 minutes each. When one checkpoint is conquered by a side, it cannot be taken back. During war, all teleport commands are disabled (i.e home, tpa, tpahere, back), and the faction tp is only permitted to recognized Military Bases (which will, for example, be suitable as respawning points). Each side has a certain number of 'life tickets', which are depleted each time a member of the associated side dies. To win the war, a side has to conquer all three checkpoints or fully deplete the life tickets of the enemy side (i.e when they hit 0, the other side wins).

Wars will also have effects on the recognized structures located within the contested province. When the province is conquered, the claims in all recognised structures will pass in ownership to the leader of the conquering faction. Before transferring, old owners will be able to remove all chests and containers but they will not be able to damage structures.

## Mechanics

### When it's possible to start a war

A faction may start a new war only against a bordering province (land-connection). Or alternatively, a war can be started through attacking across the sea, within a max distance of 5 sea tiles.

### How to start a war

In order to start a new war, the leader of a faction (or those authorized to do so) must post a "Declaration of War" on Discord under the channel "#diplomacy". Such war declaration has to follow a specific template:

```
War Declaration
Attacker: <faction name>
Attacker allies: <faction names>
Defender: <faction name>
Defender allies: <faction names>
Province: <faction number>
Casus Belli: <reason of the war>
People authorized to pay: <player names>

```

The template will be reviewed by staff on discord and will get scheduled to a specific day and hour (also posted on discord).

After the war is approved, staff will register it in-game for code purposes.

### How to join an existing war

After a war gets declared and registered both on discord and in-game, factions will be allowed to join the war in-game through **/fa battle join <attacker/defender>**

Note, when the leader or those authorized to run such command decide to join a war, they won't be able to leave it nor change side.

### Checkpoints

The war will be hosted in the contested province, under staff supervision, in the scheduled date.

Staff will set three randomly located checkpoints within the contested province, with each checkpoint being a circle of 16x16 block diameter and each one contributing 1/3 of progress towards conquest. Checkpoints are tied to a bossbar and to a scoreboard. When battle starts, checkpoints location will be broadcasted.

Checkpoints are conquered when one side manages to reach 100% progress through stationing players inside the checkpoint area. The latter is clearly noticeable as the bossbar will appear only if the player is within the area. Progression advances every few seconds (it takes 20 minutes to conquer a checkpoint).

When the number of attackers is greater than defenders inside a checkpoint, attackers will increase their progression and lower that of their enemies'. Vice versa, when the defenders are greater than attackers within the checkpoint, defenders will increase their progression and lower that of their enemies'. When no-one is inside the checkpoint area, or the number of defenders equals the number of attackers, progression will diminish for both sides.

Once one side reaches 100% progress, progression will not diminish even if everyone leaves the area. From that moment, the checkpoint is conquered by the side with 100% checkpoint progress and cannot be retaken. (Note, if a side conquers all three checkpoints, they win the war; more on this below).

### Life tickets

The life tickets are the number of times players of X side can die during wartime, at each death the ticket number gets depleted by one. When life tickets of X side reach 0, the enemy side wins the war. The number of life tickets is equal for both sides, is displayed on scoreboard, and is calculated using this formula: "(Number of attackers + Number of defenders) \* 2".

### Winning a War

Wars can be won in different ways, and when a winning case triggers, the war ends automatically.

#### Total victory (Attacker side)

* Attackers conquered all three checkpoints while life tickets haven't been depleted yet.
* No-one took checkpoints, but the Defender life tickets hit 0.

In this case, attackers conquer the province and gain ownership of all recognized structures and claims within it.

#### Partial victory (Attacker side)

* 1 or 2 checkpoints get conquered by defenders, 1 or 2 checkpoints get conquered by attackers, but defender life tickets hit 0.

In this case, attackers partially conquer the province and gain ownership of all recognized structures within the part of the province subjected to their control. In case only one checkpoint got taken, attackers will get 1/3 of the province. In case 2 out of 3 checkpoints have been taken, attackers get 2/3 of the province. This will also impact the number of possible military bases in the province (by rule, max 3 per province), if attackers own 1/3 of the province, they get ownership of one military base (if present), vice versa if they own 2/3 of the province, they get 2 out of 3 military bases (if present).

#### Total victory (Defender side)

* Defenders conquer all three checkpoints while life tickets didn't get depleted yet.
* No-one took checkpoints, Attackers life ticket's hit 0.
* 1 or 2 checkpoints got conquered and attackers life tickets hit 0

In this case, defenders maintain full control of the province and all recognized-structures within it.