Give the six play settings of the tactics board an effect; draw the board in chalk
- Match engine (Modern turn driver only, MatchEngine::tactic_effects): wing play, through balls, goal kicks, flat or high balls, offside trap and pressing of a human side shift how often it and its opponent come to a chance (play_shift, at most two steps of the chance roll). Each setting pays in one situation and costs in another; pressing also raises the foul roll. No random numbers are drawn; computer sides and the Classic core are unchanged. Documented in docs/DIFFERENCES.md. - The tactics read names the settings; desk and live dialog show every value in words with one sentence on its effect. The live dialog offers all eight settings again. - The tactics board is a slate with a wooden frame, drawn in wobbling chalk strokes. - modern_season_sim: SIM_TACTICS keeps a tactic set for measuring; new modern_play_shift_tests pin the direction of every setting. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
1 parent
9708b720b2
commit
919342a5ae
16 files changed
+344
-80
No files matched your search
@@ -713,6 +713,41 @@ ForcedMatchEvent MatchEngine::event_impl(MatchGroup& g, int m, int s, int minute
|
||||
return result;
|
||||
}
|
||||
|
||||
// Dreierpack: what the play settings of the two sides add to the attacking side's chance
|
||||
// roll, in half steps (two half steps = one step of the roll, about a tenth more or fewer
|
||||
// chances). `own`/`other` are the side records of the attacker and the defender, `attack`/
|
||||
// `defend` their boards (manager record +0xd2.., nullptr for a computer side). Nothing is
|
||||
// drawn at random. Every setting is a bet on the situation:
|
||||
// 1 wing play (0-3) pays for the stronger side, costs the weaker one
|
||||
// 2 through balls (0-3) pay against an attacking opponent, fail against a deep one
|
||||
// 3 long goal kicks (0-3) pay with a defensive attitude (counters), cost an attacking one
|
||||
// 4 high balls (0/1) better on a wet pitch and for a side with more condition than
|
||||
// technique; flat play suits technique on a dry pitch
|
||||
// 5 offside trap (0/1) helps a side that stands high, hurts a deep one and against a
|
||||
// clearly stronger attack
|
||||
// 6 pressing (0/1) more chances of one's own for an hour, then the side is tired
|
||||
// and the opponent gets more
|
||||
int play_shift(const uint8_t* own, const uint8_t* other, const uint8_t* attack, const uint8_t* defend, int own_att,
|
||||
int opp_att, int minute, bool wet) {
|
||||
int halves = 0;
|
||||
if (attack) {
|
||||
const int wings = std::min<int>(attack[1], 3), through = std::min<int>(attack[2], 3), kicks = std::min<int>(attack[3], 3);
|
||||
halves += wings * clamp(int(own[2]) - int(other[2]), -6, 6) / 9;
|
||||
static constexpr int kLean[4] = {-2, -1, 1, 2}; // by attitude, 0 = very defensive
|
||||
halves += through * kLean[clamp(opp_att, 0, 3)] / 2;
|
||||
halves -= kicks * kLean[clamp(own_att, 0, 3)] / 2;
|
||||
const bool condition_side = own[6] > 100; // balance: condition above technique
|
||||
if (attack[4]) halves += wet ? 1 : condition_side ? 1 : -1;
|
||||
else halves += wet ? -2 : condition_side ? 0 : 1;
|
||||
if (attack[6] && minute <= 60) halves += 2;
|
||||
}
|
||||
if (defend) {
|
||||
if (defend[5]) halves += (opp_att >= 2 ? -2 : 1) + (int(own[2]) > int(other[2]) + 6 ? 1 : 0);
|
||||
if (defend[6] && minute > 60) halves += 2;
|
||||
}
|
||||
return clamp(halves, -4, 4);
|
||||
}
|
||||
|
||||
void MatchEngine::side(MatchGroup& g, int m, int& s, int minute, int& own_att, int& opp_att, MinuteReport& report) {
|
||||
uint8_t* rec = g.records.data() + m * 18;
|
||||
uint8_t* own = rec + s * 9;
|
||||
@@ -722,8 +757,19 @@ void MatchEngine::side(MatchGroup& g, int m, int& s, int minute, int& own_att, i
|
||||
|
||||
int rhythm = clamp(own[7], 44, 80); // MatchRuntimeField2
|
||||
|
||||
// Dreierpack: the boards of human sides; pressing also means more fouls
|
||||
const auto play_board = [&](int t) -> const uint8_t* {
|
||||
if (!tactic_effects) return nullptr;
|
||||
const int manager = state.manager_of(t);
|
||||
if (manager < 0 || state.manager_records.size() < size_t(manager + 1) * 0xB0C) return nullptr;
|
||||
return state.manager_records.data() + size_t(manager) * 0xB0C + 0xd2;
|
||||
};
|
||||
const uint8_t* own_board = play_board(g.fixtures.at(m * 2 + s));
|
||||
const uint8_t* opp_board = play_board(g.fixtures.at(m * 2 + 1 - s));
|
||||
const int pressing_fouls = own_board && own_board[6] ? 4 : 0;
|
||||
|
||||
// --- event roll (AlternateEventRoll selects an alternative range, separately from indoor) ---
|
||||
bool trigger = alternate_event_roll ? rand.range(0, 10) > 7 : rand.range(0, 220) < rhythm - 30;
|
||||
bool trigger = alternate_event_roll ? rand.range(0, 10) > 7 : rand.range(0, 220) < rhythm - 30 + pressing_fouls;
|
||||
if (trigger) {
|
||||
event(g, m, s, minute, report);
|
||||
if (report.unsupported) return;
|
||||
@@ -737,7 +783,10 @@ void MatchEngine::side(MatchGroup& g, int m, int& s, int minute, int& own_att, i
|
||||
|
||||
// --- chance roll ---------------------------------------------------------------------------
|
||||
int roll = game.range(0, away_penalty * 4 + 44);
|
||||
if (int16_t(opp_att + own_att + 3 + (indoor ? 14 : 0)) < roll) return; // no chance
|
||||
int play = 0; // half steps; the odd half counts in the attack value below
|
||||
if (own_board || opp_board)
|
||||
play = play_shift(own, other, own_board, opp_board, own_att, opp_att, minute, !indoor && g.desc.at(0x50 + m) >= 4);
|
||||
if (int16_t(opp_att + own_att + 3 + (indoor ? 14 : 0) + play / 2) < roll) return; // no chance
|
||||
|
||||
int team = g.fixtures.at(m * 2 + s), opp_team = g.fixtures.at(m * 2 + 1 - s);
|
||||
// A side whose record byte 2 (its attack strength) is 0 gets no chance at all: the
|
||||
@@ -745,6 +794,7 @@ void MatchEngine::side(MatchGroup& g, int m, int& s, int minute, int& own_att, i
|
||||
// block, without the result-screen part after it (WEEK240).
|
||||
if (own[2] == 0) return;
|
||||
int attack = int16_t(own[2] + game.range(0, rhythm) / 10 + own_att * 2 - 9); // uVar5
|
||||
attack = int16_t(attack + play % 2 * 4);
|
||||
if (minute < clamp(own[6], 50, 130)) attack = int16_t(attack + game.range(6, 12));
|
||||
int defence = int16_t(other[2] + (3 - opp_att) * 2); // local_a0
|
||||
if (game.range(0, 100) < other[6]) defence = int16_t(defence + 5);
|
||||
|
||||
Reference in new issue
Block a user