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
@@ -87,7 +87,7 @@ MinuteReport MatchEngine::minute(int minute, int last_minute, int stoppage) {
|
||||
// Human teams use the places on their tactics board, also for the player's value.
|
||||
int MatchEngine::pick_player(int team, int mode, int exclude, MinuteReport& report, int preset) {
|
||||
mode &= 0x7F; // 0x80 = reuse the squad of the previous call, same team here
|
||||
if (team >= world_layout().league_teams && team != no_team()) return 0xFFF; // clubs without squad: nobody, no draws
|
||||
if (!fields_players(state, team)) return 0xFFF; // teams without players: nobody, no draws
|
||||
SquadRange range = squad_range(team);
|
||||
if (range.count == 0) return 0xFFF;
|
||||
RatingContext ctx{state.chance_rain, state.chance_temperature};
|
||||
@@ -531,6 +531,7 @@ ForcedMatchEvent MatchEngine::event_impl(MatchGroup& g, int m, int s, int minute
|
||||
// Small-squad teams (id >= 90) only half of the time; teams without squads never. The
|
||||
// national team (0x165, squad nominated on the national team days) only while manager
|
||||
// slot 0 holds it (CupDraw_FormatError_RuntimeField2 == 0x165: a Bundestrainer's match).
|
||||
// The squads of the other national teams (Modern) get no cards or injuries either.
|
||||
if (!(team < 90 || rand.range(0, 1) == 0)) return result;
|
||||
if (!(team < world_layout().league_teams || team == no_team())) return result;
|
||||
if (team == no_team() && (state.manager_teams.empty() || state.manager_teams[0] != no_team())) return result;
|
||||
@@ -953,7 +954,7 @@ void MatchEngine::side(MatchGroup& g, int m, int& s, int minute, int& own_att, i
|
||||
}
|
||||
|
||||
// Goalkeeper of the opponent: the player in squad slot 0 if the formation puts it in goal.
|
||||
if (!reality_played && (opp_team < world_layout().first_foreign_cup() || opp_team == no_team())) {
|
||||
if (!reality_played && (opp_team < world_layout().first_foreign_cup() || fields_players(state, opp_team))) {
|
||||
int x = 0, y = 0;
|
||||
state.formation_position(opp_team, 0, x, y);
|
||||
if (x == 0 && y == 4) keeper = state.squad_slots.at(squad_range(opp_team).first) & 0x0FFF;
|
||||
@@ -988,7 +989,7 @@ void MatchEngine::side(MatchGroup& g, int m, int& s, int minute, int& own_att, i
|
||||
deflected = game.range(0, 5) == 0;
|
||||
}
|
||||
if (kind == 0) {
|
||||
if (team >= world_layout().first_foreign_cup() && team != no_team()) {
|
||||
if (team >= world_layout().first_foreign_cup() && !fields_players(state, team)) {
|
||||
// clubs without squad: the attack rating (TeamRating, profile 3), drawn
|
||||
RatingContext drawn;
|
||||
drawn.rand = &rand;
|
||||
@@ -998,7 +999,7 @@ void MatchEngine::side(MatchGroup& g, int m, int& s, int minute, int& own_att, i
|
||||
}
|
||||
}
|
||||
if (keeper == 0xFFF) {
|
||||
if (opp_team >= world_layout().first_foreign_cup() && opp_team != no_team()) {
|
||||
if (opp_team >= world_layout().first_foreign_cup() && !fields_players(state, opp_team)) {
|
||||
// clubs without squad: the goalkeeping rating (profile 0), drawn
|
||||
RatingContext drawn;
|
||||
drawn.rand = &rand;
|
||||
@@ -1205,7 +1206,7 @@ void MatchEngine::penalty_shootout(MatchGroup& g, int m, MinuteReport& report) {
|
||||
const int side = order[k];
|
||||
const int team = pair[side];
|
||||
int player = 0xFFF;
|
||||
if (team < world_layout().league_teams || team == no_team()) {
|
||||
if (fields_players(state, team)) {
|
||||
// a player who has not taken a penalty yet (after 100 tries the list restarts)
|
||||
int tries = 0;
|
||||
bool fresh;
|
||||
|
||||
Reference in new issue
Block a user