The Middle East camps share their grades but differ in price; a stay
can now bring an exclusive sponsor: 15 / 30 / 45 % per stay (Doha /
Abu Dhabi / Dubai), a shirt (about every third offer) or four boards at
twice the club's best regular offer for 12 months. Accepted on a free
place it starts at once, otherwise it is queued and starts at a month
change once the place is free. The offer goes through the regular
advertising acceptance.
Camp fields sponsor_chance / sponsor_bonus / sponsor_months (data
format F4, editable; built-in values for the Middle East camps), state
saved in state/modern.json, read query {kind: "sponsor"}, session action
dispatch_exclusive_sponsor, tests in modern_camp_tests, SIM_SPONSOR=1.
Sponsor artwork does not exist yet (asset: null, documented).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
124 lines
7.5 KiB
C++
124 lines
7.5 KiB
C++
// SPDX-License-Identifier: GPL-3.0-only
|
|
#pragma once
|
|
#include "game/weekly.hpp"
|
|
// OpenBMH deviates from the original: uses the supported weekly processing and transfer rule profile.
|
|
// The weekly processing (DayStepRest3, BMH.exe V2.24 + supported rule profile patch).
|
|
//
|
|
// DayStepRest runs it on the day after a training day when that day has weekday code 3
|
|
// (in games with the full economy, CompetitionSelection bit 0). In order:
|
|
// 1. per human manager: offers and incidents (Bool), the ageing of the club's
|
|
// facilities (FacilityDamage) and random damage to them (SeasonTicketCompensation), each followed
|
|
// by the season ticket compensation (Void3); every third week new advertising
|
|
// offers (TransferListCountdown2)
|
|
// 2. the transfer list (TransferListCountdown(0)): the days left of every listed player count
|
|
// down; at 0 the highest-rated eligible bid wins unless a human-seller selector is set
|
|
// 3. new bids for listed players (TransferBid)
|
|
// 4. every player in a squad: injuries in training, players out (w35c bits 27-31) come
|
|
// back or retire
|
|
// 5. per human manager: debts, the training camp bill, player bonuses, the weekly
|
|
// statistics (FacilityRating)
|
|
// Messages to the managers (PostMessage / SystemIdentity) are not produced; dialogs that
|
|
// wait for a decision of the player are reported as unsupported.
|
|
|
|
#include "game/match_engine.hpp"
|
|
#include "game/random.hpp"
|
|
#include "modern/game/modern_state.hpp"
|
|
#include "game/transfer_allocator.hpp"
|
|
#include "game/human_buyer_sale.hpp"
|
|
#include "game/pending_offer.hpp"
|
|
#include "game/transfer_bid.hpp"
|
|
#include "game/transfer_offer_view.hpp"
|
|
|
|
#include <array>
|
|
#include <cstdint>
|
|
#include <functional>
|
|
|
|
namespace bmh::modern {
|
|
|
|
// Projects the current live rows without mutation or RNG. The selector caller
|
|
// performs the Source-ranked selection and ProjectTransferOfferList post-selection check.
|
|
TransferOfferListView project_transfer_offer_list(const ModernState& g, int list_entry);
|
|
|
|
void weekly_processing(ModernState& g, GameRandom& game, WatcomRandom& rand, MinuteReport& report,
|
|
TransferAllocatorContext allocator = TransferAllocatorContext::unsupported);
|
|
|
|
// The single steps, public for tests.
|
|
void manager_offers(ModernState& g, int manager, WatcomRandom& rand, MinuteReport& report); // Bool
|
|
void facility_ageing(ModernState& g, int manager, GameRandom& game, WatcomRandom& rand, MinuteReport& report); // FacilityDamage
|
|
void facility_damage(ModernState& g, int manager, GameRandom& game, WatcomRandom& rand); // SeasonTicketCompensation
|
|
void season_ticket_compensation(ModernState& g, int manager); // Void3
|
|
// Source-visible compensation path: the notice receives the state after the
|
|
// usable-capacity calculation, but before the forced/statistical money booking.
|
|
void season_ticket_compensation_source(ModernState& g, int manager,
|
|
const SeasonTicketCompensationNoticeHook& notice = {});
|
|
void advertising_offers(ModernState& g, int manager, WatcomRandom& rand, MinuteReport& report); // TransferListCountdown2
|
|
// The club's advertising score and the base of its offers (TransferListCountdown2, no draws): a
|
|
// board offer is about base / 16 per board and month, a shirt offer base / 4 (offer k: 70 + 6k
|
|
// resp. 80 + 4k percent of that, then +-25 %).
|
|
struct AdvertisingBase { int score = 0, base = 0; };
|
|
AdvertisingBase advertising_base(ModernState& g, int manager);
|
|
// TransferListCountdown(all): the days left of every listed player count down; at 0 the best bid wins
|
|
// (with `all`, at the season end, every list is settled at once)
|
|
void transfer_list_countdown(ModernState& g, GameRandom& game, WatcomRandom& rand, MinuteReport& report, bool all = false,
|
|
TransferAllocatorContext allocator = TransferAllocatorContext::unsupported);
|
|
// TransferBid(slot, list entry, 0, -1): a new bid of some club for the player in the
|
|
// absolute squad slot (a listed player), or with list_entry 0 a move of the player to a
|
|
// club that wants him.
|
|
void transfer_bid(ModernState& g, int slot, uint32_t list_entry, bool high, int months, GameRandom& game,
|
|
WatcomRandom& rand, MinuteReport& report);
|
|
void weekly_statistics(ModernState& g, int manager); // FacilityRating
|
|
|
|
// FacilityRating2(manager, with_rand, &second): rating of a human club's stadium facilities
|
|
// (about 24-100). *second receives the covered share of the stands in percent. With `rand`
|
|
// (the attendance calculation) every stand under construction costs 10-12 % of the
|
|
// facility sum, drawn per stand.
|
|
int facility_rating(ModernState& g, int manager, int* second, WatcomRandom* rand = nullptr);
|
|
|
|
// Squad helpers shared with the month change (month.cpp):
|
|
// Nationality: nationality of a player (w368 bits 27-31, +32 with the flag in *PlayerBonuses).
|
|
int nationality(const ModernState& g, int player);
|
|
// SquadCount(team, flags): players of a club (bit 1: the injured too; bit 0: plus the
|
|
// players bought for later, table Career_RemoveJoinLoans_RuntimeField).
|
|
int squad_count(const ModernState& g, int team, int flags);
|
|
// SlotTeam: club of an absolute squad slot, -1 for the transfer pool.
|
|
int slot_team(int slot);
|
|
// Int2(team, 100) after a transfer (only clubs with a squad).
|
|
void lineup_after_transfer(ModernState& g, int team);
|
|
// ReleasePlayer(seller, player): the player leaves the club (0xFFF: the pool).
|
|
bool remove_from_seller(ModernState& g, int seller, int player, MinuteReport& report);
|
|
// Finalize a high-confidence manager offer immediately after the seller/player accepts it.
|
|
bool accept_transfer_bid_immediately(ModernState& g, int list_entry, int bid, WatcomRandom& rand,
|
|
MinuteReport& report,
|
|
TransferAllocatorContext allocator = TransferAllocatorContext::unsupported);
|
|
|
|
} // namespace bmh::modern
|
|
|
|
namespace bmh::modern {
|
|
|
|
// PreMatchOffer, before a human manager's matchday: now and then a club makes an offer for
|
|
// one of his players (1 in 71 - manager rating / 50).
|
|
// Returns whether an offer was shown (its message box waits for a click before the desk).
|
|
bool pre_match_offer(ModernState& g, int manager, GameRandom& game, WatcomRandom& rand, MinuteReport& report);
|
|
|
|
// ClubAttraction(team, 0): how attractive a club is for advertisers (0-100): its European
|
|
// campaign, its league and table position (weekly.cpp).
|
|
int club_attraction(const ModernState& g, int team);
|
|
|
|
// Modern versions of functions that transfer_bid.hpp, human_buyer_sale.hpp and
|
|
// pending_offer.hpp declare for Classic; all are implemented in weekly.cpp.
|
|
TransferBidRating rate_transfer_bid_source(ModernState&, const TransferBidRatingRequest&,
|
|
WatcomRandom&, MinuteReport&);
|
|
HumanBuyerSaleResult settle_human_buyer_sale(ModernState&, const HumanBuyerSaleRequest&,
|
|
const HumanBuyerSaleHooks&, WatcomRandom&, MinuteReport&);
|
|
PendingOfferResult process_player_card_pending_offers(ModernState& g,
|
|
const ClubPlayerDetailSelection& selection, GameRandom& game, WatcomRandom& rand,
|
|
const PendingOfferHooks& hooks, MinuteReport& report);
|
|
PendingOfferResult process_natural_pending_offers_after_desk(ModernState& g,
|
|
const PendingOfferDeskRequest& request, GameRandom& game, WatcomRandom& rand,
|
|
const PendingOfferHooks& hooks, MinuteReport& report);
|
|
PendingOfferResult process_national_nomination_pending_after_desk(ModernState& g,
|
|
const PendingOfferDeskRequest& request, GameRandom& game, WatcomRandom& rand,
|
|
const PendingOfferHooks& hooks, MinuteReport& report);
|
|
|
|
} // namespace bmh::modern
|