Player12
An open source football management simulator
Loading...
Searching...
No Matches
Stories Namespace Reference

Functions

std::optional< std::uint32_t > appearanceMilestone (std::uint32_t before, std::uint32_t after)
 
std::optional< std::uint32_t > goalMilestone (std::uint32_t before, std::uint32_t after)
 
bool isPoorRun (std::string_view recent_form)
 
const char * kindKey (StoryKind kind)
 
bool isDilemma (StoryKind kind)
 
const char * dilemmaTitleKey (StoryKind kind)
 
const char * dilemmaBodyKey (StoryKind kind)
 
const char * dilemmaOptionKey (StoryKind kind, int option)
 
const char * dilemmaDoneKey (StoryKind kind, int option)
 
std::optional< StoryKind > dilemmaForTitle (std::string_view title_key)
 
DilemmaEffects dilemmaEffects (StoryKind kind, int option, const ClubProfile &profile)
 

Variables

constexpr int WEEKLY_CAP = 2
 
constexpr std::int32_t LONG_INJURY_DAYS = 60
 
constexpr float BREAKOUT_RATING = 7.3f
 
constexpr int BREAKOUT_MAX_AGE = 21
 
constexpr int DEBUT_MAX_AGE = 19
 
constexpr int POOR_RUN_MATCHES = 5
 
constexpr std::int32_t SAGA_WINDOW_DAYS = 30
 
constexpr std::int32_t CHOICE_DAYS = 21
 
constexpr std::int32_t DILEMMA_GAP_DAYS = 14
 
constexpr std::int32_t DILEMMA_KIND_COOLDOWN_DAYS = 180
 
constexpr std::int32_t DILEMMA_ANSWER_DAYS = 7
 
constexpr double DILEMMA_DAILY_CHANCE = 0.06
 
constexpr float DILEMMA_MAX_MORALE = 6.0f
 
constexpr float DILEMMA_MAX_TRUST = 6.0f
 
constexpr float DILEMMA_MAX_SQUAD_MORALE = 2.0f
 
constexpr float DILEMMA_MAX_SHARPNESS = 10.0f
 
constexpr std::int64_t DILEMMA_MAX_MONEY = 250'000
 
constexpr StoryKind FIRST_DILEMMA = StoryKind::CompassionateLeave
 
constexpr StoryKind LAST_DILEMMA = StoryKind::TicketProtest
 
constexpr std::size_t MAX_FOLLOWS = 25
 
constexpr float BIG_MATCH_RATING = 8.5f
 
constexpr int BIG_MATCH_GOALS = 2
 
constexpr std::int32_t BIG_MATCH_GAP_DAYS = 7
 

Function Documentation

◆ appearanceMilestone()

std::optional< std::uint32_t > Stories::appearanceMilestone ( std::uint32_t  before,
std::uint32_t  after 
)

Appearance milestones crossed from before to after (e.g. 100).

◆ dilemmaBodyKey()

const char * Stories::dilemmaBodyKey ( StoryKind  kind)

◆ dilemmaDoneKey()

const char * Stories::dilemmaDoneKey ( StoryKind  kind,
int  option 
)

Body of the note filed once answer option is taken.

◆ dilemmaEffects()

DilemmaEffects Stories::dilemmaEffects ( StoryKind  kind,
int  option,
const ClubProfile &  profile 
)

Effects of answer option (0 or 1) for a club of profile.

◆ dilemmaForTitle()

std::optional< StoryKind > Stories::dilemmaForTitle ( std::string_view  title_key)

The moment a title key belongs to, if any.

◆ dilemmaOptionKey()

const char * Stories::dilemmaOptionKey ( StoryKind  kind,
int  option 
)

Label of answer option (0 or 1).

◆ dilemmaTitleKey()

const char * Stories::dilemmaTitleKey ( StoryKind  kind)

Language keys of a moment's message (title and body take the player, the second player or rival club, and the money at stake).

◆ goalMilestone()

std::optional< std::uint32_t > Stories::goalMilestone ( std::uint32_t  before,
std::uint32_t  after 
)

Goal milestones crossed from before to after (e.g. 50).

◆ isDilemma()

bool Stories::isDilemma ( StoryKind  kind)

True for the two-option decision moments.

◆ isPoorRun()

bool Stories::isPoorRun ( std::string_view  recent_form)

True when the latest results (newest first, 'W'/'D'/'L') hold a poor run: POOR_RUN_MATCHES or more without a win.

◆ kindKey()

const char * Stories::kindKey ( StoryKind  kind)

Language key of a story kind.

Variable Documentation

◆ BIG_MATCH_GAP_DAYS

constexpr std::int32_t Stories::BIG_MATCH_GAP_DAYS = 7
constexpr

At most one big-match note per player in this many days.

◆ BIG_MATCH_GOALS

constexpr int Stories::BIG_MATCH_GOALS = 2
constexpr

...or this many goals.

◆ BIG_MATCH_RATING

constexpr float Stories::BIG_MATCH_RATING = 8.5f
constexpr

A followed player's match makes news from this rating...

◆ BREAKOUT_MAX_AGE

constexpr int Stories::BREAKOUT_MAX_AGE = 21
constexpr

◆ BREAKOUT_RATING

constexpr float Stories::BREAKOUT_RATING = 7.3f
constexpr

Mean recent rating of a young player that makes a breakout.

◆ CHOICE_DAYS

constexpr std::int32_t Stories::CHOICE_DAYS = 21
constexpr

◆ DEBUT_MAX_AGE

constexpr int Stories::DEBUT_MAX_AGE = 19
constexpr

Senior debuts are told for players up to this age.

◆ DILEMMA_ANSWER_DAYS

constexpr std::int32_t Stories::DILEMMA_ANSWER_DAYS = 7
constexpr

Days to answer before the moment lapses (without effects).

◆ DILEMMA_DAILY_CHANCE

constexpr double Stories::DILEMMA_DAILY_CHANCE = 0.06
constexpr

Chance per eligible day once the gap has passed.

◆ DILEMMA_GAP_DAYS

constexpr std::int32_t Stories::DILEMMA_GAP_DAYS = 14
constexpr

At most one decision moment in this many days.

◆ DILEMMA_KIND_COOLDOWN_DAYS

constexpr std::int32_t Stories::DILEMMA_KIND_COOLDOWN_DAYS = 180
constexpr

The same kind of moment does not come back for this many days.

◆ DILEMMA_MAX_MONEY

constexpr std::int64_t Stories::DILEMMA_MAX_MONEY = 250'000
constexpr

◆ DILEMMA_MAX_MORALE

constexpr float Stories::DILEMMA_MAX_MORALE = 6.0f
constexpr

Effect bounds (absolute values).

◆ DILEMMA_MAX_SHARPNESS

constexpr float Stories::DILEMMA_MAX_SHARPNESS = 10.0f
constexpr

◆ DILEMMA_MAX_SQUAD_MORALE

constexpr float Stories::DILEMMA_MAX_SQUAD_MORALE = 2.0f
constexpr

◆ DILEMMA_MAX_TRUST

constexpr float Stories::DILEMMA_MAX_TRUST = 6.0f
constexpr

◆ FIRST_DILEMMA

constexpr StoryKind Stories::FIRST_DILEMMA = StoryKind::CompassionateLeave
constexpr

◆ LAST_DILEMMA

constexpr StoryKind Stories::LAST_DILEMMA = StoryKind::TicketProtest
constexpr

◆ LONG_INJURY_DAYS

constexpr std::int32_t Stories::LONG_INJURY_DAYS = 60
constexpr

Injuries at least this long make a comeback story.

◆ MAX_FOLLOWS

constexpr std::size_t Stories::MAX_FOLLOWS = 25
constexpr

Players the manager can follow at once.

◆ POOR_RUN_MATCHES

constexpr int Stories::POOR_RUN_MATCHES = 5
constexpr

Competitive matches without a win that make a poor run.

◆ SAGA_WINDOW_DAYS

constexpr std::int32_t Stories::SAGA_WINDOW_DAYS = 30
constexpr

Bids within this many days that make a transfer saga.

◆ WEEKLY_CAP

constexpr int Stories::WEEKLY_CAP = 2
constexpr

Stories posted per rolling week at most.