Files
Dreierpack-Manager/src/modern/ui/tactic_text.hpp
T
MichaelandClaude Fable 5.2 919342a5ae 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>
2026-11-14 14:49:19 +01:00

34 lines
2.2 KiB
C++

// SPDX-License-Identifier: GPL-3.0-only
#pragma once
#include <array>
#include <string>
namespace bmh::modern_ui {
// A value of the engine's tactics board in words: the attitude (item 0, lowest = most
// defensive), the six play settings (items 1-6) and the commitment (item 7).
inline std::string tactic_value_text(size_t index, int value, int maximum) {
static const std::array<std::array<const char *, 4>, 4> steps{{
{"Sehr defensiv", "Defensiv", "Offensiv", "Sehr offensiv"},
{"Durch die Mitte", "Eher durch die Mitte", "Eher über die Flügel", "Über die Flügel"},
{"Kurzpassspiel", "Selten steil", "Oft steil", "Immer steil"},
{"Kurz herausspielen", "Halblang", "Lang", "Weit nach vorn"}}};
if (index < 4 && maximum == 3 && value >= 0 && value <= 3) return steps[index][size_t(value)];
if (index == 4 && maximum == 1) return value ? "Hoch" : "Flach";
if ((index == 5 || index == 6) && maximum == 1) return value ? "An" : "Aus";
return std::to_string(value) + " von " + std::to_string(maximum);
}
// What a setting does in a match, in one sentence (the rule: play_shift in the match engine).
inline std::string tactic_effect_text(size_t index) {
static const std::array<const char *, 8> text{
"Offensiver heißt mehr eigene Chancen und mehr Chancen für den Gegner.",
"Flügelspiel lohnt sich als stärkere Mannschaft. Gegen stärkere Gegner geht der Ball außen verloren.",
"Steilpässe wirken gegen offensive Gegner. Gegen tief stehende verpuffen sie.",
"Lange Abschläge passen zu defensiver Ausrichtung, kurzes Herausspielen zu offensiver.",
"Hoch bei nassem Platz und für konditionsstarke Mannschaften, flach für technisch starke auf trockenem Platz.",
"Die Abseitsfalle hilft, wenn die Mannschaft offensiv steht. Bei defensiver Ausrichtung und gegen klar stärkere Gegner schadet sie.",
"Pressing bringt eine Stunde lang mehr eigene Chancen und mehr Fouls. Danach ist die Mannschaft müde und der Gegner kommt häufiger durch.",
"Mehr Einsatz bringt Druck nach vorn, aber auch mehr Karten und Verletzungen."};
return index < text.size() ? text[index] : std::string();
}
} // namespace bmh::modern_ui