- elves regenerate faster in a forest.

This commit is contained in:
Enno Rehling 2009-06-05 21:27:25 +00:00
parent f28b252f6f
commit b0195fa4e6
2 changed files with 12 additions and 4 deletions

View File

@ -3282,14 +3282,21 @@ use_item(unit * u, const item_type * itype, int amount, struct order * ord)
static double
heal_factor(const race *rc)
heal_factor(const unit * u)
{
switch(old_race(rc)) {
static float elf_regen = -1;
switch(old_race(u->race)) {
case RC_TROLL:
case RC_DAEMON:
return 1.5;
case RC_GOBLIN:
return 2.0;
case RC_ELF:
if (elf_regen<0) elf_regen = get_param_flt(u->race->parameters, "regen.forest", 1.0F);
if (elf_regen!=1.0 && r_isforest(u->region)) {
return elf_regen;
}
return 1.0;
}
return 1.0;
}
@ -3340,7 +3347,7 @@ monthly_healing(void)
}
#endif /* KARMA_MODULE */
p *= heal_factor(u->race);
p *= heal_factor(u);
if (u->hp < umhp) {
#ifdef NEW_DAEMONHUNGER_RULE
double maxheal = MAX(u->number, umhp/20.0);

View File

@ -129,6 +129,7 @@
<race name="elf" magres="0.100000" maxaura="1.0" regaura="1.1" recruitcost="130" maintenance="10" weight="1000" capacity="540" speed="1.0" hp="20" damage="1d5" unarmedattack="-2" unarmeddefense="-2" playerrace="yes" walk="yes" giveitem="yes" giveperson="yes" giveunit="yes" getitem="yes" equipment="yes">
<ai splitsize="10000" moverandom="yes" learn="yes"/>
<function name="itemdrop" value="defaultdrops"/>
<param name="regen.forest" value="2.0"/>
<skill name="armorer" modifier="-1"/>
<skill name="bow" modifier="2"/>
<skill name="building" modifier="-1"/>
@ -156,7 +157,7 @@
<skill name="catapult" modifier="2"/>
<skill name="herbalism" modifier="-1"/>
<skill name="melee" modifier="1"/>
<skill name="mining" modifier="2"/>
<skill name="mining" modifier="1"/>
<skill name="quarrying" modifier="2"/>
<skill name="riding" modifier="-2"/>
<skill name="roadwork" modifier="2"/>