diff --git a/src/design/algorithms.md b/src/design/algorithms.md index f96256a..cd1a7c1 100644 --- a/src/design/algorithms.md +++ b/src/design/algorithms.md @@ -1,11 +1,38 @@ # Algorithms -## Calculating action cards on the game +## Calculating action cards’ effects on the game ```rust +//After the ‘debate’ phase, when all card challenges and supports have been resolved… +supporting_influence match beneficiary{/* Checks player position against card position */} + influence => player.influence += card.effect.effect_number; + /*there are many other effects, not all of which I am listing.*/ + } +} ``` -## Calculating influence after turns +## Calculating player position effects on the game +Depending on the position, the effects will be resolved in much the same way. + +Each position has an effect which might be resolved at different times. For example, the minister of propaganda gains influence based on his public opinion. His effect would be resolved much like this: ```rust +//resolved before influence is collected +if PropagandaChief.exists() { + PropagandaChief.influence += (PropagandaChief.public_view / 2); +} ``` +Or the economic minister, who gets influence gain for every 7 cards successfully played. +```rust +//resolved after the debate phase +if EconomyChief.exists() { + if EconomyChief.played_card() && EconomyChief.played_cards%7 == 0{ + EconomyChief.influence_gain++; + } +} +``` +The other positions do not yet have specific effects, but they will be done in a similar way. \ No newline at end of file