Phase 18: data expansion and market pricing fix
CI / Build, lint & test (push) Failing after 1m15s

Four new card files (Serie A, Ligue 1, Primeira Liga, Eredivisie) add 45
cards across Italian, French, Portuguese, and Dutch football, bringing the
total card pool from 115 to 160. Each file uses fictional club/player
names and null image_path, keeping the project free of copyrighted assets.

Ten new SBC challenges (league_sbcs.json) targeting specific leagues and
nations increase the total from 7 to 17 challenges. Includes league purity
SBCs (Premier League, Bundesliga, Serie A, Ligue 1, Eredivisie), nation
combo SBCs (Iberian Derby, South American Fire), and utility SBCs (elite
strikers mini-submission, bronze-to-silver recycler, world tour).

NPC market refresh now shuffles the card pool before picking 24 listings
(was: take first 20 unshuffled), and price variance tightened from ±100%
to ±25% of the OVR-tier base price for more realistic NPC competition.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
funman300
2026-06-25 17:49:38 -07:00
parent d97695d414
commit 9e481ec072
7 changed files with 268 additions and 7 deletions
+12 -6
View File
@@ -8,7 +8,7 @@ use crate::{
},
services::{card_db::CardDb, club, event as event_svc},
};
use rand::Rng;
use rand::{seq::SliceRandom, Rng};
use uuid::Uuid;
pub async fn get_active_listings(
@@ -61,7 +61,7 @@ pub async fn refresh_npc_listings(
if all_cards.is_empty() {
return Ok(0);
}
let count = 20usize.min(all_cards.len());
let count = 24usize.min(all_cards.len());
let npc_names = [
"FC Rovers NPC",
"Market Bot",
@@ -72,12 +72,18 @@ pub async fn refresh_npc_listings(
];
let mut rng = rand::thread_rng();
let mut listings: Vec<MarketListing> = all_cards
.iter()
let mut indices: Vec<usize> = (0..all_cards.len()).collect();
indices.shuffle(&mut rng);
let mut listings: Vec<MarketListing> = indices
.into_iter()
.take(count)
.map(|card| {
.map(|i| {
let card = all_cards[i];
let base = price_for_card(card.overall);
let price = rng.gen_range((base / 2)..=(base * 2)).max(100);
// ±25% variance for realistic NPC pricing
let pct = rng.gen_range(75i64..=125i64);
let price = (base * pct / 100).max(100);
let seller = npc_names[rng.gen_range(0..npc_names.len())];
MarketListing::new(&card.id, seller, price)
})