Project

General

Profile

Bug #1000 ยป 0055-Update-maybe_become_veteran_real-function-header.patch

Marko Lindqvist, 10/21/2024 04:06 PM

View differences:

server/unittools.c
After a battle and after diplomatic aggression this routine is called
to decide whether or not the unit should become more experienced.
There is a specified chance for it to happen. The base chances are
specified in the units.ruleset file. Before the chance is passed to
this function, it might get modified by the factor related to how
challenging the battle was. This function applies modifiers
from effects.
If 'settler' is TRUE the veteran level is increased due to work done by
the unit.
There is a specified chance for it to happen. Before the chance
is passed to this function, it might get modified by the factor
related to how challenging the battle was. This function applies
modifiers from effects, and veterancy system.
@param punit Unit that might gain veterancy
@param base_chance Base percentage chance of gaining veterancy
@param worker Veterancy gained because of work, not combat
@return Whether unit should become veteran
**************************************************************************/
static bool maybe_become_veteran_real(struct unit *punit, int base_chance,
bool worker)
    (1-1/1)