Load Modern worlds and add Modern training camps (M3, M4)
M3 - Modern world loader: - modern/content/world: typed view of the world tables (leagues, clubs, players, nations, league dates, training camp catalogue). - modern/content/world_package: opens a Modern world (runtime:modern-v1, or editor:world-v1 until data revision 1.4), reads only the engine entries and decodes the Classic payload (import: load_classic_payload). - modern/content/world_expand: turns the Classic start into the world: club ids in the order of the world's leagues, per-club tables remapped (added clubs copy an original club of their league), added players from their attributes, 24 squad slots per league club, pools kept, layout, league sizes and league dates installed; UTF-8 names and OBW ids in ModernState. - Fixes found by playing the Modern data set: referee pool exhausted on days with German and larger international leagues (Modern deviation), card table per league club grown, slot-to-team lookup via WorldLayout, form history stride from the layout, remaining slot literals. - Classic UI projections used by the session read the layout instead of executable constants (Classic values unchanged). - modern_season_sim opens .obw worlds; MODERN_DEBUG / MODERN_WATCH tracing. M4 - training camps: - Catalogue in ModernState (built-in 18 fictional camps on three maps, or the world's extended catalogue); price, booking and effect use it. - Six-star grades: step index capped, limit +1 from pitch 5 and +1 with pitch and fitness 6, catering 6 one more point of condition, lodging 6 one week less injury. Classic data behaves as before. modern_camp_tests. Verified: 190 tests pass; Classic replay regression identical to the M0 baseline; season_sim and modern_season_sim identical with Classic data; the Modern data set plays full seasons (leagues 34/38/34 rounds). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
13bdc56f04
commit
6f55622307
53 files changed
+1392
-87
No files matched your search
@@ -1,5 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
#include "formats/executable_layout.hpp"
|
||||
#include "game/world_layout.hpp"
|
||||
#include "ui/pending_offer.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
@@ -20,7 +21,7 @@ int pending_offer_owner_team(const GameState& game, int manager) {
|
||||
// AdvanceTurn restores NextDeskManager[0] after the temporary one-manager national
|
||||
// desk. Records1..3 still exist even though they have no runtime desk.
|
||||
const bool retained = manager > 0 && manager < 4 &&
|
||||
game.manager_teams.size() == 1 && game.manager_teams[0] == kNoTeam &&
|
||||
game.manager_teams.size() == 1 && game.manager_teams[0] == no_team() &&
|
||||
game.memory.has(::bmh::layout::CoachActive) && game.memory.u8(::bmh::layout::CoachActive) != 0 &&
|
||||
game.memory.has(::bmh::layout::ManagerCount) && game.memory.u8(::bmh::layout::ManagerCount) == 1 &&
|
||||
game.memory.has(::bmh::layout::OriginalManagerCount) && game.memory.u8(::bmh::layout::OriginalManagerCount) <= 4 &&
|
||||
@@ -40,7 +41,7 @@ int pending_offer_owner_team(const GameState& game, int manager) {
|
||||
|
||||
bool pending_offer_spare_buyer(const GameState& game, int raw_offer_slot, int expected_team) {
|
||||
if (raw_offer_slot < 0 || raw_offer_slot >= 4 ||
|
||||
game.manager_teams.size() != 1 || game.manager_teams[0] != kNoTeam ||
|
||||
game.manager_teams.size() != 1 || game.manager_teams[0] != no_team() ||
|
||||
!game.memory.has(::bmh::layout::CoachActive) || game.memory.u8(::bmh::layout::CoachActive) == 0 ||
|
||||
!game.memory.has(::bmh::layout::ManagerCount) || game.memory.u8(::bmh::layout::ManagerCount) != 1 ||
|
||||
!game.memory.has(::bmh::layout::OriginalManagerCount) || game.memory.u8(::bmh::layout::OriginalManagerCount) < 1 || game.memory.u8(::bmh::layout::OriginalManagerCount) > 4 ||
|
||||
@@ -59,7 +60,7 @@ bool pending_offer_spare_buyer(const GameState& game, int raw_offer_slot, int ex
|
||||
const uint32_t offer = ::bmh::layout::OfferSlots + uint32_t(raw_offer_slot) * 4;
|
||||
const uint32_t list = ::bmh::layout::EditorList + uint32_t(raw_offer_slot + 40) * 0x58;
|
||||
const size_t pool = 0xb70 + size_t(raw_offer_slot + 40);
|
||||
if (team_at(0) != kNoTeam || buyer >= 138 || buyer != expected_team || !game.memory.has(offer + 3) ||
|
||||
if (team_at(0) != no_team() || buyer >= 138 || buyer != expected_team || !game.memory.has(offer + 3) ||
|
||||
!game.memory.has(list + 0x57) || pool >= game.squad_slots.size())
|
||||
return false;
|
||||
const uint32_t word = game.memory.u32(offer);
|
||||
|
||||
Reference in new issue
Block a user