Skip to content

Opponent

namespace Griff.Modules.Strategy;
public sealed class Opponent : Component

Lets the computer play a Faction: it keeps its workers gathering, trains more, puts up the buildings in Builds, trains an army, and sends it to attack once it’s big enough, a bigger one each time.

This is a component: its saved properties are on its component page.

public string? Army { get; set; }

Units it trains for its army, taking turns, e.g. “Soldier, Archer”.

public int AttackWith { get; set; }

How big its army has to be before it attacks.

public string? Builds { get; set; }

Buildings it puts up, in order, e.g. “Farm, Barracks”. It adds farms as it runs short of supply.

public float FirstAttack { get; set; }

Seconds before its first attack, however big its army.

public float TrainEvery { get; set; }

Seconds between the soldiers it starts training: higher is an easier game. 0 trains as fast as it can pay.

public int WaveGrowth { get; set; }

How many more it waits for each time after that.

public int Waves { get; }

How many attacks it has sent.

public int Workers { get; set; }

How many workers it keeps.