Real AI masters: rivals, AI seats and the co-op partner play by the player's rules (imps dig, mine and claim, rooms, towers, tunnels and the attack flag); other masters are saved; portals belong to whoever claims them

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Richard ZinkandClaude Opus 5.5 committed 2026-11-06 08:18:09 +01:00
1 parent b940a959f1
commit a00ae6a06b
11 files changed
+456 -223

No files matched your search

+1 -1
View File
@@ -44,7 +44,7 @@ impl Game {
}
self.trading.t = TRADER_GAP + self.rng.f() * 180.0;
// he comes through an own portal
let portals: Vec<(i32, i32)> = (0..self.map.portals.len()).filter(|&k| self.map.portal_owned(k)).map(|k| self.map.portals[k]).collect();
let portals: Vec<(i32, i32)> = (0..self.map.portals.len()).filter(|&k| self.map.portal_owner(k) == self.me).map(|k| self.map.portals[k]).collect();
let Some(&(px, py)) = portals.get((self.rng.next() as usize) % portals.len().max(1)) else { return };
let spot = DIR8.iter().map(|&(dx, dy)| (px + 1 + dx * 2, py + 1 + dy * 2)).find(|&(x, y)| self.map.walk(x, y));
let Some((x, y)) = spot else { return };