Modern: national teams play with squads of their nationality (M9)
A Modern layout gives every national team after no_team 24 squad slots. On each national team day, after the German nomination, the strongest fit players of each nationality (quotas 3/5/7/5, the German strength measure) fill its squad and get a computer line-up; a nation without a goalkeeper or with fewer than 14 nominees keeps its drawn rating. The shared match core asks fields_players() instead of 'league club or no_team', which is the same set in Classic. National squads get no cards or injuries, their players develop after the match like Germany's, and the almanac records their line-ups. Diamond data 1.5: 24 of 61 nations play with players. Classic regression (game 1 and two-player) unchanged, Classic-data season identical, save round trip identical, ctest passes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
96e88c9579
commit
0f36b507d4
17 files changed
+154
-22
No files matched your search
+10
-1
@@ -157,11 +157,20 @@ SquadRange squad_range(int team) {
|
||||
const WorldLayout& w = world_layout();
|
||||
if (team == w.no_team()) return {w.pool_end, w.no_team_slots};
|
||||
if (team >= 0 && team < w.league_teams) return {w.squad_start[size_t(team)], w.squad_size[size_t(team)]};
|
||||
if (w.national_squad(team)) return {w.national_start + uint32_t(team - w.no_team() - 1) * w.national_slots, w.national_slots};
|
||||
return {0, 0};
|
||||
}
|
||||
|
||||
bool fields_players(const GameState& g, int team) {
|
||||
const WorldLayout& w = world_layout();
|
||||
if ((team >= 0 && team < w.league_teams) || team == w.no_team()) return true;
|
||||
if (!w.national_squad(team)) return false;
|
||||
const SquadRange r = squad_range(team);
|
||||
return r.first < g.squad_slots.size() && (g.squad_slots[r.first] & 0x0FFF) != 0x0FFF;
|
||||
}
|
||||
|
||||
TeamAverage team_average(const GameState& g, int team, uint16_t flags, WatcomRandom* rand) {
|
||||
if (team >= world_layout().first_foreign_cup() && team != no_team()) {
|
||||
if (team >= world_layout().first_foreign_cup() && !fields_players(g, team)) {
|
||||
// TeamRating(team, profile 2 at layout field): a random value around the club's level
|
||||
if (!rand) throw std::invalid_argument("team_average: a team without squad needs the Watcom generator");
|
||||
RatingContext ctx;
|
||||
|
||||
Reference in new issue
Block a user