forked from github/server
testing spells is a lot easier when you can disable fumbles
all tun_tests tests pass
This commit is contained in:
parent
3fa4a31d14
commit
bcd6991703
|
@ -4,6 +4,7 @@ module("tests.spells", package.seeall, lunit.testcase)
|
||||||
|
|
||||||
function setup()
|
function setup()
|
||||||
free_game()
|
free_game()
|
||||||
|
settings.set("magic.fumble.enable", "0")
|
||||||
end
|
end
|
||||||
|
|
||||||
function test_roi()
|
function test_roi()
|
||||||
|
|
|
@ -1119,7 +1119,7 @@ const item_type *finditemtype(const char *name, const struct locale *lang)
|
||||||
in->next = inames;
|
in->next = inames;
|
||||||
in->lang = lang;
|
in->lang = lang;
|
||||||
do {
|
do {
|
||||||
m = cb_find_prefix(&cb_items, "", 1, matches, CB_BATCHSIZE, offset);
|
m = cb_find_prefix(&cb_items, "", 0, matches, CB_BATCHSIZE, offset);
|
||||||
if (m) {
|
if (m) {
|
||||||
int i;
|
int i;
|
||||||
offset += m;
|
offset += m;
|
||||||
|
@ -1207,6 +1207,8 @@ void test_clear_resources(void)
|
||||||
|
|
||||||
r_hp = r_silver = r_aura = r_permaura = r_unit = 0;
|
r_hp = r_silver = r_aura = r_permaura = r_unit = 0;
|
||||||
i_silver = 0;
|
i_silver = 0;
|
||||||
|
|
||||||
|
inames = 0; /* TODO: this is a terrible hack, the whole inames global state must die */
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -1314,7 +1314,11 @@ boolean fumble(region * r, unit * u, const spell * sp, int cast_grade)
|
||||||
int patzer = (int)(((double)x * 40.0) - 20.0);
|
int patzer = (int)(((double)x * 40.0) - 20.0);
|
||||||
struct building *b = inside_building(u);
|
struct building *b = inside_building(u);
|
||||||
const struct building_type *btype = b ? b->type : NULL;
|
const struct building_type *btype = b ? b->type : NULL;
|
||||||
|
int fumble_enabled = get_param_int(global.parameters, "magic.fumble.enable", 1);
|
||||||
|
|
||||||
|
if (!fumble_enabled) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (btype)
|
if (btype)
|
||||||
patzer -= btype->fumblebonus;
|
patzer -= btype->fumblebonus;
|
||||||
/* CHAOSPATZERCHANCE 10 : +10% Chance zu Patzern */
|
/* CHAOSPATZERCHANCE 10 : +10% Chance zu Patzern */
|
||||||
|
|
Loading…
Reference in New Issue