forked from github/server
remove old_race call form heal_factor
This commit is contained in:
parent
a3ad9a0222
commit
ff83d5108a
8 changed files with 44 additions and 19 deletions
|
@ -1,5 +1,10 @@
|
||||||
<?xml version="1.0" ?>
|
<?xml version="1.0" ?>
|
||||||
<race name="demon" magres="0.150000" maxaura="1.000000" regaura="1.250000" recruitcost="150" maintenance="10" weight="1000" capacity="540" speed="1.000000" hp="50" ac="2" damage="1d5" unarmedattack="-2" unarmeddefense="-2" playerrace="yes" walk="yes" shapeshift="yes" giveperson="yes" giveunit="yes" getitem="yes" recruitethereal="yes" equipment="yes">
|
<race name="demon" magres="0.150000" maxaura="1.000000"
|
||||||
|
regaura="1.250000" recruitcost="150" maintenance="10" weight="1000"
|
||||||
|
capacity="540" speed="1.000000" hp="50" ac="2" damage="1d5"
|
||||||
|
unarmedattack="-2" unarmeddefense="-2" playerrace="yes" walk="yes"
|
||||||
|
shapeshift="yes" giveperson="yes" giveunit="yes" getitem="yes"
|
||||||
|
recruitethereal="yes" equipment="yes" healing="1.5">
|
||||||
<ai splitsize="10000" moverandom="yes" learn="yes"/>
|
<ai splitsize="10000" moverandom="yes" learn="yes"/>
|
||||||
<function name="itemdrop" value="defaultdrops"/>
|
<function name="itemdrop" value="defaultdrops"/>
|
||||||
<skill name="alchemy" modifier="2"/>
|
<skill name="alchemy" modifier="2"/>
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
<?xml version="1.0" ?>
|
<?xml version="1.0" ?>
|
||||||
<race name="goblin" magres="-0.05" maxaura="1.0" regaura="1.0" recruitcost="60" maintenance="6" weight="600" capacity="440" speed="1.0" hp="16" damage="1d5" unarmedattack="-2" unarmeddefense="0" playerrace="yes" walk="yes" giveperson="yes" giveunit="yes" getitem="yes" equipment="yes">
|
<race name="goblin" magres="-0.05" maxaura="1.0" regaura="1.0"
|
||||||
|
recruitcost="60" maintenance="6" weight="600" capacity="440"
|
||||||
|
speed="1.0" hp="16" damage="1d5" unarmedattack="-2" unarmeddefense="0"
|
||||||
|
playerrace="yes" walk="yes" giveperson="yes" giveunit="yes"
|
||||||
|
getitem="yes" equipment="yes" healing="2.0">
|
||||||
<ai splitsize="10000" moverandom="yes" learn="yes"/>
|
<ai splitsize="10000" moverandom="yes" learn="yes"/>
|
||||||
<function name="itemdrop" value="defaultdrops"/>
|
<function name="itemdrop" value="defaultdrops"/>
|
||||||
<param name="hunger.damage" value="1d8+7"/>
|
<param name="hunger.damage" value="1d8+7"/>
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
<?xml version="1.0" ?>
|
<?xml version="1.0" ?>
|
||||||
<race name="goblin" magres="-0.05" maxaura="1.0" regaura="1.0" recruitcost="60" maintenance="6" weight="600" capacity="440" speed="1.0" hp="16" damage="1d5" unarmedattack="-2" unarmeddefense="0" playerrace="yes" walk="yes" giveperson="yes" giveunit="yes" getitem="yes" equipment="yes">
|
<race name="goblin" magres="-0.05" maxaura="1.0" regaura="1.0"
|
||||||
|
recruitcost="60" maintenance="6" weight="600" capacity="440"
|
||||||
|
speed="1.0" hp="16" damage="1d5" unarmedattack="-2" unarmeddefense="0"
|
||||||
|
playerrace="yes" walk="yes" giveperson="yes" giveunit="yes"
|
||||||
|
getitem="yes" equipment="yes" healing="2.0">
|
||||||
<ai splitsize="10000" moverandom="yes" learn="yes"/>
|
<ai splitsize="10000" moverandom="yes" learn="yes"/>
|
||||||
<function name="itemdrop" value="defaultdrops"/>
|
<function name="itemdrop" value="defaultdrops"/>
|
||||||
<param name="hunger.damage" value="1d8+7"/>
|
<param name="hunger.damage" value="1d8+7"/>
|
||||||
|
|
|
@ -1,5 +1,10 @@
|
||||||
<?xml version="1.0" ?>
|
<?xml version="1.0" ?>
|
||||||
<race name="goblin" magres="-0.050000" maxaura="1.000000" regaura="1.000000" recruitcost="40" maintenance="10" weight="600" capacity="440" speed="1.000000" hp="16" damage="1d5" unarmedattack="-2" unarmeddefense="0" playerrace="yes" walk="yes" giveperson="yes" giveunit="yes" getitem="yes" equipment="yes">
|
<race name="goblin" magres="-0.050000" maxaura="1.000000"
|
||||||
|
regaura="1.000000" recruitcost="40" maintenance="10" weight="600"
|
||||||
|
capacity="440" speed="1.000000" hp="16" damage="1d5"
|
||||||
|
unarmedattack="-2" unarmeddefense="0" playerrace="yes" walk="yes"
|
||||||
|
giveperson="yes" giveunit="yes" getitem="yes" equipment="yes"
|
||||||
|
healing="2.0">
|
||||||
<ai splitsize="10000" moverandom="yes" learn="yes"/>
|
<ai splitsize="10000" moverandom="yes" learn="yes"/>
|
||||||
<function name="itemdrop" value="defaultdrops"/>
|
<function name="itemdrop" value="defaultdrops"/>
|
||||||
<skill name="alchemy" modifier="1"/>
|
<skill name="alchemy" modifier="1"/>
|
||||||
|
|
|
@ -1,5 +1,10 @@
|
||||||
<?xml version="1.0" ?>
|
<?xml version="1.0" ?>
|
||||||
<race name="troll" magres="0.100000" maxaura="1.000000" regaura="1.000000" recruitcost="90" maintenance="10" weight="2000" capacity="1080" speed="1.000000" hp="30" ac="1" damage="1d5+3" unarmedattack="-2" unarmeddefense="-2" playerrace="yes" walk="yes" giveperson="yes" giveunit="yes" getitem="yes" equipment="yes">
|
<race name="troll" magres="0.100000" maxaura="1.000000"
|
||||||
|
regaura="1.000000" recruitcost="90" maintenance="10" weight="2000"
|
||||||
|
capacity="1080" speed="1.000000" hp="30" ac="1" damage="1d5+3"
|
||||||
|
unarmedattack="-2" unarmeddefense="-2" playerrace="yes" walk="yes"
|
||||||
|
giveperson="yes" giveunit="yes" getitem="yes" equipment="yes"
|
||||||
|
healing="1.5">
|
||||||
<ai splitsize="10000" moverandom="yes" learn="yes"/>
|
<ai splitsize="10000" moverandom="yes" learn="yes"/>
|
||||||
<function name="itemdrop" value="defaultdrops"/>
|
<function name="itemdrop" value="defaultdrops"/>
|
||||||
<skill name="mining" modifier="2"/>
|
<skill name="mining" modifier="2"/>
|
||||||
|
|
|
@ -125,6 +125,7 @@ extern "C" {
|
||||||
typedef struct race {
|
typedef struct race {
|
||||||
char *_name;
|
char *_name;
|
||||||
float magres;
|
float magres;
|
||||||
|
float healing;
|
||||||
double maxaura; /* Faktor auf Maximale Aura */
|
double maxaura; /* Faktor auf Maximale Aura */
|
||||||
double regaura; /* Faktor auf Regeneration */
|
double regaura; /* Faktor auf Regeneration */
|
||||||
double recruit_multi; /* Faktor für Bauernverbrauch */
|
double recruit_multi; /* Faktor für Bauernverbrauch */
|
||||||
|
|
|
@ -1647,6 +1647,7 @@ static int parse_races(xmlDocPtr doc)
|
||||||
xmlFree(propValue);
|
xmlFree(propValue);
|
||||||
|
|
||||||
rc->magres = (float)xml_fvalue(node, "magres", rc->magres);
|
rc->magres = (float)xml_fvalue(node, "magres", rc->magres);
|
||||||
|
rc->healing = (float)xml_fvalue(node, "healing", rc->healing);
|
||||||
rc->maxaura = (float)xml_fvalue(node, "maxaura", rc->maxaura);
|
rc->maxaura = (float)xml_fvalue(node, "maxaura", rc->maxaura);
|
||||||
rc->regaura = (float)xml_fvalue(node, "regaura", rc->regaura);
|
rc->regaura = (float)xml_fvalue(node, "regaura", rc->regaura);
|
||||||
rc->recruitcost = xml_ivalue(node, "recruitcost", rc->recruitcost);
|
rc->recruitcost = xml_ivalue(node, "recruitcost", rc->recruitcost);
|
||||||
|
|
28
src/laws.c
28
src/laws.c
|
@ -3464,23 +3464,23 @@ static int use_item(unit * u, const item_type * itype, int amount, struct order
|
||||||
|
|
||||||
static double heal_factor(const unit * u)
|
static double heal_factor(const unit * u)
|
||||||
{
|
{
|
||||||
double elf_regen;
|
const race * rc = u_race(u);
|
||||||
// TODO: do not hard-code, make this a property, race.healing
|
if (rc->healing>0) {
|
||||||
switch (old_race(u_race(u))) {
|
return rc->healing;
|
||||||
case RC_TROLL:
|
}
|
||||||
case RC_DAEMON:
|
if (r_isforest(u->region)) {
|
||||||
return 1.5;
|
static int rc_cache;
|
||||||
case RC_GOBLIN:
|
static const race *rc_elf;
|
||||||
return 2.0;
|
if (rc==rc_elf) {
|
||||||
case RC_ELF:
|
static int config;
|
||||||
elf_regen = get_param_flt(u_race(u)->parameters, "regen.forest", 1.0F);
|
static double elf_regen = 1.0;
|
||||||
if (elf_regen != 1.0 && r_isforest(u->region)) {
|
if (config_changed(&config)) {
|
||||||
|
elf_regen = get_param_flt(u_race(u)->parameters, "regen.forest", 1.0F);
|
||||||
|
}
|
||||||
return elf_regen;
|
return elf_regen;
|
||||||
}
|
}
|
||||||
return 1.0;
|
|
||||||
default:
|
|
||||||
return 1.0;
|
|
||||||
}
|
}
|
||||||
|
return 1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void monthly_healing(void)
|
void monthly_healing(void)
|
||||||
|
|
Loading…
Reference in a new issue