From 67a1e187239158680910a35e60e462e0963b3070 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 14 Jun 2009 22:06:35 +0000 Subject: [PATCH] ring-of-power bonus for elves in a forest --- src/common/kernel/battle.c | 1 + src/common/kernel/magic.c | 8 ++++++++ src/res/e2k9.xml | 1 + 3 files changed, 10 insertions(+) diff --git a/src/common/kernel/battle.c b/src/common/kernel/battle.c index 7270185f2..a0da092ca 100644 --- a/src/common/kernel/battle.c +++ b/src/common/kernel/battle.c @@ -722,6 +722,7 @@ static int CavalryBonus(const unit * u, troop enemy) { static int mode = -1; + if (mode<0) { mode = get_param_int(global.parameters, "rules.cavalry.mode", 1); } diff --git a/src/common/kernel/magic.c b/src/common/kernel/magic.c index b56504569..9bcc1f99e 100644 --- a/src/common/kernel/magic.c +++ b/src/common/kernel/magic.c @@ -1081,6 +1081,8 @@ spellpower(region * r, unit * u, const spell * sp, int cast_level, struct order { curse * c; double force = cast_level; + int elf_power = -1; + if (sp==NULL) { return 0; } else { @@ -1091,6 +1093,12 @@ spellpower(region * r, unit * u, const spell * sp, int cast_level, struct order } if (get_item(u, I_RING_OF_POWER) > 0) ++force; + if (elf_power<0) { + elf_power = get_param_int(global.parameters, "rules.magic.elfpower", 0); + } + if (elf_power && u->race==new_race[RC_ELF] && r_isforest(r)) { + ++force; + } /* Antimagie in der Zielregion */ c = get_curse(r->attribs, ct_find("antimagiczone")); diff --git a/src/res/e2k9.xml b/src/res/e2k9.xml index 9aabedf20..5195995cc 100644 --- a/src/res/e2k9.xml +++ b/src/res/e2k9.xml @@ -138,6 +138,7 @@ +