diff --git a/src/common/gamecode/study.c b/src/common/gamecode/study.c index 1827a55aa..ec9b5f0a3 100644 --- a/src/common/gamecode/study.c +++ b/src/common/gamecode/study.c @@ -151,6 +151,14 @@ const attrib_type at_learning = { ATF_UNIQUE }; +static int +study_days(unit * student, skill_t sk) +{ + int speed = 30 + student->race->study_speed_base; + if (student->race->study_speed) speed += student->race->study_speed[sk]; + return student->number * speed; +} + static int teach_unit(unit * teacher, unit * student, int nteaching, skill_t sk, boolean report, int * academy) @@ -171,7 +179,7 @@ teach_unit(unit * teacher, unit * student, int nteaching, skill_t sk, return 0; } - n = student->number * 30; + n = study_days(student, sk); a = a_find(student->attribs, &at_learning); if (a!=NULL) { teach = (teaching_info*)a->data.v; diff --git a/src/common/kernel/eressea.c b/src/common/kernel/eressea.c index 8a611b186..77aa35b6c 100644 --- a/src/common/kernel/eressea.c +++ b/src/common/kernel/eressea.c @@ -207,21 +207,6 @@ HelpMask(void) return value; } -/** specifies modes that are restricted to members of the same alliance. - * if this returns a non-zero value, then you cannot give those modes to a - * faction unless they are in the same alliance. - */ -int -HelpMask(void) -{ - static int help_mask = 0; - - if (help_mask==0) { - help_mask = get_param_int(global.parameters, "rules.help.mask", HELP_ALL); - } - return help_mask; -} - int AllianceRestricted(void) { diff --git a/src/common/kernel/race.c b/src/common/kernel/race.c index 80411b928..e62791d5f 100644 --- a/src/common/kernel/race.c +++ b/src/common/kernel/race.c @@ -125,6 +125,8 @@ rc_new(const char * zName) rc->attack[0].type = AT_COMBATSPELL; rc->attack[1].type = AT_NONE; + rc->speed = 0; + rc->study_speed_base = 0; return rc; } diff --git a/src/common/kernel/race.h b/src/common/kernel/race.h index 9d98c06ec..7cf79f6e5 100644 --- a/src/common/kernel/race.h +++ b/src/common/kernel/race.h @@ -75,6 +75,8 @@ typedef struct race { const spell * precombatspell; struct att attack[10]; char bonus[MAXSKILLS]; + char study_speed_base; + signed char * study_speed; /* study-speed-bonus in points/turn (0=30 Tage) */ boolean __remove_me_nonplayer; int flags; int battle_flags; diff --git a/src/common/kernel/xmlreader.c b/src/common/kernel/xmlreader.c index 4beef377e..1bbda02f5 100644 --- a/src/common/kernel/xmlreader.c +++ b/src/common/kernel/xmlreader.c @@ -1565,6 +1565,7 @@ parse_races(xmlDocPtr doc) rc->speed = (float)xml_fvalue(node, "speed", 1.0F); rc->hitpoints = xml_ivalue(node, "hp", 0); rc->armor = (char)xml_ivalue(node, "ac", 0); + rc->study_speed_base = xml_ivalue(node, "studyspeed", 0); rc->at_default = (char)xml_ivalue(node, "unarmedattack", -2); rc->df_default = (char)xml_ivalue(node, "unarmeddefense", -2); @@ -1626,17 +1627,21 @@ parse_races(xmlDocPtr doc) for (k=0;k!=result->nodesetval->nodeNr;++k) { xmlNodePtr node = result->nodesetval->nodeTab[k]; int mod = xml_ivalue(node, "modifier", 0); + int speed = xml_ivalue(node, "speed", 0); + skill_t sk; propValue = xmlGetProp(node, BAD_CAST "name"); assert(propValue!=NULL); - if (mod!=0) { - skill_t sk = sk_find((const char*)propValue); - if (sk!=NOSKILL) { - rc->bonus[sk] = (char)mod; - } else { - log_error(("unknown skill '%s' in race '%s'\n", - (const char*)propValue, rc->_name[0])); + sk = sk_find((const char*)propValue); + if (sk!=NOSKILL) { + rc->bonus[sk] = (char)mod; + if (speed) { + if (!rc->study_speed) rc->study_speed = calloc(1, MAXSKILLS); + rc->study_speed[sk] = speed; } + } else { + log_error(("unknown skill '%s' in race '%s'\n", + (const char*)propValue, rc->_name[0])); } xmlFree(propValue); } diff --git a/src/res/e2k9/races.xml b/src/res/e2k9/races.xml index bdceba083..1e24b51ac 100644 --- a/src/res/e2k9/races.xml +++ b/src/res/e2k9/races.xml @@ -27,8 +27,8 @@ - - + +