Algorithms

Calculating action cards’ effects on the game

#![allow(unused)]
fn main() {
//After the ‘debate’ phase, when all card challenges and supports have been resolved…
supporting_influence<opposing_influence {
	do_not_resolve_effects();
else {
	match card.effect {
		progress => 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 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:

#![allow(unused)]
fn main() {
//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.

#![allow(unused)]
fn main() {
//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.