forked from github/server
Merge branch 'develop' of github.com:ennorehling/eressea into develop
This commit is contained in:
commit
237ec44ea0
16
src/battle.c
16
src/battle.c
|
@ -1153,7 +1153,8 @@ static void destroy_items(troop dt) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void calculate_defense_type(troop at, troop dt, 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 */
|
||||||
*defskill = weapon_effskill(dt, at, weapon, false, false);
|
*defskill = weapon_effskill(dt, at, weapon, false, false);
|
||||||
|
@ -1253,7 +1254,7 @@ static int apply_magicshield(int reduced_damage, fighter *df,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return reduced_damage;
|
return reduced_damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1265,25 +1266,22 @@ terminate(troop dt, troop at, int type, const char *damage_formula, bool missile
|
||||||
unit *au = af->unit;
|
unit *au = af->unit;
|
||||||
unit *du = df->unit;
|
unit *du = df->unit;
|
||||||
battle *b = df->side->battle;
|
battle *b = df->side->battle;
|
||||||
|
|
||||||
int armor_value;
|
int armor_value;
|
||||||
|
|
||||||
const weapon_type *dwtype = NULL;
|
const weapon_type *dwtype = NULL;
|
||||||
const weapon_type *awtype = NULL;
|
const weapon_type *awtype = NULL;
|
||||||
const armor_type *armor = NULL;
|
const armor_type *armor = NULL;
|
||||||
const armor_type *shield = NULL;
|
const armor_type *shield = NULL;
|
||||||
|
|
||||||
int reduced_damage, attskill = 0, defskill = 0;
|
int reduced_damage, attskill = 0, defskill = 0;
|
||||||
bool magic = false;
|
bool magic = false;
|
||||||
|
|
||||||
int damage = dice_rand(damage_formula);
|
int damage = dice_rand(damage_formula);
|
||||||
|
|
||||||
assert(du->number > 0);
|
assert(du->number > 0);
|
||||||
++at.fighter->hits;
|
++at.fighter->hits;
|
||||||
|
|
||||||
calculate_attack_type(at, dt, type, missile, &awtype, &attskill, &magic);
|
calculate_attack_type(at, dt, type, missile, &awtype, &attskill, &magic);
|
||||||
calculate_defense_type(at, dt, type, missile, &dwtype, &defskill);
|
calculate_defense_type(at, dt, type, missile, &dwtype, &defskill);
|
||||||
|
|
||||||
if (is_riding(at) && (awtype == NULL || (fval(awtype, WTF_HORSEBONUS)
|
if (is_riding(at) && (awtype == NULL || (fval(awtype, WTF_HORSEBONUS)
|
||||||
&& !fval(awtype, WTF_MISSILE)))) {
|
&& !fval(awtype, WTF_MISSILE)))) {
|
||||||
damage += CavalryBonus(au, dt, BONUS_DAMAGE);
|
damage += CavalryBonus(au, dt, BONUS_DAMAGE);
|
||||||
|
|
|
@ -260,7 +260,7 @@ static int tolua_faction_debug_messages(lua_State * L)
|
||||||
int i = 1;
|
int i = 1;
|
||||||
if (f->msgs) {
|
if (f->msgs) {
|
||||||
mlist *ml;
|
mlist *ml;
|
||||||
for (ml = self->msgs->begin; ml; ml = ml->next, ++i) {
|
for (ml = f->msgs->begin; ml; ml = ml->next, ++i) {
|
||||||
char buf[120];
|
char buf[120];
|
||||||
nr_render(ml->msg, default_locale, buf, sizeof(buf), NULL);
|
nr_render(ml->msg, default_locale, buf, sizeof(buf), NULL);
|
||||||
puts(buf);
|
puts(buf);
|
||||||
|
|
|
@ -1,8 +1,11 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
struct lua_State;
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct lua_State;
|
|
||||||
int tolua_factionlist_next(struct lua_State *L);
|
int tolua_factionlist_next(struct lua_State *L);
|
||||||
void tolua_faction_open(struct lua_State *L);
|
void tolua_faction_open(struct lua_State *L);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue