R919 - applying lances
Fixes 2 bugs: 1) an impossible() could occur if you applied a lance against a long worm because the code uses thitmonst to do the hitting, but didn't set bhitpos, which is required before calling thitmonst. Add the missing assignment. 2) applying a lance would never mark a knight as a caitiff. Added a new check_caitiff function and called it from the 2 existing checks and in the lance code.
This commit is contained in:
@@ -153,6 +153,8 @@ stone to flesh on a statue with contents would lose the contents if a
|
||||
monster was on the same location as the statue
|
||||
steed movement would use your speed if walking step by step
|
||||
kicking a known, unseen monster would sometimes leave behind an extra I symbol
|
||||
applying a lance against a long worm could cause an impossible
|
||||
a knight applying a lance did not do a caitiff check
|
||||
|
||||
|
||||
Platform- and/or Interface-Specific Fixes
|
||||
|
||||
@@ -1983,6 +1983,7 @@ E void NDECL(u_init);
|
||||
|
||||
E void FDECL(hurtmarmor,(struct monst *,int));
|
||||
E boolean FDECL(attack_checks, (struct monst *,struct obj *));
|
||||
E void FDECL(check_caitiff, (struct monst *));
|
||||
E schar FDECL(find_roll_to_hit, (struct monst *));
|
||||
E boolean FDECL(attack, (struct monst *));
|
||||
E boolean FDECL(hmon, (struct monst *,struct obj *,int));
|
||||
|
||||
@@ -2367,6 +2367,8 @@ use_pole (obj)
|
||||
if ((mtmp = m_at(cc.x, cc.y)) != (struct monst *)0) {
|
||||
int oldhp = mtmp->mhp;
|
||||
|
||||
bhitpos = cc;
|
||||
check_caitiff(mtmp);
|
||||
(void) thitmonst(mtmp, uwep);
|
||||
/* check the monster's HP because thitmonst() doesn't return
|
||||
* an indication of whether it hit. Not perfect (what if it's a
|
||||
|
||||
@@ -61,14 +61,7 @@ register boolean clumsy;
|
||||
|
||||
if(mon->m_ap_type) seemimic(mon);
|
||||
|
||||
/* it is unchivalrous to attack the defenseless or from behind */
|
||||
if (Role_if(PM_KNIGHT) &&
|
||||
u.ualign.type == A_LAWFUL && u.ualign.record > -10 &&
|
||||
(!mon->mcanmove || mon->msleeping ||
|
||||
(mon->mflee && !mon->mavenge))) {
|
||||
You_feel("like a caitiff!");
|
||||
adjalign(-1);
|
||||
}
|
||||
check_caitiff(mon);
|
||||
|
||||
/* squeeze some guilt feelings... */
|
||||
if(mon->mtame) {
|
||||
|
||||
25
src/uhitm.c
25
src/uhitm.c
@@ -205,6 +205,22 @@ struct obj *wep; /* uwep for attack(), null for kick_monster() */
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
/*
|
||||
* It is unchivalrous for a knight to attack the defenseless or from behind.
|
||||
*/
|
||||
void
|
||||
check_caitiff(mtmp)
|
||||
struct monst *mtmp;
|
||||
{
|
||||
if (Role_if(PM_KNIGHT) && u.ualign.type == A_LAWFUL &&
|
||||
(!mtmp->mcanmove || mtmp->msleeping ||
|
||||
(mtmp->mflee && !mtmp->mavenge)) &&
|
||||
u.ualign.record > -10) {
|
||||
You("caitiff!");
|
||||
adjalign(-1);
|
||||
}
|
||||
}
|
||||
|
||||
schar
|
||||
find_roll_to_hit(mtmp)
|
||||
register struct monst *mtmp;
|
||||
@@ -215,14 +231,7 @@ register struct monst *mtmp;
|
||||
tmp = 1 + Luck + abon() + find_mac(mtmp) + u.uhitinc +
|
||||
maybe_polyd(youmonst.data->mlevel, u.ulevel);
|
||||
|
||||
/* it is unchivalrous to attack the defenseless or from behind */
|
||||
if (Role_if(PM_KNIGHT) && u.ualign.type == A_LAWFUL &&
|
||||
(!mtmp->mcanmove || mtmp->msleeping ||
|
||||
(mtmp->mflee && !mtmp->mavenge)) &&
|
||||
u.ualign.record > -10) {
|
||||
You("caitiff!");
|
||||
adjalign(-1);
|
||||
}
|
||||
check_caitiff(mtmp);
|
||||
|
||||
/* attacking peaceful creatures is bad for the samurai's giri */
|
||||
if (Role_if(PM_SAMURAI) && mtmp->mpeaceful &&
|
||||
|
||||
Reference in New Issue
Block a user