This commit is contained in:
Enno Rehling 2014-07-26 22:52:31 +02:00
commit d994caf7a3
8 changed files with 100 additions and 79 deletions

View File

@ -8,7 +8,7 @@ memcheck = 0
locales = de,en locales = de,en
[config] [config]
game = eressea rules = eressea
source_dir = .. source_dir = ..
maxnmrs = 10 maxnmrs = 10

View File

@ -8,7 +8,7 @@ memcheck = 0
locales = de,en locales = de,en
[config] [config]
game = e3a rules = e3a
source_dir = .. source_dir = ..
maxnmrs = 20 maxnmrs = 20

View File

@ -18,5 +18,5 @@ fi
$ROOT/$BIN_DIR/eressea/test_eressea $ROOT/$BIN_DIR/eressea/test_eressea
cd $ROOT cd $ROOT
$ROOT/$BIN_DIR/eressea/eressea -v0 scripts/runtests.lua $ROOT/$BIN_DIR/eressea/eressea -v0 scripts/runtests.lua
grep ERROR eressea.log #grep ERROR eressea.log
cd $OLDWPD cd $OLDWPD

View File

@ -137,9 +137,9 @@ function test_ship_capacity()
process_orders() process_orders()
-- print(s.region, u.region, r2) -- print(s.region, u.region, r2)
assert_equal(r2.id, u1.region.id, "boat with 5 humans did not move") assert_equal(r2, u1.region, "boat with 5 humans did not move")
assert_not_equal(r2.id, u2.region.id, "boat with too many people has moved") assert_not_equal(r2, u2.region, "boat with too many people has moved")
assert_not_equal(r2.id, u4.region.id, "boat with too much cargo has moved") assert_not_equal(r2, u4.region, "boat with too much cargo has moved")
end end
function test_levitate() function test_levitate()

View File

@ -1,3 +1,3 @@
#define VERSION_MAJOR 3 #define VERSION_MAJOR 3
#define VERSION_MINOR 0 #define VERSION_MINOR 0
#define VERSION_BUILD 680 #define VERSION_BUILD 681

View File

@ -1164,17 +1164,10 @@ void economics(region * r)
for (u = r->units; u; u = u->next) { for (u = r->units; u; u = u->next) {
order *ord; order *ord;
bool destroyed = false;
if (u->number > 0) { if (u->number > 0) {
for (ord = u->orders; ord; ord = ord->next) { for (ord = u->orders; ord; ord = ord->next) {
keyword_t kwd = getkeyword(ord); keyword_t kwd = getkeyword(ord);
if (kwd == K_DESTROY) { if (kwd == K_GIVE) {
if (!destroyed) {
if (destroy_cmd(u, ord) != 0)
ord = NULL;
destroyed = true;
}
} else if (kwd == K_GIVE) {
give_cmd(u, ord); give_cmd(u, ord);
} else if (kwd == K_FORGET) { } else if (kwd == K_FORGET) {
forget_cmd(u, ord); forget_cmd(u, ord);
@ -1207,6 +1200,27 @@ void economics(region * r)
if (recruitorders) if (recruitorders)
expandrecruit(r, recruitorders); expandrecruit(r, recruitorders);
remove_empty_units_in_region(r); remove_empty_units_in_region(r);
for (u = r->units; u; u = u->next) {
order *ord;
bool destroyed = false;
if (u->number > 0) {
for (ord = u->orders; ord; ord = ord->next) {
keyword_t kwd = getkeyword(ord);
if (kwd == K_DESTROY) {
if (!destroyed) {
if (destroy_cmd(u, ord) != 0)
ord = NULL;
destroyed = true;
}
}
if (u->orders == NULL) {
break;
}
}
}
}
} }
/* ------------------------------------------------------------- */ /* ------------------------------------------------------------- */

View File

@ -135,8 +135,12 @@ void equip_unit_mask(struct unit *u, const struct equipment *eq, int mask)
for (sk = 0; sk != MAXSKILLS; ++sk) { for (sk = 0; sk != MAXSKILLS; ++sk) {
if (eq->skills[sk] != NULL) { if (eq->skills[sk] != NULL) {
int i = dice_rand(eq->skills[sk]); int i = dice_rand(eq->skills[sk]);
if (i > 0) if (i > 0) {
set_level(u, (skill_t)sk, i); set_level(u, (skill_t)sk, i);
if (sk==SK_STAMINA) {
u->hp = unit_max_hp(u) * u->number;
}
}
} }
} }
} }

View File

@ -3234,6 +3234,9 @@ static void skill_summoned(unit * u, int level)
set_level(u, sk, level); set_level(u, sk, level);
} }
} }
if (rc->bonus[SK_STAMINA]) {
u->hp = unit_max_hp(u) * u->number;
}
} }
} }
@ -4928,7 +4931,7 @@ int sp_resist_magic_bonus(castorder * co)
float power = co->force; float power = co->force;
spellparameter *pa = co->par; spellparameter *pa = co->par;
/* Pro Stufe koennen bis zu 5 Personen verzaubert werden */ /* Pro Stufe koennen bis zu 5 Personen verzaubert werden */
double maxvictims = 5; double maxvictims = 5 * power;
int victims = (int)maxvictims; int victims = (int)maxvictims;
/* Schleife ueber alle angegebenen Einheiten */ /* Schleife ueber alle angegebenen Einheiten */