From a9c4d5c44bffc5cbbc68d89fbf7fbc2d6738def6 Mon Sep 17 00:00:00 2001 From: Christian Schlittchen Date: Sat, 23 Feb 2002 19:19:08 +0000 Subject: [PATCH] =?UTF-8?q?-=20Drachen,=20die=20Wyrme=20werden,=20splitten?= =?UTF-8?q?=20sich=20auf=20und=20rennen=20=09(hoffentlich)=20auseinander.?= =?UTF-8?q?=20-=20Drachenregionsbewertung=20leicht=20ver=C3=A4ndert.=20-?= =?UTF-8?q?=20Monsterverhalten=20muss=20beobachtet=20werden!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/gamecode/monster.c | 7 +++++-- src/common/races/dragons.c | 1 - src/common/util/rand.c | 5 ----- 3 files changed, 5 insertions(+), 8 deletions(-) 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;