diff --git a/src/common/gamecode/monster.c b/src/common/gamecode/monster.c index f007af749..a6c91f1fb 100644 --- a/src/common/gamecode/monster.c +++ b/src/common/gamecode/monster.c @@ -110,7 +110,7 @@ get_money_for_dragon(region * r, unit * u, int wanted) /* falls genug geld in der region ist, treiben wir steuern ein. */ if (rmoney(r) >= wanted) { /* 5% chance, dass der drache aus einer laune raus attackiert */ - if (chance(0.95)) return parse_order(keywords[K_TAX], default_locale); + if (chance(1.0-u->race->aggression)) return parse_order(keywords[K_TAX], default_locale); } /* falls der drache launisch ist, oder das regionssilber knapp, greift er alle an */ diff --git a/src/common/kernel/race.h b/src/common/kernel/race.h index 9156078c8..d87d43ade 100644 --- a/src/common/kernel/race.h +++ b/src/common/kernel/race.h @@ -57,15 +57,16 @@ typedef struct race_syn { typedef struct race { const char *_name[4]; /* neu: name[4]völker */ - double magres; - double maxaura; /* Faktor auf Maximale Aura */ - double regaura; /* Faktor auf Regeneration */ + float magres; + float maxaura; /* Faktor auf Maximale Aura */ + float regaura; /* Faktor auf Regeneration */ int recruitcost; int maintenance; int splitsize; int weight; int capacity; - double speed; + float speed; + float aggression; /* chance that a monster will attack */ int hitpoints; const char *def_damage; char armor; @@ -113,7 +114,7 @@ extern int rc_specialdamage(const race *, const race *, const struct weapon_type #define RCF_PLAYERRACE (1<<0) /* can be played by a player. */ #define RCF_KILLPEASANTS (1<<1) /* Töten Bauern. Dämonen werden nicht über dieses Flag, sondern in randenc() behandelt. */ #define RCF_SCAREPEASANTS (1<<2) -#define RCF_ATTACKRANDOM (1<<3) + #define RCF_MOVERANDOM (1<<4) #define RCF_CANNOTMOVE (1<<5) #define RCF_LEARN (1<<6) /* Lernt automatisch wenn struct faction == 0 */ diff --git a/src/common/kernel/xmlreader.c b/src/common/kernel/xmlreader.c index 56504f4f0..759bb2575 100644 --- a/src/common/kernel/xmlreader.c +++ b/src/common/kernel/xmlreader.c @@ -785,16 +785,16 @@ parse_races(xmlDocPtr doc) rc->def_damage = strdup((const char*)property); xmlFree(property); - rc->magres = xml_fvalue(node, "magres", 0.0); - rc->maxaura = xml_fvalue(node, "maxaura", 0.0); - rc->regaura = xml_fvalue(node, "regaura", 1.0); + rc->magres = (float)xml_fvalue(node, "magres", 0.0); + rc->maxaura = (float)xml_fvalue(node, "maxaura", 0.0); + rc->regaura = (float)xml_fvalue(node, "regaura", 1.0); rc->recruitcost = xml_ivalue(node, "recruitcost", 0); rc->maintenance = xml_ivalue(node, "maintenance", 0); rc->weight = xml_ivalue(node, "weight", 0); #if RACE_CAPACITY rc->capacity = xml_ivalue(node, "capacity", 0); #endif - rc->speed = xml_fvalue(node, "speed", 0); + rc->speed = (float)xml_fvalue(node, "speed", 1.0F); rc->hitpoints = xml_ivalue(node, "hp", 0); rc->armor = (char)xml_ivalue(node, "ac", 0); @@ -847,8 +847,8 @@ parse_races(xmlDocPtr doc) xmlNodePtr node = result->nodesetval->nodeTab[k]; rc->splitsize = xml_ivalue(node, "splitsize", 0); + rc->aggression = (float)xml_fvalue(node, "aggression", 0.04); if (xml_bvalue(node, "killpeasants", false)) rc->flags |= RCF_KILLPEASANTS; - if (xml_bvalue(node, "attackrandom", false)) rc->flags |= RCF_ATTACKRANDOM; if (xml_bvalue(node, "moverandom", false)) rc->flags |= RCF_MOVERANDOM; if (xml_bvalue(node, "learn", false)) rc->flags |= RCF_LEARN; } diff --git a/src/res/races.xml b/src/res/races.xml index aa4db0805..ae3356626 100644 --- a/src/res/races.xml +++ b/src/res/races.xml @@ -570,13 +570,13 @@ - + - + @@ -616,14 +616,14 @@ - + - + @@ -649,7 +649,7 @@ - + @@ -669,7 +669,7 @@ - + @@ -682,7 +682,7 @@ - + @@ -696,7 +696,7 @@ - + @@ -716,14 +716,14 @@ - + - + @@ -742,7 +742,7 @@ - + @@ -768,7 +768,7 @@ - + @@ -800,7 +800,7 @@ - + @@ -829,7 +829,7 @@ - + @@ -861,7 +861,7 @@ - + @@ -892,7 +892,7 @@ - + @@ -908,7 +908,7 @@ - + @@ -967,7 +967,7 @@ - + @@ -993,7 +993,7 @@ - + @@ -1011,7 +1011,7 @@ - + @@ -1029,7 +1029,7 @@ - + @@ -1045,7 +1045,7 @@ - + @@ -1060,7 +1060,7 @@ - + @@ -1075,7 +1075,7 @@ - + @@ -1090,7 +1090,7 @@ - + @@ -1122,7 +1122,7 @@ - + @@ -1133,7 +1133,7 @@ - + @@ -1164,7 +1164,7 @@ - + @@ -1194,7 +1194,7 @@ - + @@ -1221,7 +1221,7 @@ - + @@ -1253,7 +1253,7 @@ - + @@ -1282,7 +1282,7 @@ - + @@ -1319,7 +1319,7 @@ - + @@ -1330,7 +1330,7 @@ - + @@ -1380,7 +1380,7 @@ - + @@ -1392,7 +1392,7 @@ - + @@ -1410,7 +1410,7 @@