Fork the Classic season core into src/modern and add the world layout (M1)
- src/modern/game: the season modules as bmh::modern, working on ModernState (a GameState). Data types stay shared with Classic; Modern code calls its season functions qualified (modern::...), so a missing Modern function is a compile error instead of a silent call into Classic. - src/modern/app/modern_session: the session on the Modern core. It still uses the Classic UI projections until the Modern projections exist. - SeasonHooks: the shared match core reaches player statistics and the table prediction of the season core that owns the game (Classic: unchanged). - WorldLayout: team ranges, squad slots and pools of the running world. Shared code and the Modern fork read them; Classic keeps the original numbers. - Transfer list views moved to game/transfer_offer_view.hpp (shared). - tools/modern/check_fork_calls.sh, modern_season_sim and world_layout_tests. Verified: Classic tests and replay regression unchanged; season_sim and modern_season_sim produce identical output with Classic data. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
badd08f05e
commit
f2fcb28f65
81 files changed
+29351
-91
No files matched your search
@@ -0,0 +1,46 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
#pragma once
|
||||
#include "game/poach.hpp"
|
||||
// Poaching ("Abwerben", transfer screen menu 17, H2 p. 70; BMH.exe V2.24 + supported rule profile patch):
|
||||
// the manager picks a player of another club in the league tables and makes him an offer
|
||||
// that is decided at once. Button 4 of the transfer screen Reset:
|
||||
//
|
||||
// - at most five attempts per season: the players tried are kept in manager record
|
||||
// +0x8b6 (5 words, 0xffff free; cleared at the season start, season.cpp) - CareerSession_DispatchPoachUi_TextPointer2
|
||||
// - not with a transfer ban (record +0x220 >> 5 == 1, PushBack, CareerSession_DispatchPoachUi_TextPointer)
|
||||
// - not for a player on loan (BoughtEntry, Poach_StartPoach_TextPointer), not twice for the same player
|
||||
// (Poach_StartPoach_TextPointer2), not for a player on the transfer list (PlayerOnTransferListFirstPoolSlots, Poach_StartPoach_TextPointer3)
|
||||
// - the club must let him go (PoachAttemptsLeft): its squad must be big enough, the position
|
||||
// must not be short (and a club keeps its second goalkeeper); the asking percentage
|
||||
// follows how much the club needs him and how good he is compared with the team
|
||||
// - the offer uses one of the special list rows 40..43 (RowWhose: a row whose
|
||||
// OfferSlots word is free, else "Transfermarkt überlastet"), prepared like a market
|
||||
// row by Range2: asking percentage, demand W(80, 100), market value and salary.
|
||||
//
|
||||
// The offer itself is the ordinary offer editor (desk_actions.hpp, OpenTransferEditor) on that
|
||||
// row with `poach` set; its submit (SubmitTransferBidSourceHumanBuyer) decides at once. finish_poach frees the
|
||||
// row again and counts the attempt, as the original does when the editor returns.
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "game/random.hpp"
|
||||
#include "modern/game/modern_state.hpp"
|
||||
|
||||
namespace bmh::modern {
|
||||
|
||||
|
||||
|
||||
// Attempts left this season (record +0x8b6).
|
||||
int poach_attempts_left(const ModernState& g, int manager);
|
||||
|
||||
// Button 4 after the player was picked (FriendlyMatchScreen returned `squad_slot`): the checks,
|
||||
// PoachAttemptsLeft, RowWhose and Range2. Draws W(12, 20) (asking percentage), W(80,
|
||||
// 100) (demand) and what the market value draws. `market_busy` counts the attempt itself.
|
||||
PoachStart start_poach(ModernState& g, int manager, int squad_slot, WatcomRandom& rand);
|
||||
|
||||
// When the offer editor has returned: the pool slot of the row is emptied, its OfferSlots
|
||||
// word freed and the attempt recorded in +0x8b6.
|
||||
void finish_poach(ModernState& g, const PoachStart& poach);
|
||||
|
||||
} // namespace bmh::modern
|
||||
Reference in new issue
Block a user