diff --git a/conf/e2/config.json b/conf/e2/config.json index 6b11dceff..1ae7f77e5 100644 --- a/conf/e2/config.json +++ b/conf/e2/config.json @@ -23,7 +23,6 @@ "world.era": 2, "seed.population.min": 8, "seed.population.max": 8, - "rules.ship.damage_drift": 0.00, "rules.reserve.twophase": true, "rules.give.max_men": -1, "rules.check_overload": false, diff --git a/conf/e3/config.json b/conf/e3/config.json index a6685a06f..9e360de77 100644 --- a/conf/e3/config.json +++ b/conf/e3/config.json @@ -61,7 +61,6 @@ "rules.stealth.anon_battle": false, "rules.check_overload": false, "rules.combat.goblinbonus": 3, - "rules.ship.damage_drift": 0.00, "rules.alliances": true, "rules.combat.herospeed": 3, "rules.combat.demon_vampire": 5, diff --git a/conf/e4/config.json b/conf/e4/config.json index 90c60d72b..3b4bff30d 100644 --- a/conf/e4/config.json +++ b/conf/e4/config.json @@ -59,7 +59,6 @@ "rules.stealth.anon_battle": false, "rules.check_overload": false, "rules.combat.goblinbonus": 3, - "rules.ship.damage_drift": 0.00, "rules.alliances": true, "rules.combat.herospeed": 3, "rules.combat.demon_vampire": 5, diff --git a/src/monsters.c b/src/monsters.c index 0ab88fa61..432e4bb96 100644 --- a/src/monsters.c +++ b/src/monsters.c @@ -75,16 +75,14 @@ #define DRAGON_RANGE 20 /* Max. Distanz zum nächsten Drachenziel */ #define MAXILLUSION_TEXTS 3 +static double attack_chance; /* rules.monsters.attack_chance, or default 0.4 */ + static void give_peasants(unit *u, const item_type *itype, int reduce) { char buf[64]; slprintf(buf, sizeof(buf), "%s 0 %d %s", LOC(u->faction->locale, keyword(K_GIVE)), reduce, LOC(u->faction->locale, itype->rtype->_name)); unit_addorder(u, parse_order(buf, u->faction->locale)); } -static double monster_attack_chance(void) { - return get_param_flt(global.parameters, "rules.monsters.attack_chance", 0.4f); -} - static void reduce_weight(unit * u) { int capacity, weight = 0; @@ -160,7 +158,7 @@ static order *monster_attack(unit * u, const unit * target) static order *get_money_for_dragon(region * r, unit * u, int wanted) { int n; - bool attacks = monster_attack_chance() > 0.0; + bool attacks = attack_chance > 0.0; /* falls genug geld in der region ist, treiben wir steuern ein. */ if (rmoney(r) >= wanted) { @@ -759,14 +757,13 @@ static order *plan_dragon(unit * u) void plan_monsters(faction * f) { region *r; - double attack_chance = monster_attack_chance(); - + assert(f); + attack_chance = get_param_flt(global.parameters, "rules.monsters.attack_chance", 0.4); f->lastorders = turn; for (r = regions; r; r = r->next) { unit *u; - double rchance = attack_chance; bool attacking = false; for (u = r->units; u; u = u->next) { @@ -785,10 +782,8 @@ void plan_monsters(faction * f) produceexp(u, SK_PERCEPTION, u->number); } - if (rchance > 0.0) { - if (chance(rchance)) - attacking = true; - rchance = 0.0; + if (!attacking) { + if (chance(attack_chance)) attacking = true; } if (u->status > ST_BEHIND) { setstatus(u, ST_FIGHT); diff --git a/src/util/umlaut.c b/src/util/umlaut.c index 73a4195c2..872ad8ffd 100644 --- a/src/util/umlaut.c +++ b/src/util/umlaut.c @@ -260,7 +260,7 @@ int findtoken(const void * root, const char *key, variant * result) ref = ref->nexthash; str += len; if (!ref) { - log_info("findtoken | token not found '%s'\n", key); + log_debug("findtoken | token not found '%s'\n", key); return E_TOK_NOMATCH; } tk = ref->node; @@ -269,6 +269,6 @@ int findtoken(const void * root, const char *key, variant * result) *result = tk->id; return E_TOK_SUCCESS; } - log_info("findtoken | token not found '%s'\n", key); + log_debug("findtoken | token not found '%s'\n", key); return E_TOK_NOMATCH; }