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:
1 parent
b940a959f1
commit
a00ae6a06b
11 files changed
+456
-223
No files matched your search
+3
-2
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user