MIT License
One thousand years after the Proxima Centauri colonalization, the human race felt into a dark age. Chronicles of Proxima is set five thousands years after the beginning of the dark age, humans completally forgot the knowledge of the past, but they still have access to Gems, fragments of an ancient technology that they use to enhance their weapons and armor. They also reacts to some materials in magical ways allowing them to cast spells.
Chronicles of Proxima was initially thought as a board game, this implementation has some differences from the orgiginal idea. Still, the gameplay is very similar. Right now the project is a work in progress, I just finished working on the basic dynamics of the gameplay. And I'm starting to work on the backend to allow multiplayer games. Then I'll work on the frontend.
npm install
or
yarn
then to run test program
node src/test.js
Every character or mob has the following attributes:
Modifiers are composed by:
Modifiers can be permanent or temporary, so it should be considered in the calculation. In the following example you can see how I will write modifiers in this document.
E.g. Rheon has the following modifiers:
A character doesn't have fixed attributes, attributes are calculated each time, applying:
that are active in the turn.
Here is how to calculate Rheon's parry at turn 0 (from previous example)
0 - 1d3 = 0 - 2 = -2
The maps in this implementation are created using the open source map editor Tiled.
The map is a grid of X * Y cells.
There are currently two kinds of blocks: normal and walls. The player cannot move through walls.
The player can move in every directions without cutting the edges of the walls and respecting her maxium speed.
The turn has the following phases:
The available actions are:
If the attack is melee, the attacker and the defender must be in the same cell.
If the attack is range or spell, the attacker and the defender must be in line of sight (see next section for more info) and the distance must be less then the maximum range distance.
A player hits the target if her hit roll is higher then the parry or the dodge of the target.
If the defender is hit, then the damage is calculated and inserted as an hp modifier [ x -> ] (where x is the turn), to the defender modifiers.
A player always attack with all the equipped weapons. For example if Rheon range attack Agaroth, the damage is calculated summing all the rangeDamage modifiers (from his modifiers and the modifiers from his gear).
A player that cast a spell to attack has to select which spell to cast. Each spell has a specific damage modifier. The total damage is the sum of the spell damage modier and all the spellPower modifiers (from his modifiers and the modifiers from his gear).
One of the main differences between the board game and this implementation is the calculation of the line of sight. In the board game version the players use a ruler to check if there are any obstancles between the two entities. In this implementation I use a custom algorithm to check it, follow this link to discover more.
Game starts
Active player is Theon
Theon cast Fire Armor on Theon using 5 mana.
+5 on parry for 1 turn
Calculation for Theon's hp
Base stats: 10 () => 10
Total: 10
Theon now has 10 mana left.
Theon cannot hit Rheon throught walls.
Active player is Rheon
Rheon cannot hit Theon throught walls.
Rheon moves -1, 0
Rheon is now in 3, 8
Rheon moves 0, -1
Rheon is now in 3, 7
Rheon tries to hit Theon.
Calculation for Rheon's hit
Base stats: 3 () => roll([...dices(1, 6)])
Total: 3
Calculation for Theon's dodge
Total: 0
Calculation for Theon's parry
+5 on parry for 1 turn: 5 () => 5
Total: 5
Rheon melee misses Theon rolling hit 3 against parry 5
Theon recovered 5 mana.
Rheon recovered 0 mana.
Next turn
Active player is Rheon
Rheon tries to hit Theon.
Calculation for Rheon's hit
Base stats: 5 () => roll([...dices(1, 6)])
Total: 5
Calculation for Theon's dodge
Total: 0
Calculation for Theon's parry
Total: 0
Rheon melee hit Theon rolling hit 5 against parry 0
Calculation for Rheon's meleeDamage
Sword strike: 10 () => roll([...dices(3, 6)])
Total: 10
Rheon does 10 melee damage to Theon.
Theon is dead.
Rheon cannot target Theon because Theon is dead
Rheon cannot target Theon because Theon is dead
Rheon recovered 0 mana.
Next turn