游戏可以运行

This commit is contained in:
2026-05-24 08:39:26 +08:00
parent 035b2f7af9
commit ef564338a6
6 changed files with 522 additions and 143 deletions

View File

@@ -125,6 +125,12 @@ class Game:
self.ui.deck_builder_faction = self.player_faction
self.state = "deck_build"
return
if "random" in self.ui.menu_buttons and self.ui.menu_buttons["random"].collidepoint(pos):
from card_game.config import FACTIONS
others = [f for f in FACTIONS.keys() if f != self.player_faction]
self.ai_faction = random.choice(others)
self._start_game()
return
fid = self.ui.get_faction_at(pos)
if fid and fid != self.player_faction:
self.ai_faction = fid