git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2801 c06c8d41-db1a-0410-9941-cceddc491573
FU7EQZLXD7YNGUUDHXCBI3VUKL6M2G3EPDY6FB5UA6B6RD4S5UOQC else
/* BCR - Added a check for monsters in the way. Only checks cardinal* directions. Knight moves are ignored. Assume the weapon* slips between the squares.*/// if we're attacking more than a space awayif ((x_distance > 1) || (y_distance > 1))
/* BCR - Added a check for monsters in the way. Only checks cardinal* directions. Knight moves are ignored. Assume the weapon* slips between the squares.*/
const int x_middle = MAX(beam.tx, you.x_pos) - (x_distance / 2);const int y_middle = MAX(beam.ty, you.y_pos) - (y_distance / 2);
// if we're attacking more than a space awayif ((x_distance > 1) || (y_distance > 1))
// if either the x or the y is the same, we should check for// a monster:if (((beam.tx == you.x_pos) || (beam.ty == you.y_pos))&& (mgrd[x_middle][y_middle] != NON_MONSTER))
skill = weapon_skill( you.inv[you.equip[EQ_WEAPON]].base_type,you.inv[you.equip[EQ_WEAPON]].sub_type );if ((5 + (3 * skill)) > random2(100)){mpr("You reach to attack!");you_attack(mgrd[beam.tx][beam.ty], false);}else{mpr("You could not reach far enough!");you_attack(mgrd[x_middle][y_middle], false);}
mpr("You reach to attack!");you_attack(mgrd[beam.tx][beam.ty], false);
// needed a cost to prevent evocation training abuse -- bwrdec_mp(1);make_hungry( 50, false );reaching_weapon_attack();pract = (one_chance_in(5) ? 1 : 0);did_work = true;
if ( reaching_weapon_attack(wpn) ){// needed a cost to prevent evocation training abuse -- bwrdec_mp(1);make_hungry( 50, false );pract = (one_chance_in(5) ? 1 : 0);did_work = true;}elsereturn false;