Compare commits

...

2 Commits

Author SHA1 Message Date
4e3fd55b54 🐐 2026-03-18 17:50:05 +01:00
da8f41cd8c 🐐 2026-03-18 17:43:29 +01:00
3 changed files with 7 additions and 9 deletions

View File

@@ -171,11 +171,13 @@ WIKIDATA_INSTANCE_TYPE_MAP = {
"Q1361229": CardType.event, # conquest
"Q2223653": CardType.event, # terrorist attack
"Q2672648": CardType.event, # social conflict
"Q2627975": CardType.event, # ceremony
"Q16510064": CardType.event, # sporting event
"Q10688145": CardType.event, # season
"Q13418847": CardType.event, # historical event
"Q13406554": CardType.event, # sports competition
"Q15275719": CardType.event, # recurring event
"Q27968055": CardType.event, # recurring event edition
"Q114609228": CardType.event, # recurring sporting event
"Q7278": CardType.group, # political party
@@ -549,9 +551,9 @@ def compute_deck_type(cards: list) -> str | None:
if all(c.cost > 6 for c in cards):
return "Unplayable"
if sum(1 for c in cards if c.cost >= 10) == 1:
if sum(1 for c in cards if c.cost >= 7) == 1:
return "God Card"
if sum(1 for c in cards if c.cost >= 10) > 1:
if sum(1 for c in cards if c.cost >= 7) > 1:
return "Pantheon"
if avg_cost >= 3.2:
return "Control"

View File

@@ -59,10 +59,12 @@ def record_game_result(state: GameState, db: Session):
if AI_USER_ID not in [winner_id_str, loser_id_str]:
deck = db.query(DeckModel).filter(DeckModel.id == uuid.UUID(winner_deck_id)).first()
if deck:
deck.times_played += 1
deck.wins += 1
deck = db.query(DeckModel).filter(DeckModel.id == uuid.UUID(loser_deck_id)).first()
if deck:
deck.times_played += 1
deck.losses += 1
db.commit()
@@ -188,12 +190,6 @@ async def try_match(db: Session):
active_deck_ids[p1_entry.user_id] = p1_entry.deck_id
active_deck_ids[p2_entry.user_id] = p2_entry.deck_id
for entry, _ in [(p1_entry, p1_cards), (p2_entry, p2_cards)]:
deck = db.query(DeckModel).filter(DeckModel.id == uuid.UUID(entry.deck_id)).first()
if deck:
deck.times_played += 1
db.commit()
if not p1_cards or not p2_cards or not p1_user or not p2_user:
await send_error(p1_entry.websocket, "Failed to load deck")
await send_error(p2_entry.websocket, "Failed to load deck")

View File

@@ -47,7 +47,7 @@
<div class="card-image-wrap">
{#if card.image_link}
<img src={card.image_link} alt={card.name} class="card-image" />
<img src={card.image_link} alt={card.name} class="card-image" draggable="false"/>
{:else}
<div class="card-image-placeholder">
<span>{card.name[0]}</span>