diff --git a/src/common/gamecode/monster.c b/src/common/gamecode/monster.c index 441a9c231..ff12a3b03 100644 --- a/src/common/gamecode/monster.c +++ b/src/common/gamecode/monster.c @@ -45,6 +45,7 @@ #include #include #include +#include /* libc includes */ #include @@ -366,10 +367,12 @@ move_monster(region * r, unit * u) int dragon_affinity_value(region *r, unit *u) { + int m = count_all_money(r); + if(u->race == new_race[RC_FIREDRAGON]) { - return (1+rand() % 6) + (int) (count_all_money(r) * (0.1 + drand48())); + return (int)(normalvariate(m,m/2)); } else { - return (1+rand() % 6) + (int) (count_all_money(r) * (0.3 + drand48())); + return (int)(normalvariate(m,m/4)); } } diff --git a/src/common/races/dragons.c b/src/common/races/dragons.c index 3fd7e5d9b..8c18eaceb 100644 --- a/src/common/races/dragons.c +++ b/src/common/races/dragons.c @@ -47,7 +47,6 @@ age_dragon(unit *u) double q = (double) u->hp / (double) (unit_max_hp(u) * u->number); u->race = new_race[RC_WYRM]; u->irace = new_race[RC_WYRM]; - scale_number(u,1); u->hp = (int) (unit_max_hp(u) * u->number * q); } } diff --git a/src/common/util/rand.c b/src/common/util/rand.c index e463b496d..91336acf0 100644 --- a/src/common/util/rand.c +++ b/src/common/util/rand.c @@ -38,11 +38,6 @@ /* NormalRand aus python, random.py geklaut, dort ist Referenz auf * den Algorithmus. mu = Mittelwert, sigma = Standardabweichung. */ -/* Diese Funktion ist nicht thread-safe. - * (enno) sicher, das irgend eine andere es ist? - * Nebenbei: Ich glaub, sie ist es doch - */ - double nv_next; char valid_next = 0;