33 if (! (mask & (1<<direction)))
36 assert(! offset.
zero());
37 const int x = offset.
dx();
38 const int y = offset.
dy();
39 for (
int dy=-1; dy<=1; ++dy)
41 for (
int dx=-1; dx<=1; ++dx)
45 has_unblockable_effect =
true;
52 for (
int i=1; i<8; ++i)
54 const int long_x = x*i;
55 const int long_y = y*i;
56 const int target_x = x*(i+1);
57 const int target_y = y*(i+1);
62 for (
int i=1; i<9; ++i)
64 const int long_x = x*i;
65 const int long_y = y*i;
66 for (
int dy=-1; dy<=1; ++dy)
68 const int target_y = long_y+dy;
69 if ((target_y < -8) || (8 < target_y))
71 for (
int dx=-1; dx<=1; ++dx)
73 const int target_x = long_x+dx;
74 if ((target_x < -8) || (8 < target_x))
107 if (abs(from.
y() - target.
y()) > 3)
109 if (abs(from.
x() - target.
x()) > 2)
112 else if (ptype ==
LANCE)
114 if (abs(from.
x() - target.
x()) > 1)
119 return hasEffectFromTo(state, ptypeo, from, target,
UL)
120 || hasEffectFromTo(state, ptypeo, from, target,
U)
121 || hasEffectFromTo(state, ptypeo, from, target,
UR)
122 || hasEffectFromTo(state, ptypeo, from, target,
L)
123 || hasEffectFromTo(state, ptypeo, from, target,
R)
124 || hasEffectFromTo(state, ptypeo, from, target,
DL)
125 || hasEffectFromTo(state, ptypeo, from, target,
D)
126 || hasEffectFromTo(state, ptypeo, from, target,
DR);