From 1b4eccc9bf73974fa81c4c981f88f0cba24dad63 Mon Sep 17 00:00:00 2001 From: Christian Schlittchen Date: Sun, 3 Apr 2005 07:40:19 +0000 Subject: [PATCH] =?UTF-8?q?-=20Saubl=C3=B6der=20Sphinx-Typo=20-=20Neues=20?= =?UTF-8?q?Partei-Attribut=20at=5Fmaxmagicians?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/kernel/eressea.c | 26 ++++++++++++++++++++++++-- src/scripts/sphinx-announce.lua | 2 +- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/src/common/kernel/eressea.c b/src/common/kernel/eressea.c index 0d33c77fc..60de80e2c 100644 --- a/src/common/kernel/eressea.c +++ b/src/common/kernel/eressea.c @@ -486,10 +486,27 @@ allied_skilllimit(const faction * f, skill_t sk) 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 max_skill(faction * f, skill_t sk) { - int m = INT_MAX; + attrib *a; + int m = INT_MAX; if (allied_skilllimit(f, sk)) { if (sk!=SK_ALCHEMY && sk!=SK_MAGIC) return INT_MAX; @@ -504,7 +521,11 @@ max_skill(faction * f, skill_t sk) } switch (sk) { 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; m += fspecial(f, FS_MAGOCRACY) * 2; break; @@ -3106,6 +3127,7 @@ attrib_init(void) at_register(&at_prayer_timeout); at_register(&at_wyrm); at_register(&at_building_generic_type); + at_register(&at_maxmagicians); /* border-typen */ register_bordertype(&bt_noway); diff --git a/src/scripts/sphinx-announce.lua b/src/scripts/sphinx-announce.lua index ac2d9a758..1b644736f 100644 --- a/src/scripts/sphinx-announce.lua +++ b/src/scripts/sphinx-announce.lua @@ -73,7 +73,7 @@ function sphinx_weekly() for faction in factions() do faction:delete_variable("sphinxGotHintsi7z", "true"); - faction:delete_variable("sphinx2GotHintqcph", "true"); + faction:delete_variable("sphinxGotHintqcph", "true"); end end