Skip to content

Small CC update (and github check if it works) #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion src/ai/aichargingcheetah.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -814,12 +814,34 @@ void AIChargingCheetah::process()
}



// This tilefloodfill should find all enemy units (in vision?)
UnitFloodfill enemyunits(_bible, _board);
enemyunits.exclude({_settlertype});
enemyunits.exclude({_player});
enemyunits.execute();


// move gunner to cities! Capture if on something that's not ours
for (Ground& gunner : _myGunners)
{


// move onto enemy unit if they're close enough.
if (enemyunits.steps(_board.cell(gunner.descriptor.position)) < 3)
{
Cell destination = _board.cell(gunner.descriptor.position);
std::vector<Move> moves;
Move current;
while ((current = enemyunits.step(destination)) != Move::X)
{
moves.emplace_back(current);
destination = destination + current;
}
Order order(Order::Type::MOVE, gunner.descriptor,
Descriptor::cell(destination.pos()), moves);
_options.emplace_back(Option{order, 15 - int(moves.size())});
}

Cell at = _board.cell(gunner.descriptor.position);
if (_bible.tileOwnable(_board.tile(at).type) && !(_board.tile(at).owner == _player) && !(_board.tile(at).type == _soiltype) && !(_board.tile(at).type == _cropstype))
{
Expand Down