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

+3 -2
View File
@@ -403,9 +403,10 @@ impl Map {
self.portals.iter().position(|&(px, py)| x >= px && x < px + 3 && y >= py && y < py + 3)
}
pub fn portal_owned(&self, k: usize) -> bool {
// whose portal k is (any master can claim one)
pub fn portal_owner(&self, k: usize) -> Owner {
let (px, py) = self.portals[k];
self.t[idx(px, py)].owner == Owner::Player
self.t[idx(px, py)].owner
}
pub fn generate(seed: u32, w: usize, h: usize) -> Map {