50 QBitArray *handicap =
new QBitArray(
H_LAST);
57 handicap->setBit(
H_FOG);
58 handicap->setBit(
H_MAP);
66 case AI_LEVEL_HANDICAPPED:
106 case AI_LEVEL_EXPERIMENTAL:
111 case AI_LEVEL_CHEATING:
136 case AI_LEVEL_HANDICAPPED:
137 case AI_LEVEL_NOVICE:
141 case AI_LEVEL_NORMAL:
143 case AI_LEVEL_CHEATING:
145 case AI_LEVEL_EXPERIMENTAL:
170 case AI_LEVEL_HANDICAPPED:
171 case AI_LEVEL_NOVICE:
174 case AI_LEVEL_NORMAL:
176 case AI_LEVEL_CHEATING:
178 case AI_LEVEL_EXPERIMENTAL:
201 case AI_LEVEL_HANDICAPPED:
202 case AI_LEVEL_NOVICE:
205 case AI_LEVEL_NORMAL:
207 case AI_LEVEL_CHEATING:
209 case AI_LEVEL_EXPERIMENTAL:
229 QString help, features;
230 QBitArray *handicaps;
235 if (
level == AI_LEVEL_AWAY) {
237 help =
_(
"Toggles 'away' mode for your nation. In away mode, "
238 "the AI will govern your nation but make only minimal "
242 help = QString(
_(
"With no arguments, sets all AI players to skill level "
243 "'%1', and sets the default level for any new AI "
244 "players to '%2'. With an argument, sets the skill "
245 "level for the specified player only."))
250 for (h = 0; h <
H_LAST; h++) {
255 if (desc && handicaps->at(h) != inverted) {
256 features += desc +
qendl();
261 features +=
_(
"Has erratic decision-making.") +
qendl();
266 if (science != 100) {
268 QString(
_(
"Research takes %1 as long as usual.")).arg(science);
272 features +=
_(
"Has reduced appetite for expansion.");
276 case AI_LEVEL_HANDICAPPED:
278 help +=
_(
"\nThis skill level has the same features as 'Novice', "
279 "but may suffer additional ruleset-defined penalties.")
282 case AI_LEVEL_CHEATING:
284 help +=
_(
"\nThis skill level has the same features as 'Hard', "
285 "but may enjoy additional ruleset-defined bonuses.")
290 help +=
_(
"\nThis skill level's features include the following. "
291 "(Some rulesets may define extra level-specific "
299 return qstrdup(
const_cast<char *
>(qUtf8Printable(help)));
321 return normal_decision;
324 return normal_decision;
326 return !normal_decision;
static QBitArray * handicap_of_skill_level(enum ai_level level)
Returns handicap bitvector for given AI skill level.
static int fuzzy_of_skill_level(enum ai_level level)
Return the AI fuzziness (0 to 1000) corresponding to a given skill level (1 to 10).
char * ai_level_help(const char *cmdname)
Helper function for skill level command help.
void set_ai_level_directer(struct player *pplayer, enum ai_level level)
Set an AI level and related quantities, with no feedback.
static int expansionism_of_skill_level(enum ai_level level)
Return the AI expansion tendency, a percentage factor to value new cities, compared to defaults.
static int science_cost_of_skill_level(enum ai_level level)
Return the AI's science development cost; a science development cost of 100 means that the AI develop...
bool ai_fuzzy(const struct player *pplayer, bool normal_decision)
Return the value normal_decision (a boolean), except if the AI is fuzzy, then sometimes flip the valu...
void handicaps_set(struct player *pplayer, QBitArray *handicaps)
Set player handicaps.
const char * handicap_desc(enum handicap_type htype, bool *inverted)
Return a short (translated) string describing the handicap, for help.
#define fc_assert(condition)
struct setting_list * level[OLEVELS_NUM]
enum ai_level skill_level
struct player_ai ai_common
int fc_strcasecmp(const char *str0, const char *str1)
Compare strings like strcmp(), but ignoring case.