forked from github/server
Merge pull request #827 from ennorehling/develop
Kampfzauber, Waffenwahl
This commit is contained in:
commit
6e070849fd
3 changed files with 7 additions and 16 deletions
|
@ -19,7 +19,7 @@ function test_undead_reserve_self()
|
||||||
assert_equal(1, u1:get_item("log"))
|
assert_equal(1, u1:get_item("log"))
|
||||||
end
|
end
|
||||||
|
|
||||||
function test_undead_reserve_other()
|
function skip_undead_reserve_other()
|
||||||
local r1 = region.create(0, 0, "plain")
|
local r1 = region.create(0, 0, "plain")
|
||||||
local f1 = faction.create("human")
|
local f1 = faction.create("human")
|
||||||
local u1 = unit.create(f1, r1, 1)
|
local u1 = unit.create(f1, r1, 1)
|
||||||
|
|
|
@ -1187,7 +1187,7 @@ static void destroy_items(troop dt) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void calculate_defense_type(troop dt, troop at, int type, bool missile,
|
static void calculate_defense_type(troop at, troop dt, int type, bool missile,
|
||||||
const weapon_type **dwtype, int *defskill) {
|
const weapon_type **dwtype, int *defskill) {
|
||||||
const weapon *weapon;
|
const weapon *weapon;
|
||||||
weapon = select_weapon(dt, false, true); /* missile=true to get the unmodified best weapon she has */
|
weapon = select_weapon(dt, false, true); /* missile=true to get the unmodified best weapon she has */
|
||||||
|
@ -1196,7 +1196,7 @@ static void calculate_defense_type(troop dt, troop at, int type, bool missile,
|
||||||
*dwtype = weapon->type;
|
*dwtype = weapon->type;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void calculate_attack_type(troop dt, troop at, int type, bool missile,
|
static void calculate_attack_type(troop at, troop dt, int type, bool missile,
|
||||||
const weapon_type **awtype, int *attskill, bool *magic) {
|
const weapon_type **awtype, int *attskill, bool *magic) {
|
||||||
const weapon *weapon;
|
const weapon *weapon;
|
||||||
|
|
||||||
|
|
|
@ -812,19 +812,14 @@ void bufunit(const faction * f, const unit * u, const faction *fv,
|
||||||
if (book) {
|
if (book) {
|
||||||
selist *ql = book->spells;
|
selist *ql = book->spells;
|
||||||
int qi, header, maxlevel = effskill(u, SK_MAGIC, 0);
|
int qi, header, maxlevel = effskill(u, SK_MAGIC, 0);
|
||||||
sbs_strcat(sbp, ". Aura ");
|
sbs_printf(sbp, ". Aura %d/%d", get_spellpoints(u), max_spellpoints(u, NULL));
|
||||||
sbs_strcat(sbp, str_itoa(get_spellpoints(u)));
|
|
||||||
sbs_strcat(sbp, "/");
|
|
||||||
sbs_strcat(sbp, str_itoa(max_spellpoints(u, NULL)));
|
|
||||||
|
|
||||||
for (header = 0, qi = 0; ql; selist_advance(&ql, &qi, 1)) {
|
for (header = 0, qi = 0; ql; selist_advance(&ql, &qi, 1)) {
|
||||||
spellbook_entry * sbe = (spellbook_entry *)selist_get(ql, qi);
|
spellbook_entry * sbe = (spellbook_entry *)selist_get(ql, qi);
|
||||||
const spell *sp = spellref_get(&sbe->spref);
|
const spell *sp = spellref_get(&sbe->spref);
|
||||||
if (sbe->level <= maxlevel) {
|
if (sbe->level <= maxlevel) {
|
||||||
if (!header) {
|
if (!header) {
|
||||||
sbs_strcat(sbp, ", ");
|
sbs_printf(sbp, ", %s: ", LOC(lang, "nr_spells"));
|
||||||
sbs_strcat(sbp, LOC(lang, "nr_spells"));
|
|
||||||
sbs_strcat(sbp, ": ");
|
|
||||||
header = 1;
|
header = 1;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -840,9 +835,7 @@ void bufunit(const faction * f, const unit * u, const faction *fv,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (i != MAXCOMBATSPELLS) {
|
if (i != MAXCOMBATSPELLS) {
|
||||||
sbs_strcat(sbp, ", ");
|
sbs_printf(sbp, ", %s: ", LOC(lang, "nr_combatspells"));
|
||||||
sbs_strcat(sbp, LOC(lang, "nr_combatspells"));
|
|
||||||
sbs_strcat(sbp, ": ");
|
|
||||||
dh = 0;
|
dh = 0;
|
||||||
for (i = 0; i < MAXCOMBATSPELLS; i++) {
|
for (i = 0; i < MAXCOMBATSPELLS; i++) {
|
||||||
const spell *sp;
|
const spell *sp;
|
||||||
|
@ -857,9 +850,7 @@ void bufunit(const faction * f, const unit * u, const faction *fv,
|
||||||
int sl = get_combatspelllevel(u, i);
|
int sl = get_combatspelllevel(u, i);
|
||||||
sbs_strcat(sbp, spell_name(sp, lang));
|
sbs_strcat(sbp, spell_name(sp, lang));
|
||||||
if (sl > 0) {
|
if (sl > 0) {
|
||||||
sbs_strcat(sbp, "( ");
|
sbs_printf(sbp, "(%d)", sl);
|
||||||
sbs_strcat(sbp, str_itoa(sl));
|
|
||||||
sbs_strcat(sbp, ")");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Reference in a new issue