- Saublöder Sphinx-Typo

- Neues Partei-Attribut at_maxmagicians
This commit is contained in:
Christian Schlittchen 2005-04-03 07:40:19 +00:00
parent 7de8d2777d
commit 1b4eccc9bf
2 changed files with 25 additions and 3 deletions

View File

@ -486,10 +486,27 @@ allied_skilllimit(const faction * f, skill_t sk)
return value; return value;
} }
static void
init_maxmagicians(struct attrib *a)
{
a->data.i = MAXMAGICIANS;
}
static attrib_type at_maxmagicians = {
"maxmagicians",
init_maxmagicians,
NULL,
NULL,
a_writedefault,
a_readdefault,
ATF_UNIQUE
};
int int
max_skill(faction * f, skill_t sk) max_skill(faction * f, skill_t sk)
{ {
int m = INT_MAX; attrib *a;
int m = INT_MAX;
if (allied_skilllimit(f, sk)) { if (allied_skilllimit(f, sk)) {
if (sk!=SK_ALCHEMY && sk!=SK_MAGIC) return INT_MAX; if (sk!=SK_ALCHEMY && sk!=SK_MAGIC) return INT_MAX;
@ -504,7 +521,11 @@ max_skill(faction * f, skill_t sk)
} }
switch (sk) { switch (sk) {
case SK_MAGIC: case SK_MAGIC:
m = MAXMAGICIANS; if((a = a_find(f->attribs, &at_maxmagicians)) != NULL) {
m = a->data.i;
} else {
m = MAXMAGICIANS;
}
if (old_race(f->race) == RC_ELF) m += 1; if (old_race(f->race) == RC_ELF) m += 1;
m += fspecial(f, FS_MAGOCRACY) * 2; m += fspecial(f, FS_MAGOCRACY) * 2;
break; break;
@ -3106,6 +3127,7 @@ attrib_init(void)
at_register(&at_prayer_timeout); at_register(&at_prayer_timeout);
at_register(&at_wyrm); at_register(&at_wyrm);
at_register(&at_building_generic_type); at_register(&at_building_generic_type);
at_register(&at_maxmagicians);
/* border-typen */ /* border-typen */
register_bordertype(&bt_noway); register_bordertype(&bt_noway);

View File

@ -73,7 +73,7 @@ function sphinx_weekly()
for faction in factions() do for faction in factions() do
faction:delete_variable("sphinxGotHintsi7z", "true"); faction:delete_variable("sphinxGotHintsi7z", "true");
faction:delete_variable("sphinx2GotHintqcph", "true"); faction:delete_variable("sphinxGotHintqcph", "true");
end end
end end